diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a565797 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +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 (ruby ${{ matrix.ruby }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: ['3.3', '3.4'] + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Load every file + run: bundle exec ruby -Ilib -e "require 'flat_api'; puts FlatApi::VERSION" diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml deleted file mode 100644 index 5dc8d36..0000000 --- a/.github/workflows/gem-push.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Ruby Gem - -on: - push: - branches: [ "master" ] - -jobs: - build: - name: Build + Publish - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - packages: write - steps: - - uses: actions/checkout@v3 - - name: Set up Ruby 3.3 - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.3 - - name: Install dependencies - run: | - bundle install - - name: Run tests - run: | - bundle exec rspec - - uses: google-github-actions/release-please-action@v4 - id: release - with: - release-type: ruby - package-name: flat_api - bump-minor-pre-major: true - version-file: "lib/flat_api/version.rb" - - name: Publish to GPR - run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - gem build *.gemspec - gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem - env: - GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}" - OWNER: ${{ github.repository_owner }} - if: ${{ steps.release.outputs.release_created }} - - name: Publish to RubyGems - run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - gem build *.gemspec - gem push *.gem - env: - GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" - if: ${{ steps.release.outputs.release_created }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..966e904 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +# Publishing is triggered by a version tag and nothing else (FR-019a). + +on: + push: + tags: ['[0-9]+.[0-9]+.[0-9]+'] + +permissions: + contents: read + id-token: write # OIDC for RubyGems trusted publishing (FR-021a) + +jobs: + publish: + runs-on: ubuntu-latest + environment: rubygems + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.4' + bundler-cache: true + + - name: The tag must match the packaged version + run: | + TAG="${GITHUB_REF_NAME}" + PKG="$(ruby -Ilib -e "require 'flat_api/version'; print FlatApi::VERSION")" + [ "$TAG" = "$PKG" ] || { echo "tag $TAG != VERSION $PKG"; exit 1; } + + - run: gem build flat_api.gemspec + + # No API key: RubyGems trusts this repository and workflow by OIDC. + - uses: rubygems/release-gem@v1 diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml deleted file mode 100644 index f6468a8..0000000 --- a/.github/workflows/ruby.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake -# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby - -name: Ruby - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -permissions: - contents: read - -jobs: - test: - - runs-on: ubuntu-latest - strategy: - matrix: - ruby-version: ['3.0', '3.1', '3.3'] - - steps: - - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - run: bundle exec rspec - - run: bundle exec rake build - - run: bundle exec rake install diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml new file mode 100644 index 0000000..477d6d6 --- /dev/null +++ b/.github/workflows/tag-on-merge.yml @@ -0,0 +1,47 @@ +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. + # Checked before checkout. An empty token there surfaces as a bare "Input required and not + # supplied: token", which says nothing about which secret is missing or why it matters. + - name: SDK_RELEASE_TOKEN must be set + run: | + test -n "${{ secrets.SDK_RELEASE_TOKEN }}" || { + echo "SDK_RELEASE_TOKEN is not set on this repository." + echo + echo "The tag has to be pushed with it rather than the automatic GITHUB_TOKEN, because" + echo "GitHub does not start a workflow run for an event created with that token. The" + echo "tag would appear and release.yml would never fire, publishing nothing." + exit 1 + } + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.SDK_RELEASE_TOKEN }} + - name: Tag the version if it is new + run: | + 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 05a17cb..3f7f166 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,9 @@ build/ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc + +# build artifacts +*.gem +.sdkgen-scratch/ +.openapi-spec.yaml +.DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ae083b5..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,26 +0,0 @@ -.ruby: &ruby - variables: - LANG: "C.UTF-8" - before_script: - - ruby -v - - bundle config set --local deployment true - - bundle install -j $(nproc) - parallel: - matrix: - - RUBY_VERSION: ['3.0', '3.1'] - image: "ruby:$RUBY_VERSION" - cache: - paths: - - vendor/ruby - key: 'ruby-$RUBY_VERSION' - -gem: - extends: .ruby - script: - - bundle exec rspec - - bundle exec rake build - - bundle exec rake install - artifacts: - paths: - - pkg/*.gem - diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index aefa4a6..dde0368 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,5 +1,6 @@ .gitignore .gitlab-ci.yml +.openapi-generator-ignore .rspec .rubocop.yml .travis.yml @@ -7,6 +8,8 @@ Gemfile README.md Rakefile docs/AccountApi.md +docs/AddGroupUser200Response.md +docs/AddGroupUserRequest.md docs/ApiAccessToken.md docs/AppScopes.md docs/Assignment.md @@ -16,6 +19,7 @@ docs/AssignmentCopy.md docs/AssignmentCopyResponse.md docs/AssignmentCopyToClass.md docs/AssignmentCopyToResourceLibrary.md +docs/AssignmentGroup.md docs/AssignmentSubmission.md docs/AssignmentSubmissionComment.md docs/AssignmentSubmissionCommentCreation.md @@ -24,8 +28,9 @@ docs/AssignmentSubmissionHistory.md docs/AssignmentSubmissionHistoryAttachment.md docs/AssignmentSubmissionHistoryState.md docs/AssignmentSubmissionLti.md -docs/AssignmentSubmissionPlaybackInner.md +docs/AssignmentSubmissionPlayback.md docs/AssignmentSubmissionState.md +docs/AssignmentSubmissionStudentsMode.md docs/AssignmentSubmissionUpdate.md docs/AssignmentType.md docs/AssignmentUpdate.md @@ -57,12 +62,15 @@ docs/Collection.md docs/CollectionApi.md docs/CollectionApp.md docs/CollectionCapabilities.md +docs/CollectionContents.md docs/CollectionCreation.md docs/CollectionModification.md docs/CollectionPrivacy.md docs/CollectionType.md +docs/CreditTransaction.md docs/EduLibrary.md docs/EduResource.md +docs/EduResourceAssignmentCreation.md docs/EduResourceCapabilities.md docs/EduResourceCopy.md docs/EduResourceCreation.md @@ -76,27 +84,73 @@ docs/EduResourceUpdate.md docs/EduResourceUseInClass.md docs/EduResourcesApi.md docs/FlatErrorResponse.md -docs/FlatLocales.md docs/GoogleClassroomCoursework.md docs/GoogleClassroomSubmission.md +docs/Grade.md docs/Group.md docs/GroupApi.md +docs/GroupCreation.md docs/GroupDetails.md docs/GroupType.md docs/LicenseMode.md docs/LicenseSources.md docs/LmsName.md +docs/LtiConfiguration.md +docs/LtiConfiguration1p1.md +docs/LtiConfiguration1p1AllOfTool.md +docs/LtiConfiguration1p3.md +docs/LtiConfiguration1p3Base.md +docs/LtiConfiguration1p3BaseSupportedServices.md +docs/LtiConfiguration1p3BaseSupportedServicesAgs.md +docs/LtiConfiguration1p3BaseSupportedServicesDeepLinking.md +docs/LtiConfiguration1p3BaseSupportedServicesNrps.md +docs/LtiConfiguration1p3BaseTool.md +docs/LtiConfiguration1p3Deployment.md +docs/LtiConfiguration1p3Dynamic.md +docs/LtiConfiguration1p3Manual.md +docs/LtiConfigurationBase.md +docs/LtiConfigurationCreate.md +docs/LtiConfigurationCreate1p1.md +docs/LtiConfigurationCreate1p3Deployment.md +docs/LtiConfigurationCreate1p3Dynamic.md +docs/LtiConfigurationCreate1p3DynamicPlatformInfo.md +docs/LtiConfigurationCreate1p3Manual.md +docs/LtiConfigurationUpdate.md +docs/LtiConfigurationUpdateDeployment.md +docs/LtiConfigurationUpdateStandalone.md docs/LtiCredentials.md docs/LtiCredentialsCreation.md docs/MediaAttachment.md docs/MediaScoreSharingMode.md docs/MicrosoftGraphAssignment.md docs/MicrosoftGraphSubmission.md +docs/OMRApi.md +docs/OmrCapabilities.md +docs/OmrDetailsStepData.md +docs/OmrDetailsSubmission.md +docs/OmrDetectedInstrument.md +docs/OmrImportedMetadata.md +docs/OmrInstrumentOverride.md +docs/OmrJob.md +docs/OmrJobCreation.md +docs/OmrJobFileMetadata.md +docs/OmrJobFileUpload.md +docs/OmrJobFileUploadResult.md +docs/OmrJobInputFile.md +docs/OmrJobOutput.md +docs/OmrJobProgress.md +docs/OmrJobResult.md +docs/OmrJobRetention.md +docs/OmrJobStatus.md +docs/OmrLocaleDetails.md +docs/OmrPendingStep.md +docs/OmrStepName.md docs/OrganizationApi.md docs/OrganizationInvitation.md docs/OrganizationInvitationCreation.md docs/OrganizationRoles.md docs/OrganizationUserAccessTokenCreation.md +docs/RenameGroupRequest.md docs/ResourceCollaborator.md docs/ResourceCollaboratorCreation.md docs/ResourceRights.md @@ -118,6 +172,7 @@ docs/ScoreCreationFileImport.md docs/ScoreCreationGoogleDriveImport.md docs/ScoreCreationType.md docs/ScoreDetails.md +docs/ScoreDetailsAllOfMe.md docs/ScoreFork.md docs/ScoreLicense.md docs/ScoreLikesCounts.md @@ -131,6 +186,7 @@ docs/ScoreSource.md docs/ScoreSummary.md docs/ScoreTrack.md docs/ScoreTrackCreation.md +docs/ScoreTrackCreationResponse.md docs/ScoreTrackPoint.md docs/ScoreTrackPurpose.md docs/ScoreTrackState.md @@ -142,6 +198,7 @@ docs/TaskApi.md docs/TaskExportOptions.md docs/TaskProgress.md docs/TaskResult.md +docs/TeachingTheme.md docs/TutteoProduct.md docs/UserAdminUpdate.md docs/UserApi.md @@ -164,13 +221,17 @@ lib/flat_api/api/class_api.rb lib/flat_api/api/collection_api.rb lib/flat_api/api/edu_resources_api.rb lib/flat_api/api/group_api.rb +lib/flat_api/api/omr_api.rb lib/flat_api/api/organization_api.rb lib/flat_api/api/score_api.rb lib/flat_api/api/task_api.rb lib/flat_api/api/user_api.rb lib/flat_api/api_client.rb lib/flat_api/api_error.rb +lib/flat_api/api_model_base.rb lib/flat_api/configuration.rb +lib/flat_api/models/add_group_user200_response.rb +lib/flat_api/models/add_group_user_request.rb lib/flat_api/models/api_access_token.rb lib/flat_api/models/app_scopes.rb lib/flat_api/models/assignment.rb @@ -180,6 +241,7 @@ lib/flat_api/models/assignment_copy.rb lib/flat_api/models/assignment_copy_response.rb lib/flat_api/models/assignment_copy_to_class.rb lib/flat_api/models/assignment_copy_to_resource_library.rb +lib/flat_api/models/assignment_group.rb lib/flat_api/models/assignment_submission.rb lib/flat_api/models/assignment_submission_comment.rb lib/flat_api/models/assignment_submission_comment_creation.rb @@ -188,8 +250,9 @@ lib/flat_api/models/assignment_submission_history.rb lib/flat_api/models/assignment_submission_history_attachment.rb lib/flat_api/models/assignment_submission_history_state.rb lib/flat_api/models/assignment_submission_lti.rb -lib/flat_api/models/assignment_submission_playback_inner.rb +lib/flat_api/models/assignment_submission_playback.rb lib/flat_api/models/assignment_submission_state.rb +lib/flat_api/models/assignment_submission_students_mode.rb lib/flat_api/models/assignment_submission_update.rb lib/flat_api/models/assignment_type.rb lib/flat_api/models/assignment_update.rb @@ -219,12 +282,15 @@ lib/flat_api/models/class_update.rb lib/flat_api/models/collection.rb lib/flat_api/models/collection_app.rb lib/flat_api/models/collection_capabilities.rb +lib/flat_api/models/collection_contents.rb lib/flat_api/models/collection_creation.rb lib/flat_api/models/collection_modification.rb lib/flat_api/models/collection_privacy.rb lib/flat_api/models/collection_type.rb +lib/flat_api/models/credit_transaction.rb lib/flat_api/models/edu_library.rb lib/flat_api/models/edu_resource.rb +lib/flat_api/models/edu_resource_assignment_creation.rb lib/flat_api/models/edu_resource_capabilities.rb lib/flat_api/models/edu_resource_copy.rb lib/flat_api/models/edu_resource_creation.rb @@ -237,25 +303,70 @@ lib/flat_api/models/edu_resource_type.rb lib/flat_api/models/edu_resource_update.rb lib/flat_api/models/edu_resource_use_in_class.rb lib/flat_api/models/flat_error_response.rb -lib/flat_api/models/flat_locales.rb lib/flat_api/models/google_classroom_coursework.rb lib/flat_api/models/google_classroom_submission.rb +lib/flat_api/models/grade.rb lib/flat_api/models/group.rb +lib/flat_api/models/group_creation.rb lib/flat_api/models/group_details.rb lib/flat_api/models/group_type.rb lib/flat_api/models/license_mode.rb lib/flat_api/models/license_sources.rb lib/flat_api/models/lms_name.rb +lib/flat_api/models/lti_configuration.rb +lib/flat_api/models/lti_configuration1p1.rb +lib/flat_api/models/lti_configuration1p1_all_of_tool.rb +lib/flat_api/models/lti_configuration1p3.rb +lib/flat_api/models/lti_configuration1p3_base.rb +lib/flat_api/models/lti_configuration1p3_base_supported_services.rb +lib/flat_api/models/lti_configuration1p3_base_supported_services_ags.rb +lib/flat_api/models/lti_configuration1p3_base_supported_services_deep_linking.rb +lib/flat_api/models/lti_configuration1p3_base_supported_services_nrps.rb +lib/flat_api/models/lti_configuration1p3_base_tool.rb +lib/flat_api/models/lti_configuration1p3_deployment.rb +lib/flat_api/models/lti_configuration1p3_dynamic.rb +lib/flat_api/models/lti_configuration1p3_manual.rb +lib/flat_api/models/lti_configuration_base.rb +lib/flat_api/models/lti_configuration_create.rb +lib/flat_api/models/lti_configuration_create1p1.rb +lib/flat_api/models/lti_configuration_create1p3_deployment.rb +lib/flat_api/models/lti_configuration_create1p3_dynamic.rb +lib/flat_api/models/lti_configuration_create1p3_dynamic_platform_info.rb +lib/flat_api/models/lti_configuration_create1p3_manual.rb +lib/flat_api/models/lti_configuration_update.rb +lib/flat_api/models/lti_configuration_update_deployment.rb +lib/flat_api/models/lti_configuration_update_standalone.rb lib/flat_api/models/lti_credentials.rb lib/flat_api/models/lti_credentials_creation.rb lib/flat_api/models/media_attachment.rb lib/flat_api/models/media_score_sharing_mode.rb lib/flat_api/models/microsoft_graph_assignment.rb lib/flat_api/models/microsoft_graph_submission.rb +lib/flat_api/models/omr_capabilities.rb +lib/flat_api/models/omr_details_step_data.rb +lib/flat_api/models/omr_details_submission.rb +lib/flat_api/models/omr_detected_instrument.rb +lib/flat_api/models/omr_imported_metadata.rb +lib/flat_api/models/omr_instrument_override.rb +lib/flat_api/models/omr_job.rb +lib/flat_api/models/omr_job_creation.rb +lib/flat_api/models/omr_job_file_metadata.rb +lib/flat_api/models/omr_job_file_upload.rb +lib/flat_api/models/omr_job_file_upload_result.rb +lib/flat_api/models/omr_job_input_file.rb +lib/flat_api/models/omr_job_output.rb +lib/flat_api/models/omr_job_progress.rb +lib/flat_api/models/omr_job_result.rb +lib/flat_api/models/omr_job_retention.rb +lib/flat_api/models/omr_job_status.rb +lib/flat_api/models/omr_locale_details.rb +lib/flat_api/models/omr_pending_step.rb +lib/flat_api/models/omr_step_name.rb lib/flat_api/models/organization_invitation.rb lib/flat_api/models/organization_invitation_creation.rb lib/flat_api/models/organization_roles.rb lib/flat_api/models/organization_user_access_token_creation.rb +lib/flat_api/models/rename_group_request.rb lib/flat_api/models/resource_collaborator.rb lib/flat_api/models/resource_collaborator_creation.rb lib/flat_api/models/resource_rights.rb @@ -276,6 +387,7 @@ lib/flat_api/models/score_creation_file_import.rb lib/flat_api/models/score_creation_google_drive_import.rb lib/flat_api/models/score_creation_type.rb lib/flat_api/models/score_details.rb +lib/flat_api/models/score_details_all_of_me.rb lib/flat_api/models/score_fork.rb lib/flat_api/models/score_license.rb lib/flat_api/models/score_likes_counts.rb @@ -289,6 +401,7 @@ lib/flat_api/models/score_source.rb lib/flat_api/models/score_summary.rb lib/flat_api/models/score_track.rb lib/flat_api/models/score_track_creation.rb +lib/flat_api/models/score_track_creation_response.rb lib/flat_api/models/score_track_point.rb lib/flat_api/models/score_track_purpose.rb lib/flat_api/models/score_track_state.rb @@ -299,6 +412,7 @@ lib/flat_api/models/task.rb lib/flat_api/models/task_export_options.rb lib/flat_api/models/task_progress.rb lib/flat_api/models/task_result.rb +lib/flat_api/models/teaching_theme.rb lib/flat_api/models/tutteo_product.rb lib/flat_api/models/user_admin_update.rb lib/flat_api/models/user_azure_details.rb @@ -318,10 +432,13 @@ spec/api/class_api_spec.rb spec/api/collection_api_spec.rb spec/api/edu_resources_api_spec.rb spec/api/group_api_spec.rb +spec/api/omr_api_spec.rb spec/api/organization_api_spec.rb spec/api/score_api_spec.rb spec/api/task_api_spec.rb spec/api/user_api_spec.rb +spec/models/add_group_user200_response_spec.rb +spec/models/add_group_user_request_spec.rb spec/models/api_access_token_spec.rb spec/models/app_scopes_spec.rb spec/models/assignment_capabilities_can_publish_in_class_error_spec.rb @@ -330,6 +447,7 @@ spec/models/assignment_copy_response_spec.rb spec/models/assignment_copy_spec.rb spec/models/assignment_copy_to_class_spec.rb spec/models/assignment_copy_to_resource_library_spec.rb +spec/models/assignment_group_spec.rb spec/models/assignment_spec.rb spec/models/assignment_submission_comment_creation_spec.rb spec/models/assignment_submission_comment_spec.rb @@ -338,9 +456,10 @@ spec/models/assignment_submission_history_attachment_spec.rb spec/models/assignment_submission_history_spec.rb spec/models/assignment_submission_history_state_spec.rb spec/models/assignment_submission_lti_spec.rb -spec/models/assignment_submission_playback_inner_spec.rb +spec/models/assignment_submission_playback_spec.rb spec/models/assignment_submission_spec.rb spec/models/assignment_submission_state_spec.rb +spec/models/assignment_submission_students_mode_spec.rb spec/models/assignment_submission_update_spec.rb spec/models/assignment_type_spec.rb spec/models/assignment_update_spec.rb @@ -369,12 +488,15 @@ spec/models/class_state_spec.rb spec/models/class_update_spec.rb spec/models/collection_app_spec.rb spec/models/collection_capabilities_spec.rb +spec/models/collection_contents_spec.rb spec/models/collection_creation_spec.rb spec/models/collection_modification_spec.rb spec/models/collection_privacy_spec.rb spec/models/collection_spec.rb spec/models/collection_type_spec.rb +spec/models/credit_transaction_spec.rb spec/models/edu_library_spec.rb +spec/models/edu_resource_assignment_creation_spec.rb spec/models/edu_resource_capabilities_spec.rb spec/models/edu_resource_copy_spec.rb spec/models/edu_resource_creation_spec.rb @@ -388,25 +510,70 @@ spec/models/edu_resource_type_spec.rb spec/models/edu_resource_update_spec.rb spec/models/edu_resource_use_in_class_spec.rb spec/models/flat_error_response_spec.rb -spec/models/flat_locales_spec.rb spec/models/google_classroom_coursework_spec.rb spec/models/google_classroom_submission_spec.rb +spec/models/grade_spec.rb +spec/models/group_creation_spec.rb spec/models/group_details_spec.rb spec/models/group_spec.rb spec/models/group_type_spec.rb spec/models/license_mode_spec.rb spec/models/license_sources_spec.rb spec/models/lms_name_spec.rb +spec/models/lti_configuration1p1_all_of_tool_spec.rb +spec/models/lti_configuration1p1_spec.rb +spec/models/lti_configuration1p3_base_spec.rb +spec/models/lti_configuration1p3_base_supported_services_ags_spec.rb +spec/models/lti_configuration1p3_base_supported_services_deep_linking_spec.rb +spec/models/lti_configuration1p3_base_supported_services_nrps_spec.rb +spec/models/lti_configuration1p3_base_supported_services_spec.rb +spec/models/lti_configuration1p3_base_tool_spec.rb +spec/models/lti_configuration1p3_deployment_spec.rb +spec/models/lti_configuration1p3_dynamic_spec.rb +spec/models/lti_configuration1p3_manual_spec.rb +spec/models/lti_configuration1p3_spec.rb +spec/models/lti_configuration_base_spec.rb +spec/models/lti_configuration_create1p1_spec.rb +spec/models/lti_configuration_create1p3_deployment_spec.rb +spec/models/lti_configuration_create1p3_dynamic_platform_info_spec.rb +spec/models/lti_configuration_create1p3_dynamic_spec.rb +spec/models/lti_configuration_create1p3_manual_spec.rb +spec/models/lti_configuration_create_spec.rb +spec/models/lti_configuration_spec.rb +spec/models/lti_configuration_update_deployment_spec.rb +spec/models/lti_configuration_update_spec.rb +spec/models/lti_configuration_update_standalone_spec.rb spec/models/lti_credentials_creation_spec.rb spec/models/lti_credentials_spec.rb spec/models/media_attachment_spec.rb spec/models/media_score_sharing_mode_spec.rb spec/models/microsoft_graph_assignment_spec.rb spec/models/microsoft_graph_submission_spec.rb +spec/models/omr_capabilities_spec.rb +spec/models/omr_details_step_data_spec.rb +spec/models/omr_details_submission_spec.rb +spec/models/omr_detected_instrument_spec.rb +spec/models/omr_imported_metadata_spec.rb +spec/models/omr_instrument_override_spec.rb +spec/models/omr_job_creation_spec.rb +spec/models/omr_job_file_metadata_spec.rb +spec/models/omr_job_file_upload_result_spec.rb +spec/models/omr_job_file_upload_spec.rb +spec/models/omr_job_input_file_spec.rb +spec/models/omr_job_output_spec.rb +spec/models/omr_job_progress_spec.rb +spec/models/omr_job_result_spec.rb +spec/models/omr_job_retention_spec.rb +spec/models/omr_job_spec.rb +spec/models/omr_job_status_spec.rb +spec/models/omr_locale_details_spec.rb +spec/models/omr_pending_step_spec.rb +spec/models/omr_step_name_spec.rb spec/models/organization_invitation_creation_spec.rb spec/models/organization_invitation_spec.rb spec/models/organization_roles_spec.rb spec/models/organization_user_access_token_creation_spec.rb +spec/models/rename_group_request_spec.rb spec/models/resource_collaborator_creation_spec.rb spec/models/resource_collaborator_spec.rb spec/models/resource_rights_spec.rb @@ -426,6 +593,7 @@ spec/models/score_creation_file_import_spec.rb spec/models/score_creation_google_drive_import_spec.rb spec/models/score_creation_spec.rb spec/models/score_creation_type_spec.rb +spec/models/score_details_all_of_me_spec.rb spec/models/score_details_spec.rb spec/models/score_fork_spec.rb spec/models/score_license_spec.rb @@ -438,6 +606,7 @@ spec/models/score_revision_spec.rb spec/models/score_revision_statistics_spec.rb spec/models/score_source_spec.rb spec/models/score_summary_spec.rb +spec/models/score_track_creation_response_spec.rb spec/models/score_track_creation_spec.rb spec/models/score_track_point_spec.rb spec/models/score_track_purpose_spec.rb @@ -450,6 +619,7 @@ spec/models/task_export_options_spec.rb spec/models/task_progress_spec.rb spec/models/task_result_spec.rb spec/models/task_spec.rb +spec/models/teaching_theme_spec.rb spec/models/tutteo_product_spec.rb spec/models/user_admin_update_spec.rb spec/models/user_azure_details_spec.rb 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/.rspec b/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index d32b2b1..0000000 --- a/.rubocop.yml +++ /dev/null @@ -1,148 +0,0 @@ -# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by OpenAPI Generator (https://openapi-generator.tech) -AllCops: - TargetRubyVersion: 2.4 - # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop - # to ignore them, so only the ones explicitly set in this file are enabled. - DisabledByDefault: true - Exclude: - - '**/templates/**/*' - - '**/vendor/**/*' - - 'actionpack/lib/action_dispatch/journey/parser.rb' - -# Prefer &&/|| over and/or. -Style/AndOr: - Enabled: true - -# Align `when` with `case`. -Layout/CaseIndentation: - Enabled: true - -# Align comments with method definitions. -Layout/CommentIndentation: - Enabled: true - -Layout/ElseAlignment: - Enabled: true - -Layout/EmptyLineAfterMagicComment: - Enabled: true - -# In a regular class definition, no empty lines around the body. -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# In a regular method definition, no empty lines around the body. -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -# In a regular module definition, no empty lines around the body. -Layout/EmptyLinesAroundModuleBody: - Enabled: true - -Layout/FirstArgumentIndentation: - Enabled: true - -# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. -Style/HashSyntax: - Enabled: false - -# Method definitions after `private` or `protected` isolated calls need one -# extra level of indentation. -Layout/IndentationConsistency: - Enabled: true - EnforcedStyle: indented_internal_methods - -# Two spaces, no tabs (for indentation). -Layout/IndentationWidth: - Enabled: true - -Layout/LeadingCommentSpace: - Enabled: true - -Layout/SpaceAfterColon: - Enabled: true - -Layout/SpaceAfterComma: - Enabled: true - -Layout/SpaceAroundEqualsInParameterDefault: - Enabled: true - -Layout/SpaceAroundKeyword: - Enabled: true - -Layout/SpaceAroundOperators: - Enabled: true - -Layout/SpaceBeforeComma: - Enabled: true - -Layout/SpaceBeforeFirstArg: - Enabled: true - -Style/DefWithParentheses: - Enabled: true - -# Defining a method with parameters needs parentheses. -Style/MethodDefParentheses: - Enabled: true - -Style/FrozenStringLiteralComment: - Enabled: false - EnforcedStyle: always - -# Use `foo {}` not `foo{}`. -Layout/SpaceBeforeBlockBraces: - Enabled: true - -# Use `foo { bar }` not `foo {bar}`. -Layout/SpaceInsideBlockBraces: - Enabled: true - -# Use `{ a: 1 }` not `{a:1}`. -Layout/SpaceInsideHashLiteralBraces: - Enabled: true - -Layout/SpaceInsideParens: - Enabled: true - -# Check quotes usage according to lint rule below. -#Style/StringLiterals: -# Enabled: true -# EnforcedStyle: single_quotes - -# Detect hard tabs, no hard tabs. -Layout/IndentationStyle: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingEmptyLines: - Enabled: true - -# No trailing whitespace. -Layout/TrailingWhitespace: - Enabled: false - -# Use quotes for string literals when they are enough. -Style/RedundantPercentQ: - Enabled: true - -# Align `end` with the matching keyword or starting expression except for -# assignments, where it should be aligned with the LHS. -Layout/EndAlignment: - Enabled: true - EnforcedStyleAlignWith: variable - AutoCorrect: true - -# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. -Lint/RequireParentheses: - Enabled: true - -Style/RedundantReturn: - Enabled: true - AllowMultipleReturnValues: true - -Style/Semicolon: - Enabled: true - AllowAsExpressionSeparator: true diff --git a/.sdkgen.yaml b/.sdkgen.yaml new file mode 100644 index 0000000..0325aa7 --- /dev/null +++ b/.sdkgen.yaml @@ -0,0 +1,29 @@ +schema_version: 1 + +language: ruby +package_name: flat_api +registry: rubygems + +generator: + name: ruby + version: 7.24.0 + config: tools/openapi-config.json + +generated_paths: + - lib/** + - docs/reference/** + - .openapi-generator/** + - OPERATIONS.json + +version_file: + path: lib/flat_api/version.rb + pattern: "VERSION = '(?P[0-9]+\\.[0-9]+\\.[0-9]+)'" + +runtime_matrix: + - version: '3.3' + upstream_eol: 2027-03-31 + - version: '3.4' + upstream_eol: 2028-03-31 + +smoke: + entrypoint: tools/smoke.rb diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8a2bd18..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: ruby -cache: bundler -rvm: - - 2.7 - - 3.0 - - 3.1 -script: - - bundle install --path vendor/bundle - - bundle exec rspec - - gem build flat_api.gemspec - - gem install ./flat_api-0.3.0.gem diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c1a06b..3a4f6cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [1.0.0](https://github.com/FlatIO/api-client-ruby/compare/v0.3.5...1.0.0) (2026-09-11) + +The first stable release. Regenerated against API specification 2.26.1, covering all 123 public +operations. See [MIGRATION.md](MIGRATION.md) for the upgrade from 0.3.x. + +### Features + +* Typed errors: an API failure raises `FlatNotFoundError`, `FlatAuthenticationError` and the rest + of the `FlatApi::FlatError` hierarchy, rather than one generic exception carrying a status code. +* Retries with backoff. Flat returns HTTP 403 for rate limiting with the reset time in + `X-RateLimit-Reset`, so the retry decision reads the response body's `code` to tell a throttle + from a genuine authorization failure. +* Pagination that follows the `Link` header cursor, which the specification does not declare. +* OAuth2 token refresh. + +### Breaking Changes + +* The HTTP layer is Faraday, not Typhoeus. Typhoeus needs libcurl; Faraday does not. +* Requires Ruby 3.3 or later, matching the versions upstream still supports. +* Models and operations are regenerated, so names follow the current specification. + ## [0.3.5](https://github.com/FlatIO/api-client-ruby/compare/v0.3.4...v0.3.5) (2024-03-08) diff --git a/Gemfile b/Gemfile index c2e3127..f70cbd4 100644 --- a/Gemfile +++ b/Gemfile @@ -2,8 +2,6 @@ source 'https://rubygems.org' gemspec -group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' +group :development do + gem 'rake', '~> 13.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 876e0bf..c4abce0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,73 +1,47 @@ PATH remote: . specs: - flat_api (0.3.5) - typhoeus (~> 1.0, >= 1.0.1) + flat_api (1.0.0) + faraday (>= 1.0.1, < 3.0) + faraday-multipart (~> 1.0) + marcel (~> 1.0) GEM remote: https://rubygems.org/ specs: - ast (2.4.2) - byebug (11.1.3) - coderay (1.1.3) - diff-lcs (1.5.1) - ethon (0.16.0) - ffi (>= 1.15.0) - ffi (1.16.3) - jaro_winkler (1.5.6) - method_source (1.0.0) - parallel (1.24.0) - parser (3.3.0.5) - ast (~> 2.4.1) - racc - pry (0.14.2) - coderay (~> 1.1) - method_source (~> 1.0) - pry-byebug (3.10.1) - byebug (~> 11.0) - pry (>= 0.13, < 0.15) - psych (5.1.2) - stringio - racc (1.7.3) - rainbow (3.1.1) - rake (13.0.6) - rspec (3.13.0) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.0) - rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.13.0) - rspec-support (3.13.1) - rubocop (0.66.0) - jaro_winkler (~> 1.5.1) - parallel (~> 1.10) - parser (>= 2.5, != 2.5.1.1) - psych (>= 3.1.0) - rainbow (>= 2.2.2, < 4.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.6) - ruby-progressbar (1.13.0) - stringio (3.1.0) - typhoeus (1.4.1) - ethon (>= 0.9.0) - unicode-display_width (1.5.0) + faraday (2.14.3) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-multipart (1.2.0) + multipart-post (~> 2.0) + faraday-net_http (3.4.4) + net-http (~> 0.5) + json (3.0.2) + logger (1.7.0) + marcel (1.2.1) + multipart-post (2.4.1) + net-http (0.9.1) + uri (>= 0.11.1) + rake (13.4.2) + uri (1.1.1) PLATFORMS - arm64-darwin-23 + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin ruby + x86-linux-gnu + x86-linux-musl + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES flat_api! - pry-byebug - rake (~> 13.0.1) - rspec (~> 3.6, >= 3.6.0) - rubocop (~> 0.66.0) + rake (~> 13.0) BUNDLED WITH - 2.5.4 + 2.6.9 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 0000000..1cbdac6 --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,47 @@ +# Migrating to 1.0.0 + +Version 1.0.0 is the first stable release of this client and a full regeneration against the +current Flat API. The package was previously below 1.0, so this is the point at which it starts +making a compatibility promise. The previous +release line (0.3.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 RubyGems, not withdrawn. Nothing breaks +until you choose to upgrade. + +## Why upgrade + +- **Complete API coverage.** All 123 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 Ruby 3.3 and 3.4. 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: `gem 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 0.3.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 +1.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..221b2d2 --- /dev/null +++ b/OPERATIONS.json @@ -0,0 +1,1217 @@ +{ + "schema_version": 1, + "spec_version": "2.26.1", + "generator": { + "name": "ruby", + "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": "group_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": "class_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": "score_api.get_user_likes", + "paginated": true, + "documented": true + }, + { + "operation_id": "getUserScores", + "method": "get", + "path": "/users/{user}/scores", + "symbol": "score_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", + "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..76a6ddb --- /dev/null +++ b/QUICKSTART.md @@ -0,0 +1,65 @@ +# 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 +gem install flat_api +``` + +Requires Ruby 3.3 and 3.4. + +## 3. Call the API + +```ruby +require 'flat_api' + +client = FlatApi::FlatClient.new(access_token: 'YOUR_TOKEN') +puts client.account.get_authenticated_user.username +``` + +If that prints your username, you are done. + +## 4. Do something useful + +List your collections. The client follows the cursor for you: + +```ruby +client.paginate(:list_collections, parent: 'user') do |collection| + puts collection.title +end +``` + +Each generated API is reachable by a short name: `client.scores`, `client.collections`, +`client.classes`, `client.omr`, and so on. + +## 5. Handle failure properly + +```ruby +begin + # ... +rescue FlatApi::FlatRateLimitError => e + puts "retry after #{e.reset}" +rescue FlatApi::FlatNotFoundError + puts 'no such score' +end +``` + +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 c26c110..529ea96 100644 --- a/README.md +++ b/README.md @@ -1,395 +1,92 @@ -# flat_api +# Flat API client for Ruby -FlatApi - the Ruby gem for the Flat API +Official client for the [Flat REST API](https://flat.io/developers/docs/api/), generated from Flat's +public OpenAPI specification and kept current automatically. -The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: - -* Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files -* Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) -* Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. - -The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. -The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). -This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). - -You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). - -Getting Started and learn more: - -* [API Overview and introduction](https://flat.io/developers/docs/api/) -* [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) -* [SDKs](https://flat.io/developers/docs/api/sdks.html) -* [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) -* [Changelog](https://flat.io/developers/docs/api/changelog.html) - - -This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 2.20.0 -- Package version: 0.3.0 -- Build package: org.openapitools.codegen.languages.RubyClientCodegen -For more information, please visit [https://flat.io/developers/docs/api/](https://flat.io/developers/docs/api/) - -## Installation - -### Install from rubygem - -```shell +```sh gem install flat_api ``` -### Build a gem - -To build the Ruby code into a gem: - -```shell -gem build flat_api.gemspec -``` - -Then either install the gem locally: +```ruby +require 'flat_api' -```shell -gem install ./flat_api-0.3.0.gem +client = FlatApi::FlatClient.new(access_token: 'YOUR_TOKEN') +puts client.account.get_authenticated_user.username ``` -(for development, run `gem install --dev ./flat_api-0.3.0.gem` to install the development dependencies) - -or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). - -Finally add this to the Gemfile: - - gem 'flat_api', '~> 0.3.0' +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. -### Install from Git +## What this client does for you -If the Ruby gem is hosted at a git repository: https://github.com/FlatIO/api-client-ruby, then add the following in the Gemfile: +- **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. - gem 'flat_api', :git => 'https://github.com/FlatIO/api-client-ruby.git' +### Pagination -### Include the Ruby code directly - -Include the Ruby code directly using `-I` as follows: - -```shell -ruby -Ilib script.rb +```ruby +client.paginate(:list_collections, parent: 'user') do |collection| + puts collection.title +end ``` -## Getting Started +`paginate` takes any operation: positional arguments are its path parameters, keywords its query +parameters. It follows the cursor for you and stops at the last page. -Please follow the [installation](#installation) procedure and then run the following code: +### Errors ```ruby -# Load the gem -require 'flat_api' - -# Setup authorization -FlatApi.configure do |config| - # Configure OAuth2 access token for authorization: OAuth2 - config.access_token = 'YOUR ACCESS TOKEN' - # Configure a proc to get access tokens in lieu of the static access_token configuration - config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } -end - -api_instance = FlatApi::AccountApi.new -opts = { - only_id: true # Boolean | Only return the user id -} - begin - #Get current user account - result = api_instance.get_authenticated_user(opts) - p result -rescue FlatApi::ApiError => e - puts "Exception when calling AccountApi->get_authenticated_user: #{e}" + # ... +rescue FlatApi::FlatRateLimitError => e + puts "retry after #{e.reset}" +rescue FlatApi::FlatNotFoundError + puts 'no such score' end - ``` -## Documentation for API Endpoints +### Asynchronous use -All URIs are relative to *https://api.flat.io/v2* +Synchronous only: async is not idiomatic in Ruby for this shape of client. -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*FlatApi::AccountApi* | [**get_authenticated_user**](docs/AccountApi.md#get_authenticated_user) | **GET** /me | Get current user account -*FlatApi::ClassApi* | [**activate_class**](docs/ClassApi.md#activate_class) | **POST** /classes/{class}/activate | Activate the class -*FlatApi::ClassApi* | [**add_class_user**](docs/ClassApi.md#add_class_user) | **PUT** /classes/{class}/users/{user} | Add a user to the class -*FlatApi::ClassApi* | [**archive_assignment**](docs/ClassApi.md#archive_assignment) | **POST** /classes/{class}/assignments/{assignment}/archive | Archive the assignment -*FlatApi::ClassApi* | [**archive_class**](docs/ClassApi.md#archive_class) | **POST** /classes/{class}/archive | Archive the class -*FlatApi::ClassApi* | [**copy_assignment**](docs/ClassApi.md#copy_assignment) | **POST** /classes/{class}/assignments/{assignment}/copy | Copy an assignment -*FlatApi::ClassApi* | [**create_class**](docs/ClassApi.md#create_class) | **POST** /classes | Create a new class -*FlatApi::ClassApi* | [**create_class_assignment**](docs/ClassApi.md#create_class_assignment) | **POST** /classes/{class}/assignments | Assignment creation -*FlatApi::ClassApi* | [**create_submission**](docs/ClassApi.md#create_submission) | **PUT** /classes/{class}/assignments/{assignment}/submissions | Create or edit a submission -*FlatApi::ClassApi* | [**create_test_student_account**](docs/ClassApi.md#create_test_student_account) | **POST** /classes/{class}/testStudent | Create a test student account -*FlatApi::ClassApi* | [**delete_class_user**](docs/ClassApi.md#delete_class_user) | **DELETE** /classes/{class}/users/{user} | Remove a user from the class -*FlatApi::ClassApi* | [**delete_submission**](docs/ClassApi.md#delete_submission) | **DELETE** /classes/{class}/assignments/{assignment}/submissions/{submission} | Reset a submission -*FlatApi::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 -*FlatApi::ClassApi* | [**edit_submission**](docs/ClassApi.md#edit_submission) | **PUT** /classes/{class}/assignments/{assignment}/submissions/{submission} | Edit a submission -*FlatApi::ClassApi* | [**enroll_class**](docs/ClassApi.md#enroll_class) | **POST** /classes/enroll/{enrollmentCode} | Join a class -*FlatApi::ClassApi* | [**export_submissions_reviews_as_csv**](docs/ClassApi.md#export_submissions_reviews_as_csv) | **GET** /classes/{class}/assignments/{assignment}/submissions/csv | CSV Grades exports -*FlatApi::ClassApi* | [**export_submissions_reviews_as_excel**](docs/ClassApi.md#export_submissions_reviews_as_excel) | **GET** /classes/{class}/assignments/{assignment}/submissions/excel | Excel Grades exports -*FlatApi::ClassApi* | [**get_class**](docs/ClassApi.md#get_class) | **GET** /classes/{class} | Get the details of a single class -*FlatApi::ClassApi* | [**get_score_submissions**](docs/ClassApi.md#get_score_submissions) | **GET** /scores/{score}/submissions | List submissions related to the score -*FlatApi::ClassApi* | [**get_submission**](docs/ClassApi.md#get_submission) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission} | Get a student submission -*FlatApi::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 -*FlatApi::ClassApi* | [**get_submission_history**](docs/ClassApi.md#get_submission_history) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission}/history | Get the history of the submission -*FlatApi::ClassApi* | [**get_submissions**](docs/ClassApi.md#get_submissions) | **GET** /classes/{class}/assignments/{assignment}/submissions | List the students' submissions -*FlatApi::ClassApi* | [**list_assignments**](docs/ClassApi.md#list_assignments) | **GET** /classes/{class}/assignments | Assignments listing -*FlatApi::ClassApi* | [**list_class_student_submissions**](docs/ClassApi.md#list_class_student_submissions) | **GET** /classes/{class}/students/{user}/submissions | List the submissions for a student -*FlatApi::ClassApi* | [**list_classes**](docs/ClassApi.md#list_classes) | **GET** /classes | List the classes available for the current user -*FlatApi::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 -*FlatApi::ClassApi* | [**unarchive_assignment**](docs/ClassApi.md#unarchive_assignment) | **DELETE** /classes/{class}/assignments/{assignment}/archive | Unarchive the assignment. -*FlatApi::ClassApi* | [**unarchive_class**](docs/ClassApi.md#unarchive_class) | **DELETE** /classes/{class}/archive | Unarchive the class -*FlatApi::ClassApi* | [**update_class**](docs/ClassApi.md#update_class) | **PUT** /classes/{class} | Update the class -*FlatApi::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 -*FlatApi::CollectionApi* | [**add_score_to_collection**](docs/CollectionApi.md#add_score_to_collection) | **PUT** /collections/{collection}/scores/{score} | Add a score to the collection -*FlatApi::CollectionApi* | [**create_collection**](docs/CollectionApi.md#create_collection) | **POST** /collections | Create a new collection -*FlatApi::CollectionApi* | [**delete_collection**](docs/CollectionApi.md#delete_collection) | **DELETE** /collections/{collection} | Delete the collection -*FlatApi::CollectionApi* | [**delete_score_from_collection**](docs/CollectionApi.md#delete_score_from_collection) | **DELETE** /collections/{collection}/scores/{score} | Delete a score from the collection -*FlatApi::CollectionApi* | [**edit_collection**](docs/CollectionApi.md#edit_collection) | **PUT** /collections/{collection} | Update a collection's metadata -*FlatApi::CollectionApi* | [**get_collection**](docs/CollectionApi.md#get_collection) | **GET** /collections/{collection} | Get collection details -*FlatApi::CollectionApi* | [**list_collection_scores**](docs/CollectionApi.md#list_collection_scores) | **GET** /collections/{collection}/scores | List the scores contained in a collection -*FlatApi::CollectionApi* | [**list_collections**](docs/CollectionApi.md#list_collections) | **GET** /collections | List the collections -*FlatApi::CollectionApi* | [**untrash_collection**](docs/CollectionApi.md#untrash_collection) | **POST** /collections/{collection}/untrash | Untrash a collection -*FlatApi::EduResourcesApi* | [**copy_edu_resource**](docs/EduResourcesApi.md#copy_edu_resource) | **POST** /eduResources/{resource}/copy | Copy an education resource to a Resource Library -*FlatApi::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 -*FlatApi::EduResourcesApi* | [**create_edu_resource**](docs/EduResourcesApi.md#create_edu_resource) | **POST** /eduResources | Create a new education resource -*FlatApi::EduResourcesApi* | [**create_edu_resource_lti_link**](docs/EduResourcesApi.md#create_edu_resource_lti_link) | **POST** /eduResources/{resource}/createLtiLink | Create an LTI link for an education resource -*FlatApi::EduResourcesApi* | [**delete_edu_resource**](docs/EduResourcesApi.md#delete_edu_resource) | **DELETE** /eduResources/{resource} | Delete an education resource -*FlatApi::EduResourcesApi* | [**get_edu_resource**](docs/EduResourcesApi.md#get_edu_resource) | **GET** /eduResources/{resource} | Get an education resource -*FlatApi::EduResourcesApi* | [**list_edu_libraries**](docs/EduResourcesApi.md#list_edu_libraries) | **GET** /eduResources/libraries | List the education libraries -*FlatApi::EduResourcesApi* | [**list_edu_resources**](docs/EduResourcesApi.md#list_edu_resources) | **GET** /eduResources | List education resources in a library or folder -*FlatApi::EduResourcesApi* | [**move_edu_resource**](docs/EduResourcesApi.md#move_edu_resource) | **POST** /eduResources/{resource}/move | Move an education resource -*FlatApi::EduResourcesApi* | [**update_edu_resource**](docs/EduResourcesApi.md#update_edu_resource) | **PUT** /eduResources/{resource} | Update an education resource metadata -*FlatApi::EduResourcesApi* | [**update_edu_resource_assignment**](docs/EduResourcesApi.md#update_edu_resource_assignment) | **PUT** /eduResources/{resource}/assignment | Update an education resource assignment -*FlatApi::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 -*FlatApi::GroupApi* | [**get_group_details**](docs/GroupApi.md#get_group_details) | **GET** /groups/{group} | Get group information -*FlatApi::GroupApi* | [**get_group_scores**](docs/GroupApi.md#get_group_scores) | **GET** /groups/{group}/scores | List group's scores -*FlatApi::GroupApi* | [**list_group_users**](docs/GroupApi.md#list_group_users) | **GET** /groups/{group}/users | List group's users -*FlatApi::OrganizationApi* | [**count_orga_users**](docs/OrganizationApi.md#count_orga_users) | **GET** /organizations/users/count | Count the organization users using the provided filters -*FlatApi::OrganizationApi* | [**create_lti_credentials**](docs/OrganizationApi.md#create_lti_credentials) | **POST** /organizations/lti/credentials | Create a new couple of LTI 1.x credentials -*FlatApi::OrganizationApi* | [**create_organization_invitation**](docs/OrganizationApi.md#create_organization_invitation) | **POST** /organizations/invitations | Create a new invitation to join the organization -*FlatApi::OrganizationApi* | [**create_organization_user**](docs/OrganizationApi.md#create_organization_user) | **POST** /organizations/users | Create a new user account -*FlatApi::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 -*FlatApi::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 -*FlatApi::OrganizationApi* | [**list_lti_credentials**](docs/OrganizationApi.md#list_lti_credentials) | **GET** /organizations/lti/credentials | List LTI 1.x credentials -*FlatApi::OrganizationApi* | [**list_organization_invitations**](docs/OrganizationApi.md#list_organization_invitations) | **GET** /organizations/invitations | List the organization invitations -*FlatApi::OrganizationApi* | [**list_organization_users**](docs/OrganizationApi.md#list_organization_users) | **GET** /organizations/users | List the organization users -*FlatApi::OrganizationApi* | [**remove_organization_invitation**](docs/OrganizationApi.md#remove_organization_invitation) | **DELETE** /organizations/invitations/{invitation} | Remove an organization invitation -*FlatApi::OrganizationApi* | [**remove_organization_user**](docs/OrganizationApi.md#remove_organization_user) | **DELETE** /organizations/users/{user} | Remove an account from Flat -*FlatApi::OrganizationApi* | [**revoke_lti_credentials**](docs/OrganizationApi.md#revoke_lti_credentials) | **DELETE** /organizations/lti/credentials/{credentials} | Revoke LTI 1.x credentials -*FlatApi::OrganizationApi* | [**update_organization_user**](docs/OrganizationApi.md#update_organization_user) | **PUT** /organizations/users/{user} | Update account information -*FlatApi::ScoreApi* | [**add_score_collaborator**](docs/ScoreApi.md#add_score_collaborator) | **POST** /scores/{score}/collaborators | Add a new collaborator -*FlatApi::ScoreApi* | [**add_score_track**](docs/ScoreApi.md#add_score_track) | **POST** /scores/{score}/tracks | Add a new video or audio track to the score -*FlatApi::ScoreApi* | [**create_export_task**](docs/ScoreApi.md#create_export_task) | **POST** /scores/{score}/revisions/{revision}/{format}/task | Create a new score export task -*FlatApi::ScoreApi* | [**create_score**](docs/ScoreApi.md#create_score) | **POST** /scores | Create a new score -*FlatApi::ScoreApi* | [**create_score_revision**](docs/ScoreApi.md#create_score_revision) | **POST** /scores/{score}/revisions | Create a new revision -*FlatApi::ScoreApi* | [**delete_score**](docs/ScoreApi.md#delete_score) | **DELETE** /scores/{score} | Delete a score -*FlatApi::ScoreApi* | [**delete_score_comment**](docs/ScoreApi.md#delete_score_comment) | **DELETE** /scores/{score}/comments/{comment} | Delete a comment -*FlatApi::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 -*FlatApi::ScoreApi* | [**edit_score**](docs/ScoreApi.md#edit_score) | **PUT** /scores/{score} | Edit a score's metadata -*FlatApi::ScoreApi* | [**fork_score**](docs/ScoreApi.md#fork_score) | **POST** /scores/{score}/fork | Fork a score -*FlatApi::ScoreApi* | [**get_group_scores**](docs/ScoreApi.md#get_group_scores) | **GET** /groups/{group}/scores | List group's scores -*FlatApi::ScoreApi* | [**get_score**](docs/ScoreApi.md#get_score) | **GET** /scores/{score} | Get a score's metadata -*FlatApi::ScoreApi* | [**get_score_collaborator**](docs/ScoreApi.md#get_score_collaborator) | **GET** /scores/{score}/collaborators/{collaborator} | Get a collaborator -*FlatApi::ScoreApi* | [**get_score_collaborators**](docs/ScoreApi.md#get_score_collaborators) | **GET** /scores/{score}/collaborators | List the collaborators -*FlatApi::ScoreApi* | [**get_score_comments**](docs/ScoreApi.md#get_score_comments) | **GET** /scores/{score}/comments | List comments -*FlatApi::ScoreApi* | [**get_score_revision**](docs/ScoreApi.md#get_score_revision) | **GET** /scores/{score}/revisions/{revision} | Get a score revision -*FlatApi::ScoreApi* | [**get_score_revision_data**](docs/ScoreApi.md#get_score_revision_data) | **GET** /scores/{score}/revisions/{revision}/{format} | Get a score revision data -*FlatApi::ScoreApi* | [**get_score_revisions**](docs/ScoreApi.md#get_score_revisions) | **GET** /scores/{score}/revisions | List the revisions -*FlatApi::ScoreApi* | [**get_score_submissions**](docs/ScoreApi.md#get_score_submissions) | **GET** /scores/{score}/submissions | List submissions related to the score -*FlatApi::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 -*FlatApi::ScoreApi* | [**get_user_likes**](docs/ScoreApi.md#get_user_likes) | **GET** /users/{user}/likes | List liked scores -*FlatApi::ScoreApi* | [**get_user_scores**](docs/ScoreApi.md#get_user_scores) | **GET** /users/{user}/scores | List user's scores -*FlatApi::ScoreApi* | [**list_score_tracks**](docs/ScoreApi.md#list_score_tracks) | **GET** /scores/{score}/tracks | List the audio or video tracks linked to a score -*FlatApi::ScoreApi* | [**mark_score_comment_resolved**](docs/ScoreApi.md#mark_score_comment_resolved) | **PUT** /scores/{score}/comments/{comment}/resolved | Mark the comment as resolved -*FlatApi::ScoreApi* | [**mark_score_comment_unresolved**](docs/ScoreApi.md#mark_score_comment_unresolved) | **DELETE** /scores/{score}/comments/{comment}/resolved | Mark the comment as unresolved -*FlatApi::ScoreApi* | [**post_score_comment**](docs/ScoreApi.md#post_score_comment) | **POST** /scores/{score}/comments | Post a new comment -*FlatApi::ScoreApi* | [**remove_score_collaborator**](docs/ScoreApi.md#remove_score_collaborator) | **DELETE** /scores/{score}/collaborators/{collaborator} | Delete a collaborator -*FlatApi::ScoreApi* | [**untrash_score**](docs/ScoreApi.md#untrash_score) | **POST** /scores/{score}/untrash | Untrash a score -*FlatApi::ScoreApi* | [**update_score_comment**](docs/ScoreApi.md#update_score_comment) | **PUT** /scores/{score}/comments/{comment} | Update an existing comment -*FlatApi::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 -*FlatApi::TaskApi* | [**get_task**](docs/TaskApi.md#get_task) | **GET** /tasks/{task} | Get a task details -*FlatApi::UserApi* | [**get_user**](docs/UserApi.md#get_user) | **GET** /users/{user} | Get a public user profile -*FlatApi::UserApi* | [**get_user_likes**](docs/UserApi.md#get_user_likes) | **GET** /users/{user}/likes | List liked scores -*FlatApi::UserApi* | [**get_user_scores**](docs/UserApi.md#get_user_scores) | **GET** /users/{user}/scores | List user's scores +## Supported versions +Ruby 3.3 and 3.4. Versions past their upstream end of life are not supported; see +[MIGRATION.md](MIGRATION.md) if you are on an older runtime. -## Documentation for Models +## Documentation - - [FlatApi::ApiAccessToken](docs/ApiAccessToken.md) - - [FlatApi::AppScopes](docs/AppScopes.md) - - [FlatApi::Assignment](docs/Assignment.md) - - [FlatApi::AssignmentCapabilities](docs/AssignmentCapabilities.md) - - [FlatApi::AssignmentCapabilitiesCanPublishInClassError](docs/AssignmentCapabilitiesCanPublishInClassError.md) - - [FlatApi::AssignmentCopy](docs/AssignmentCopy.md) - - [FlatApi::AssignmentCopyResponse](docs/AssignmentCopyResponse.md) - - [FlatApi::AssignmentCopyToClass](docs/AssignmentCopyToClass.md) - - [FlatApi::AssignmentCopyToResourceLibrary](docs/AssignmentCopyToResourceLibrary.md) - - [FlatApi::AssignmentSubmission](docs/AssignmentSubmission.md) - - [FlatApi::AssignmentSubmissionComment](docs/AssignmentSubmissionComment.md) - - [FlatApi::AssignmentSubmissionCommentCreation](docs/AssignmentSubmissionCommentCreation.md) - - [FlatApi::AssignmentSubmissionComments](docs/AssignmentSubmissionComments.md) - - [FlatApi::AssignmentSubmissionHistory](docs/AssignmentSubmissionHistory.md) - - [FlatApi::AssignmentSubmissionHistoryAttachment](docs/AssignmentSubmissionHistoryAttachment.md) - - [FlatApi::AssignmentSubmissionHistoryState](docs/AssignmentSubmissionHistoryState.md) - - [FlatApi::AssignmentSubmissionLti](docs/AssignmentSubmissionLti.md) - - [FlatApi::AssignmentSubmissionPlaybackInner](docs/AssignmentSubmissionPlaybackInner.md) - - [FlatApi::AssignmentSubmissionState](docs/AssignmentSubmissionState.md) - - [FlatApi::AssignmentSubmissionUpdate](docs/AssignmentSubmissionUpdate.md) - - [FlatApi::AssignmentType](docs/AssignmentType.md) - - [FlatApi::AssignmentUpdate](docs/AssignmentUpdate.md) - - [FlatApi::ClassAssignment](docs/ClassAssignment.md) - - [FlatApi::ClassAssignmentAllOfCanvas](docs/ClassAssignmentAllOfCanvas.md) - - [FlatApi::ClassAssignmentAllOfLti](docs/ClassAssignmentAllOfLti.md) - - [FlatApi::ClassAssignmentAllOfMfc](docs/ClassAssignmentAllOfMfc.md) - - [FlatApi::ClassAssignmentUpdate](docs/ClassAssignmentUpdate.md) - - [FlatApi::ClassAssignmentUpdateAllOfGoogleClassroom](docs/ClassAssignmentUpdateAllOfGoogleClassroom.md) - - [FlatApi::ClassAssignmentUpdateAllOfMicrosoftGraph](docs/ClassAssignmentUpdateAllOfMicrosoftGraph.md) - - [FlatApi::ClassAttachmentCreation](docs/ClassAttachmentCreation.md) - - [FlatApi::ClassCreation](docs/ClassCreation.md) - - [FlatApi::ClassDetails](docs/ClassDetails.md) - - [FlatApi::ClassDetailsCanvas](docs/ClassDetailsCanvas.md) - - [FlatApi::ClassDetailsClever](docs/ClassDetailsClever.md) - - [FlatApi::ClassDetailsGoogleClassroom](docs/ClassDetailsGoogleClassroom.md) - - [FlatApi::ClassDetailsGoogleDrive](docs/ClassDetailsGoogleDrive.md) - - [FlatApi::ClassDetailsIssues](docs/ClassDetailsIssues.md) - - [FlatApi::ClassDetailsIssuesSyncInner](docs/ClassDetailsIssuesSyncInner.md) - - [FlatApi::ClassDetailsLti](docs/ClassDetailsLti.md) - - [FlatApi::ClassDetailsMfc](docs/ClassDetailsMfc.md) - - [FlatApi::ClassDetailsMicrosoftGraph](docs/ClassDetailsMicrosoftGraph.md) - - [FlatApi::ClassGradeLevel](docs/ClassGradeLevel.md) - - [FlatApi::ClassRoles](docs/ClassRoles.md) - - [FlatApi::ClassState](docs/ClassState.md) - - [FlatApi::ClassUpdate](docs/ClassUpdate.md) - - [FlatApi::Collection](docs/Collection.md) - - [FlatApi::CollectionApp](docs/CollectionApp.md) - - [FlatApi::CollectionCapabilities](docs/CollectionCapabilities.md) - - [FlatApi::CollectionCreation](docs/CollectionCreation.md) - - [FlatApi::CollectionModification](docs/CollectionModification.md) - - [FlatApi::CollectionPrivacy](docs/CollectionPrivacy.md) - - [FlatApi::CollectionType](docs/CollectionType.md) - - [FlatApi::EduLibrary](docs/EduLibrary.md) - - [FlatApi::EduResource](docs/EduResource.md) - - [FlatApi::EduResourceCapabilities](docs/EduResourceCapabilities.md) - - [FlatApi::EduResourceCopy](docs/EduResourceCopy.md) - - [FlatApi::EduResourceCreation](docs/EduResourceCreation.md) - - [FlatApi::EduResourceFolder](docs/EduResourceFolder.md) - - [FlatApi::EduResourceLtiLink](docs/EduResourceLtiLink.md) - - [FlatApi::EduResourceMove](docs/EduResourceMove.md) - - [FlatApi::EduResourcePrivacy](docs/EduResourcePrivacy.md) - - [FlatApi::EduResourceResource](docs/EduResourceResource.md) - - [FlatApi::EduResourceType](docs/EduResourceType.md) - - [FlatApi::EduResourceUpdate](docs/EduResourceUpdate.md) - - [FlatApi::EduResourceUseInClass](docs/EduResourceUseInClass.md) - - [FlatApi::FlatErrorResponse](docs/FlatErrorResponse.md) - - [FlatApi::FlatLocales](docs/FlatLocales.md) - - [FlatApi::GoogleClassroomCoursework](docs/GoogleClassroomCoursework.md) - - [FlatApi::GoogleClassroomSubmission](docs/GoogleClassroomSubmission.md) - - [FlatApi::Group](docs/Group.md) - - [FlatApi::GroupDetails](docs/GroupDetails.md) - - [FlatApi::GroupType](docs/GroupType.md) - - [FlatApi::LicenseMode](docs/LicenseMode.md) - - [FlatApi::LicenseSources](docs/LicenseSources.md) - - [FlatApi::LmsName](docs/LmsName.md) - - [FlatApi::LtiCredentials](docs/LtiCredentials.md) - - [FlatApi::LtiCredentialsCreation](docs/LtiCredentialsCreation.md) - - [FlatApi::MediaAttachment](docs/MediaAttachment.md) - - [FlatApi::MediaScoreSharingMode](docs/MediaScoreSharingMode.md) - - [FlatApi::MicrosoftGraphAssignment](docs/MicrosoftGraphAssignment.md) - - [FlatApi::MicrosoftGraphSubmission](docs/MicrosoftGraphSubmission.md) - - [FlatApi::OrganizationInvitation](docs/OrganizationInvitation.md) - - [FlatApi::OrganizationInvitationCreation](docs/OrganizationInvitationCreation.md) - - [FlatApi::OrganizationRoles](docs/OrganizationRoles.md) - - [FlatApi::OrganizationUserAccessTokenCreation](docs/OrganizationUserAccessTokenCreation.md) - - [FlatApi::ResourceCollaborator](docs/ResourceCollaborator.md) - - [FlatApi::ResourceCollaboratorCreation](docs/ResourceCollaboratorCreation.md) - - [FlatApi::ResourceRights](docs/ResourceRights.md) - - [FlatApi::ScoreComment](docs/ScoreComment.md) - - [FlatApi::ScoreCommentContext](docs/ScoreCommentContext.md) - - [FlatApi::ScoreCommentCreation](docs/ScoreCommentCreation.md) - - [FlatApi::ScoreCommentModeration](docs/ScoreCommentModeration.md) - - [FlatApi::ScoreCommentUpdate](docs/ScoreCommentUpdate.md) - - [FlatApi::ScoreCommentsCounts](docs/ScoreCommentsCounts.md) - - [FlatApi::ScoreCreation](docs/ScoreCreation.md) - - [FlatApi::ScoreCreationBuilderData](docs/ScoreCreationBuilderData.md) - - [FlatApi::ScoreCreationBuilderDataAllOfBuilderData](docs/ScoreCreationBuilderDataAllOfBuilderData.md) - - [FlatApi::ScoreCreationBuilderDataAllOfBuilderDataLayoutData](docs/ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md) - - [FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData](docs/ScoreCreationBuilderDataAllOfBuilderDataScoreData.md) - - [FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments](docs/ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md) - - [FlatApi::ScoreCreationCommon](docs/ScoreCreationCommon.md) - - [FlatApi::ScoreCreationFileImport](docs/ScoreCreationFileImport.md) - - [FlatApi::ScoreCreationGoogleDriveImport](docs/ScoreCreationGoogleDriveImport.md) - - [FlatApi::ScoreCreationType](docs/ScoreCreationType.md) - - [FlatApi::ScoreDetails](docs/ScoreDetails.md) - - [FlatApi::ScoreFork](docs/ScoreFork.md) - - [FlatApi::ScoreLicense](docs/ScoreLicense.md) - - [FlatApi::ScoreLikesCounts](docs/ScoreLikesCounts.md) - - [FlatApi::ScoreModification](docs/ScoreModification.md) - - [FlatApi::ScorePlaysCounts](docs/ScorePlaysCounts.md) - - [FlatApi::ScorePrivacy](docs/ScorePrivacy.md) - - [FlatApi::ScoreRevision](docs/ScoreRevision.md) - - [FlatApi::ScoreRevisionCreation](docs/ScoreRevisionCreation.md) - - [FlatApi::ScoreRevisionStatistics](docs/ScoreRevisionStatistics.md) - - [FlatApi::ScoreSource](docs/ScoreSource.md) - - [FlatApi::ScoreSummary](docs/ScoreSummary.md) - - [FlatApi::ScoreTrack](docs/ScoreTrack.md) - - [FlatApi::ScoreTrackCreation](docs/ScoreTrackCreation.md) - - [FlatApi::ScoreTrackPoint](docs/ScoreTrackPoint.md) - - [FlatApi::ScoreTrackPurpose](docs/ScoreTrackPurpose.md) - - [FlatApi::ScoreTrackState](docs/ScoreTrackState.md) - - [FlatApi::ScoreTrackType](docs/ScoreTrackType.md) - - [FlatApi::ScoreTrackUpdate](docs/ScoreTrackUpdate.md) - - [FlatApi::ScoreViewsCounts](docs/ScoreViewsCounts.md) - - [FlatApi::Task](docs/Task.md) - - [FlatApi::TaskExportOptions](docs/TaskExportOptions.md) - - [FlatApi::TaskProgress](docs/TaskProgress.md) - - [FlatApi::TaskResult](docs/TaskResult.md) - - [FlatApi::TutteoProduct](docs/TutteoProduct.md) - - [FlatApi::UserAdminUpdate](docs/UserAdminUpdate.md) - - [FlatApi::UserAzureDetails](docs/UserAzureDetails.md) - - [FlatApi::UserBasics](docs/UserBasics.md) - - [FlatApi::UserCommunityProfileLinks](docs/UserCommunityProfileLinks.md) - - [FlatApi::UserCreation](docs/UserCreation.md) - - [FlatApi::UserDetails](docs/UserDetails.md) - - [FlatApi::UserDetailsAdmin](docs/UserDetailsAdmin.md) - - [FlatApi::UserDetailsAdminAllOfLicense](docs/UserDetailsAdminAllOfLicense.md) - - [FlatApi::UserPublic](docs/UserPublic.md) - - [FlatApi::UserPublicSummary](docs/UserPublicSummary.md) - - [FlatApi::UserSigninLink](docs/UserSigninLink.md) - - [FlatApi::UserSigninLinkCreation](docs/UserSigninLinkCreation.md) +- [Quickstart](QUICKSTART.md), install to first call +- [Per-operation reference](docs/reference/), generated +- [API documentation](https://flat.io/developers/docs/api/) +- [Migrating from 0.3.x](MIGRATION.md) +## Verifying this gem -## Documentation for Authorization +Published through RubyGems trusted publishing, so no long-lived API key exists that could publish +under this name. The release workflow is the only publisher, and each release is tied to the commit +and the API specification version it was generated from. + +```sh +gem fetch flat_api +gem spec flat_api-*.gem +``` +## How this client is maintained -Authentication schemes defined for the API: -### OAuth2 +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. +Files under `docs/reference/` and the client sources are generated: edit the generator configuration +in `tools/`, not the output. -- **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. +## License +Apache 2.0. See [LICENSE](LICENSE). diff --git a/Rakefile b/Rakefile index c72ca30..c702cfc 100644 --- a/Rakefile +++ b/Rakefile @@ -1,10 +1 @@ -require "bundler/gem_tasks" - -begin - require 'rspec/core/rake_task' - - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError - # no rspec available -end +require 'bundler/gem_tasks' diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..3eefcb9 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.0.0 diff --git a/docs/reference/AccountApi.md b/docs/reference/AccountApi.md new file mode 100644 index 0000000..96f219e --- /dev/null +++ b/docs/reference/AccountApi.md @@ -0,0 +1,79 @@ +# FlatApi::AccountApi + +All URIs are relative to *https://api.flat.io/v2* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_authenticated_user**](AccountApi.md#get_authenticated_user) | **GET** /me | Get current user account | + + +## get_authenticated_user + +> get_authenticated_user(opts) + +Get current user account + +Get details about the current authenticated User. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::AccountApi.new +opts = { + only_id: true # Boolean | Only return the user id +} + +begin + # Get current user account + result = api_instance.get_authenticated_user(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling AccountApi->get_authenticated_user: #{e}" +end +``` + +#### Using the get_authenticated_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_authenticated_user_with_http_info(opts) + +```ruby +begin + # Get current user account + data, status_code, headers = api_instance.get_authenticated_user_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling AccountApi->get_authenticated_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **only_id** | **Boolean** | Only return the user id | [optional][default to false] | + +### Return type + +[**UserDetails**](UserDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/reference/AddGroupUser200Response.md b/docs/reference/AddGroupUser200Response.md new file mode 100644 index 0000000..84c9099 --- /dev/null +++ b/docs/reference/AddGroupUser200Response.md @@ -0,0 +1,18 @@ +# FlatApi::AddGroupUser200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | User ID that was added | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AddGroupUser200Response.new( + user: null +) +``` + diff --git a/docs/reference/AddGroupUserRequest.md b/docs/reference/AddGroupUserRequest.md new file mode 100644 index 0000000..884f104 --- /dev/null +++ b/docs/reference/AddGroupUserRequest.md @@ -0,0 +1,18 @@ +# FlatApi::AddGroupUserRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | ID of the student to add | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AddGroupUserRequest.new( + user: null +) +``` + diff --git a/docs/reference/ApiAccessToken.md b/docs/reference/ApiAccessToken.md new file mode 100644 index 0000000..a7e8d7b --- /dev/null +++ b/docs/reference/ApiAccessToken.md @@ -0,0 +1,28 @@ +# FlatApi::ApiAccessToken + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of this private token | [optional] | +| **name** | **String** | Name of the personal access token | [optional] | +| **token** | **String** | The token. This token will only be returned once, then only the first 4 characters will be returned. | [optional] | +| **issued_date** | **Time** | The date then this token was issued | [optional] | +| **expiration_date** | **Time** | The date then this token will expire | [optional] | +| **scopes** | [**Array<AppScopes>**](AppScopes.md) | The list of scopes associated to the token | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ApiAccessToken.new( + id: null, + name: null, + token: null, + issued_date: null, + expiration_date: null, + scopes: null +) +``` + diff --git a/docs/reference/AppScopes.md b/docs/reference/AppScopes.md new file mode 100644 index 0000000..8907ea7 --- /dev/null +++ b/docs/reference/AppScopes.md @@ -0,0 +1,15 @@ +# FlatApi::AppScopes + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AppScopes.new() +``` + diff --git a/docs/reference/Assignment.md b/docs/reference/Assignment.md new file mode 100644 index 0000000..9d96640 --- /dev/null +++ b/docs/reference/Assignment.md @@ -0,0 +1,66 @@ +# FlatApi::Assignment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the assignment | | +| **type** | [**AssignmentType**](AssignmentType.md) | | | +| **capabilities** | [**AssignmentCapabilities**](AssignmentCapabilities.md) | | | +| **title** | **String** | Title of the assignment | | +| **description** | **String** | Student instructions and content of the assignment (plain text) | [optional] | +| **description_html** | **String** | 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** | **String** | 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** | **String** | 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** | **String** | The URL of the cover to display | [optional] | +| **cover_file** | **String** | The id of the cover to display | [optional] | +| **attachments** | [**Array<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** | **Boolean** | 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** | **String** | 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** | **Boolean** | Mixing worksheets exercises for each student | [optional] | +| **toolset** | **String** | 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** | **Boolean** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] | +| **restrict_to_audio_tracks** | **Boolean** | 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** | **String** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::Assignment.new( + id: null, + type: null, + capabilities: null, + title: null, + description: null, + description_html: null, + teacher_instructions: null, + teacher_instructions_html: null, + cover: null, + cover_file: null, + attachments: null, + use_dedicated_attachments: null, + max_points: null, + release_grades: null, + shuffle_exercises: null, + toolset: null, + nb_playback_authorized: null, + restrict_play_note: null, + restrict_to_audio_tracks: null, + submission_students_mode: null, + recording_type: null, + allow_metronome: null, + allow_backing_track: null, + allow_speed_change: null, + free_record: null +) +``` + diff --git a/docs/reference/AssignmentCapabilities.md b/docs/reference/AssignmentCapabilities.md new file mode 100644 index 0000000..3fed491 --- /dev/null +++ b/docs/reference/AssignmentCapabilities.md @@ -0,0 +1,26 @@ +# FlatApi::AssignmentCapabilities + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **can_edit** | **Boolean** | Whether the current user can edit the assignment | | +| **can_publish_in_class** | **Boolean** | Whether this assignment can be published in a class | | +| **can_publish_in_class_error** | [**AssignmentCapabilitiesCanPublishInClassError**](AssignmentCapabilitiesCanPublishInClassError.md) | | [optional] | +| **can_archive** | **Boolean** | Whether the current user can archive the assignment | | +| **can_unarchive** | **Boolean** | Whether the current user can unarchive the assignment | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentCapabilities.new( + can_edit: null, + can_publish_in_class: null, + can_publish_in_class_error: null, + can_archive: null, + can_unarchive: null +) +``` + diff --git a/docs/reference/AssignmentCapabilitiesCanPublishInClassError.md b/docs/reference/AssignmentCapabilitiesCanPublishInClassError.md new file mode 100644 index 0000000..0b916b4 --- /dev/null +++ b/docs/reference/AssignmentCapabilitiesCanPublishInClassError.md @@ -0,0 +1,20 @@ +# FlatApi::AssignmentCapabilitiesCanPublishInClassError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **String** | A corresponding code for this error | | +| **message** | **String** | A printable and localized message for this error | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentCapabilitiesCanPublishInClassError.new( + code: null, + message: null +) +``` + diff --git a/docs/reference/AssignmentCopy.md b/docs/reference/AssignmentCopy.md new file mode 100644 index 0000000..930f4d5 --- /dev/null +++ b/docs/reference/AssignmentCopy.md @@ -0,0 +1,49 @@ +# FlatApi::AssignmentCopy + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::AssignmentCopy.openapi_one_of +# => +# [ +# :'AssignmentCopyToClass', +# :'AssignmentCopyToResourceLibrary' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::AssignmentCopy.build(data) +# => # + +FlatApi::AssignmentCopy.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `AssignmentCopyToClass` +- `AssignmentCopyToResourceLibrary` +- `nil` (if no type matches) + diff --git a/docs/reference/AssignmentCopyResponse.md b/docs/reference/AssignmentCopyResponse.md new file mode 100644 index 0000000..b64132a --- /dev/null +++ b/docs/reference/AssignmentCopyResponse.md @@ -0,0 +1,68 @@ +# FlatApi::AssignmentCopyResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the assignment | | +| **type** | [**AssignmentType**](AssignmentType.md) | | | +| **capabilities** | [**AssignmentCapabilities**](AssignmentCapabilities.md) | | | +| **title** | **String** | Title of the assignment | | +| **description** | **String** | Student instructions and content of the assignment (plain text) | [optional] | +| **description_html** | **String** | 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** | **String** | 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** | **String** | 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** | **String** | The URL of the cover to display | [optional] | +| **cover_file** | **String** | The id of the cover to display | [optional] | +| **attachments** | [**Array<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** | **Boolean** | 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** | **String** | 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** | **Boolean** | Mixing worksheets exercises for each student | [optional] | +| **toolset** | **String** | 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** | **Boolean** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] | +| **restrict_to_audio_tracks** | **Boolean** | 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** | **String** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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** | **String** | If this assignment is stored as a resource in the Flat for Education Resource Library, the unique identifier of the resource. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentCopyResponse.new( + id: null, + type: null, + capabilities: null, + title: null, + description: null, + description_html: null, + teacher_instructions: null, + teacher_instructions_html: null, + cover: null, + cover_file: null, + attachments: null, + use_dedicated_attachments: null, + max_points: null, + release_grades: null, + shuffle_exercises: null, + toolset: null, + nb_playback_authorized: null, + restrict_play_note: null, + restrict_to_audio_tracks: null, + submission_students_mode: null, + recording_type: null, + allow_metronome: null, + allow_backing_track: null, + allow_speed_change: null, + free_record: null, + resource: null +) +``` + diff --git a/docs/reference/AssignmentCopyToClass.md b/docs/reference/AssignmentCopyToClass.md new file mode 100644 index 0000000..fb59fed --- /dev/null +++ b/docs/reference/AssignmentCopyToClass.md @@ -0,0 +1,22 @@ +# FlatApi::AssignmentCopyToClass + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **classroom** | **String** | The destination classroom where the assignment will be copied | | +| **assignment** | **String** | An optional destination assignment where the original assignement will be copied. Must be a draft. | [optional] | +| **scheduled_date** | **Time** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentCopyToClass.new( + classroom: null, + assignment: null, + scheduled_date: null +) +``` + diff --git a/docs/reference/AssignmentCopyToResourceLibrary.md b/docs/reference/AssignmentCopyToResourceLibrary.md new file mode 100644 index 0000000..296e384 --- /dev/null +++ b/docs/reference/AssignmentCopyToResourceLibrary.md @@ -0,0 +1,20 @@ +# FlatApi::AssignmentCopyToResourceLibrary + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **library_parent** | **String** | 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** | **Boolean** | Option to check if the assignment is already in Resource Library | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentCopyToResourceLibrary.new( + library_parent: null, + verify_if_not_already_in_resource_library: null +) +``` + diff --git a/docs/reference/AssignmentGroup.md b/docs/reference/AssignmentGroup.md new file mode 100644 index 0000000..ddae3ca --- /dev/null +++ b/docs/reference/AssignmentGroup.md @@ -0,0 +1,24 @@ +# FlatApi::AssignmentGroup + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the group | | +| **name** | **String** | The display name of the group | | +| **parent** | **String** | 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** | **Array<String>** | Array of user IDs that are members of this group | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentGroup.new( + id: null, + name: null, + parent: null, + members: null +) +``` + diff --git a/docs/reference/AssignmentSubmission.md b/docs/reference/AssignmentSubmission.md new file mode 100644 index 0000000..b422184 --- /dev/null +++ b/docs/reference/AssignmentSubmission.md @@ -0,0 +1,54 @@ +# FlatApi::AssignmentSubmission + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the submission | | +| **state** | [**AssignmentSubmissionState**](AssignmentSubmissionState.md) | | | +| **classroom** | **String** | Unique identifier of the classroom where the assignment was posted | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **creator** | **String** | The User identifier of the student who created the submission | | +| **creation_date** | **String** | The date when the submission was created | | +| **attachments** | [**Array<MediaAttachment>**](MediaAttachment.md) | | | +| **submission_date** | **String** | The date when the student submitted their work | [optional] | +| **return_date** | **String** | The date when the teacher returned the work | [optional] | +| **return_creator** | **String** | The User unique identifier of the teacher who returned the submission | [optional] | +| **grade** | **Float** | Optional grade. If unset, no grade was set. | [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] | +| **max_points** | **Float** | Optional max points for the grade. If set, a corresponding `draftGrade` or `grade` will be set. | [optional] | +| **exercises_ids** | **Array<String>** | The ids of exercises when they need to be in a specific order | [optional] | +| **playback** | [**Array<AssignmentSubmissionPlayback>**](AssignmentSubmissionPlayback.md) | | | +| **comments** | [**AssignmentSubmissionComments**](AssignmentSubmissionComments.md) | | | +| **google_classroom** | [**GoogleClassroomSubmission**](GoogleClassroomSubmission.md) | | [optional] | +| **microsoft_graph** | [**MicrosoftGraphSubmission**](MicrosoftGraphSubmission.md) | | [optional] | +| **lti** | [**AssignmentSubmissionLti**](AssignmentSubmissionLti.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmission.new( + id: null, + state: null, + classroom: null, + assignment: null, + creator: null, + creation_date: null, + attachments: null, + submission_date: null, + return_date: null, + return_creator: null, + grade: null, + draft_grade: null, + max_points: null, + exercises_ids: null, + playback: null, + comments: null, + google_classroom: null, + microsoft_graph: null, + lti: null +) +``` + diff --git a/docs/reference/AssignmentSubmissionComment.md b/docs/reference/AssignmentSubmissionComment.md new file mode 100644 index 0000000..0cfed9c --- /dev/null +++ b/docs/reference/AssignmentSubmissionComment.md @@ -0,0 +1,30 @@ +# FlatApi::AssignmentSubmissionComment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The comment unique identifier | [optional] | +| **user** | **String** | The author unique identifier | [optional] | +| **submission** | **String** | The submission unique identifier | [optional] | +| **date** | **Time** | The date when the comment was posted | [optional] | +| **modification_date** | **Time** | The date of the last comment modification | [optional] | +| **comment** | **String** | The comment text | [optional] | +| **unread** | **Boolean** | True if the comment is unread by the current user | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionComment.new( + id: null, + user: null, + submission: null, + date: null, + modification_date: null, + comment: null, + unread: null +) +``` + diff --git a/docs/reference/AssignmentSubmissionCommentCreation.md b/docs/reference/AssignmentSubmissionCommentCreation.md new file mode 100644 index 0000000..9080535 --- /dev/null +++ b/docs/reference/AssignmentSubmissionCommentCreation.md @@ -0,0 +1,18 @@ +# FlatApi::AssignmentSubmissionCommentCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **comment** | **String** | The comment text | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionCommentCreation.new( + comment: null +) +``` + diff --git a/docs/reference/AssignmentSubmissionComments.md b/docs/reference/AssignmentSubmissionComments.md new file mode 100644 index 0000000..c7fc50b --- /dev/null +++ b/docs/reference/AssignmentSubmissionComments.md @@ -0,0 +1,20 @@ +# FlatApi::AssignmentSubmissionComments + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **total** | **Float** | The total number of comments added to the submission | [optional] | +| **unread** | **Float** | The number of unread comments for the current user | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionComments.new( + total: null, + unread: null +) +``` + diff --git a/docs/reference/AssignmentSubmissionHistory.md b/docs/reference/AssignmentSubmissionHistory.md new file mode 100644 index 0000000..25e827d --- /dev/null +++ b/docs/reference/AssignmentSubmissionHistory.md @@ -0,0 +1,42 @@ +# FlatApi::AssignmentSubmissionHistory + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **date** | **Time** | The date when the submission was changed | | +| **classroom** | **String** | The classroom unique identifier where the submission was changed | [optional] | +| **assignment** | **String** | The assignment unique identifier where the submission was changed | [optional] | +| **submission** | **String** | The submission unique identifier | [optional] | +| **users** | **Array<String>** | The user(s) unique identifier(s) who made the change | | +| **source** | **String** | The source of the change if the change was made by a third-party software | [optional] | +| **state** | [**AssignmentSubmissionHistoryState**](AssignmentSubmissionHistoryState.md) | | [optional] | +| **draft_grade** | **Float** | The numerator of the grade at this time in the submission grade history | [optional] | +| **grade** | **Float** | The numerator of the grade at this time in the submission grade history | [optional] | +| **max_points** | **Float** | The denominator of the grade at this time in the submission grade history | [optional] | +| **comment** | **String** | The comment that is made to this submission | [optional] | +| **due_date** | **Time** | The due date of this assignment | [optional] | +| **attachment** | [**AssignmentSubmissionHistoryAttachment**](AssignmentSubmissionHistoryAttachment.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionHistory.new( + date: null, + classroom: null, + assignment: null, + submission: null, + users: null, + source: null, + state: null, + draft_grade: null, + grade: null, + max_points: null, + comment: null, + due_date: null, + attachment: null +) +``` + diff --git a/docs/reference/AssignmentSubmissionHistoryAttachment.md b/docs/reference/AssignmentSubmissionHistoryAttachment.md new file mode 100644 index 0000000..7eb656b --- /dev/null +++ b/docs/reference/AssignmentSubmissionHistoryAttachment.md @@ -0,0 +1,22 @@ +# FlatApi::AssignmentSubmissionHistoryAttachment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | The score identifier that changed | [optional] | +| **revision** | **String** | The revision identifier that changed | [optional] | +| **title** | **String** | The title of the score that changed | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionHistoryAttachment.new( + score: null, + revision: null, + title: null +) +``` + diff --git a/docs/reference/AssignmentSubmissionHistoryState.md b/docs/reference/AssignmentSubmissionHistoryState.md new file mode 100644 index 0000000..a39d641 --- /dev/null +++ b/docs/reference/AssignmentSubmissionHistoryState.md @@ -0,0 +1,15 @@ +# FlatApi::AssignmentSubmissionHistoryState + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionHistoryState.new() +``` + diff --git a/docs/reference/AssignmentSubmissionLti.md b/docs/reference/AssignmentSubmissionLti.md new file mode 100644 index 0000000..dfc39a5 --- /dev/null +++ b/docs/reference/AssignmentSubmissionLti.md @@ -0,0 +1,20 @@ +# FlatApi::AssignmentSubmissionLti + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **grade_service** | **String** | 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** | **String** | The sourcedid of the LTI submission when using LTI Outcomes | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionLti.new( + grade_service: null, + sourcedid: null +) +``` + diff --git a/docs/reference/AssignmentSubmissionPlayback.md b/docs/reference/AssignmentSubmissionPlayback.md new file mode 100644 index 0000000..847fa88 --- /dev/null +++ b/docs/reference/AssignmentSubmissionPlayback.md @@ -0,0 +1,20 @@ +# FlatApi::AssignmentSubmissionPlayback + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | The score unique identifier | | +| **nb_play_attempt** | **Float** | Number of times the score was played | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionPlayback.new( + score: null, + nb_play_attempt: null +) +``` + diff --git a/docs/reference/AssignmentSubmissionState.md b/docs/reference/AssignmentSubmissionState.md new file mode 100644 index 0000000..e4fcdeb --- /dev/null +++ b/docs/reference/AssignmentSubmissionState.md @@ -0,0 +1,15 @@ +# FlatApi::AssignmentSubmissionState + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionState.new() +``` + diff --git a/docs/reference/AssignmentSubmissionStudentsMode.md b/docs/reference/AssignmentSubmissionStudentsMode.md new file mode 100644 index 0000000..ad6d1b9 --- /dev/null +++ b/docs/reference/AssignmentSubmissionStudentsMode.md @@ -0,0 +1,15 @@ +# FlatApi::AssignmentSubmissionStudentsMode + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionStudentsMode.new() +``` + diff --git a/docs/reference/AssignmentSubmissionUpdate.md b/docs/reference/AssignmentSubmissionUpdate.md new file mode 100644 index 0000000..5c0990f --- /dev/null +++ b/docs/reference/AssignmentSubmissionUpdate.md @@ -0,0 +1,30 @@ +# FlatApi::AssignmentSubmissionUpdate + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attachments** | [**Array<ClassAttachmentCreation>**](ClassAttachmentCreation.md) | | [optional] | +| **playback** | [**Array<AssignmentSubmissionPlayback>**](AssignmentSubmissionPlayback.md) | | [optional] | +| **submit** | **Boolean** | 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] | +| **exercises_ids** | **Array<String>** | The ids of exercises when they need to be in a specific order | [optional] | +| **_return** | **Boolean** | If `true`, the submission will be marked as done | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentSubmissionUpdate.new( + attachments: null, + playback: null, + submit: null, + draft_grade: null, + grade: null, + exercises_ids: null, + _return: null +) +``` + diff --git a/docs/reference/AssignmentType.md b/docs/reference/AssignmentType.md new file mode 100644 index 0000000..e850d14 --- /dev/null +++ b/docs/reference/AssignmentType.md @@ -0,0 +1,15 @@ +# FlatApi::AssignmentType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentType.new() +``` + diff --git a/docs/reference/AssignmentUpdate.md b/docs/reference/AssignmentUpdate.md new file mode 100644 index 0000000..7d44940 --- /dev/null +++ b/docs/reference/AssignmentUpdate.md @@ -0,0 +1,60 @@ +# FlatApi::AssignmentUpdate + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | [**AssignmentType**](AssignmentType.md) | | [optional] | +| **title** | **String** | Title of the assignment | [optional] | +| **description** | **String** | Student instructions and content of the assignment (plain text) | [optional] | +| **description_html** | **String** | 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** | **String** | Teacher-only instructions (plain text) | [optional] | +| **teacher_instructions_html** | **String** | 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** | [**Array<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** | **Boolean** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] | +| **restrict_to_audio_tracks** | **Boolean** | Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. | [optional] | +| **toolset** | **String** | 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** | **String** | The id of the cover to display | [optional] | +| **cover** | **String** | 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** | **String** | 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** | **Boolean** | Mixing worksheets exercises for each student | [optional] | +| **submission_students_mode** | [**AssignmentSubmissionStudentsMode**](AssignmentSubmissionStudentsMode.md) | | [optional] | +| **recording_type** | **String** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::AssignmentUpdate.new( + type: null, + title: null, + description: null, + description_html: null, + teacher_instructions: null, + teacher_instructions_html: null, + attachments: null, + nb_playback_authorized: null, + restrict_play_note: null, + restrict_to_audio_tracks: null, + toolset: null, + cover_file: null, + cover: null, + max_points: null, + release_grades: null, + shuffle_exercises: null, + submission_students_mode: null, + recording_type: null, + allow_metronome: null, + allow_backing_track: null, + allow_speed_change: null, + free_record: null +) +``` + diff --git a/docs/reference/ClassApi.md b/docs/reference/ClassApi.md new file mode 100644 index 0000000..f9e77ef --- /dev/null +++ b/docs/reference/ClassApi.md @@ -0,0 +1,2379 @@ +# FlatApi::ClassApi + +All URIs are relative to *https://api.flat.io/v2* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**activate_class**](ClassApi.md#activate_class) | **POST** /classes/{class}/activate | Activate the class | +| [**add_class_user**](ClassApi.md#add_class_user) | **PUT** /classes/{class}/users/{user} | Add a user to the class | +| [**archive_assignment**](ClassApi.md#archive_assignment) | **POST** /classes/{class}/assignments/{assignment}/archive | Archive the assignment | +| [**archive_class**](ClassApi.md#archive_class) | **POST** /classes/{class}/archive | Archive the class | +| [**copy_assignment**](ClassApi.md#copy_assignment) | **POST** /classes/{class}/assignments/{assignment}/copy | Copy an assignment | +| [**create_class**](ClassApi.md#create_class) | **POST** /classes | Create a new class | +| [**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 | +| [**edit_submission**](ClassApi.md#edit_submission) | **PUT** /classes/{class}/assignments/{assignment}/submissions/{submission} | Edit a submission | +| [**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 | +| [**get_submission_comments**](ClassApi.md#get_submission_comments) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission}/comments | List the feedback comments of a submission | +| [**get_submission_history**](ClassApi.md#get_submission_history) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission}/history | Get the history of the submission | +| [**get_submissions**](ClassApi.md#get_submissions) | **GET** /classes/{class}/assignments/{assignment}/submissions | List the students' submissions | +| [**list_assignments**](ClassApi.md#list_assignments) | **GET** /classes/{class}/assignments | Assignments listing | +| [**list_class_student_submissions**](ClassApi.md#list_class_student_submissions) | **GET** /classes/{class}/students/{user}/submissions | List the submissions for a student | +| [**list_classes**](ClassApi.md#list_classes) | **GET** /classes | List the classes available for the current user | +| [**post_submission_comment**](ClassApi.md#post_submission_comment) | **POST** /classes/{class}/assignments/{assignment}/submissions/{submission}/comments | Add a feedback comment to a submission | +| [**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 | + + +## activate_class + +> activate_class(_class) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class + +begin + # Activate the class + result = api_instance.activate_class(_class) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->activate_class: #{e}" +end +``` + +#### Using the activate_class_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> activate_class_with_http_info(_class) + +```ruby +begin + # Activate the class + data, status_code, headers = api_instance.activate_class_with_http_info(_class) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->activate_class_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | + +### Return type + +[**ClassDetails**](ClassDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## add_class_user + +> add_class_user(_class, user) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +user = 'user_example' # String | Unique identifier of the user + +begin + # Add a user to the class + api_instance.add_class_user(_class, user) +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->add_class_user: #{e}" +end +``` + +#### Using the add_class_user_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> add_class_user_with_http_info(_class, user) + +```ruby +begin + # Add a user to the class + data, status_code, headers = api_instance.add_class_user_with_http_info(_class, user) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->add_class_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **user** | **String** | Unique identifier of the user | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## archive_assignment + +> archive_assignment(_class, assignment) + +Archive the assignment + +Archive the assignment + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment + +begin + # Archive the assignment + result = api_instance.archive_assignment(_class, assignment) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->archive_assignment: #{e}" +end +``` + +#### Using the archive_assignment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> archive_assignment_with_http_info(_class, assignment) + +```ruby +begin + # Archive the assignment + data, status_code, headers = api_instance.archive_assignment_with_http_info(_class, assignment) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->archive_assignment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | 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 + + +## archive_class + +> archive_class(_class) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class + +begin + # Archive the class + result = api_instance.archive_class(_class) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->archive_class: #{e}" +end +``` + +#### Using the archive_class_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> archive_class_with_http_info(_class) + +```ruby +begin + # Archive the class + data, status_code, headers = api_instance.archive_class_with_http_info(_class) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->archive_class_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | + +### Return type + +[**ClassDetails**](ClassDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## copy_assignment + +> copy_assignment(_class, assignment, body) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +body = FlatApi::AssignmentCopyToClass.new({classroom: 'classroom_example'}) # AssignmentCopy | + +begin + # Copy an assignment + result = api_instance.copy_assignment(_class, assignment, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->copy_assignment: #{e}" +end +``` + +#### Using the copy_assignment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> copy_assignment_with_http_info(_class, assignment, body) + +```ruby +begin + # Copy an assignment + data, status_code, headers = api_instance.copy_assignment_with_http_info(_class, assignment, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->copy_assignment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **body** | [**AssignmentCopy**](AssignmentCopy.md) | | | + +### Return type + +[**AssignmentCopyResponse**](AssignmentCopyResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_class + +> create_class(body) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +body = FlatApi::ClassCreation.new({name: 'name_example'}) # ClassCreation | + +begin + # Create a new class + result = api_instance.create_class(body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->create_class: #{e}" +end +``` + +#### Using the create_class_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_class_with_http_info(body) + +```ruby +begin + # Create a new class + data, status_code, headers = api_instance.create_class_with_http_info(body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->create_class_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **body** | [**ClassCreation**](ClassCreation.md) | | | + +### Return type + +[**ClassDetails**](ClassDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_class_assignment + +> create_class_assignment(_class, body) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +body = FlatApi::ClassAssignmentUpdate.new # ClassAssignmentUpdate | + +begin + # Assignment creation + result = api_instance.create_class_assignment(_class, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->create_class_assignment: #{e}" +end +``` + +#### Using the create_class_assignment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_class_assignment_with_http_info(_class, body) + +```ruby +begin + # Assignment creation + data, status_code, headers = api_instance.create_class_assignment_with_http_info(_class, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->create_class_assignment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **body** | [**ClassAssignmentUpdate**](ClassAssignmentUpdate.md) | | | + +### Return type + +[**Assignment**](Assignment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_submission + +> create_submission(_class, assignment, body) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +body = FlatApi::AssignmentSubmissionUpdate.new # AssignmentSubmissionUpdate | + +begin + # Create or edit a submission + result = api_instance.create_submission(_class, assignment, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->create_submission: #{e}" +end +``` + +#### Using the create_submission_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_submission_with_http_info(_class, assignment, body) + +```ruby +begin + # Create or edit a submission + data, status_code, headers = api_instance.create_submission_with_http_info(_class, assignment, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->create_submission_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **body** | [**AssignmentSubmissionUpdate**](AssignmentSubmissionUpdate.md) | | | + +### Return type + +[**AssignmentSubmission**](AssignmentSubmission.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_test_student_account + +> create_test_student_account(_class, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +opts = { + reset: true # Boolean | If true, the testing account will be re-created. +} + +begin + # Create a test student account + result = api_instance.create_test_student_account(_class, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->create_test_student_account: #{e}" +end +``` + +#### Using the create_test_student_account_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_test_student_account_with_http_info(_class, opts) + +```ruby +begin + # Create a test student account + data, status_code, headers = api_instance.create_test_student_account_with_http_info(_class, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->create_test_student_account_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **reset** | **Boolean** | If true, the testing account will be re-created. | [optional] | + +### Return type + +[**UserDetails**](UserDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_assignment + +> delete_assignment(_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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment + +begin + # Delete an assignment + api_instance.delete_assignment(_class, assignment) +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->delete_assignment: #{e}" +end +``` + +#### Using the delete_assignment_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_assignment_with_http_info(_class, assignment) + +```ruby +begin + # Delete an assignment + data, status_code, headers = api_instance.delete_assignment_with_http_info(_class, assignment) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->delete_assignment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_class_user + +> delete_class_user(_class, user) + +Remove a user from the class + +This method can be used by a teacher of the class to remove another user from it. Removing your own account is not allowed. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +user = 'user_example' # String | Unique identifier of the user + +begin + # Remove a user from the class + api_instance.delete_class_user(_class, user) +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->delete_class_user: #{e}" +end +``` + +#### Using the delete_class_user_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_class_user_with_http_info(_class, user) + +```ruby +begin + # Remove a user from the class + data, status_code, headers = api_instance.delete_class_user_with_http_info(_class, user) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->delete_class_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **user** | **String** | Unique identifier of the user | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_submission + +> delete_submission(_class, assignment, submission) + +Reset a submission + +Use this method as a teacher to reset a submission and allow student to start over the assignment + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +submission = 'submission_example' # String | Unique identifier of the submission + +begin + # Reset a submission + result = api_instance.delete_submission(_class, assignment, submission) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->delete_submission: #{e}" +end +``` + +#### Using the delete_submission_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> delete_submission_with_http_info(_class, assignment, submission) + +```ruby +begin + # Reset a submission + data, status_code, headers = api_instance.delete_submission_with_http_info(_class, assignment, submission) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->delete_submission_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **submission** | **String** | Unique identifier of the submission | | + +### Return type + +[**AssignmentSubmission**](AssignmentSubmission.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_submission_comment + +> delete_submission_comment(_class, assignment, submission, comment) + +Delete a feedback comment to a submission + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +submission = 'submission_example' # String | Unique identifier of the submission +comment = 'comment_example' # String | Unique identifier of the comment + +begin + # Delete a feedback comment to a submission + api_instance.delete_submission_comment(_class, assignment, submission, comment) +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->delete_submission_comment: #{e}" +end +``` + +#### Using the delete_submission_comment_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_submission_comment_with_http_info(_class, assignment, submission, comment) + +```ruby +begin + # Delete a feedback comment to a submission + data, status_code, headers = api_instance.delete_submission_comment_with_http_info(_class, assignment, submission, comment) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->delete_submission_comment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **submission** | **String** | Unique identifier of the submission | | +| **comment** | **String** | Unique identifier of the comment | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## edit_submission + +> edit_submission(_class, assignment, submission, 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` + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +submission = 'submission_example' # String | Unique identifier of the submission +body = FlatApi::AssignmentSubmissionUpdate.new # AssignmentSubmissionUpdate | + +begin + # Edit a submission + result = api_instance.edit_submission(_class, assignment, submission, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->edit_submission: #{e}" +end +``` + +#### Using the edit_submission_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> edit_submission_with_http_info(_class, assignment, submission, body) + +```ruby +begin + # Edit a submission + data, status_code, headers = api_instance.edit_submission_with_http_info(_class, assignment, submission, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->edit_submission_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **submission** | **String** | Unique identifier of the submission | | +| **body** | [**AssignmentSubmissionUpdate**](AssignmentSubmissionUpdate.md) | | | + +### Return type + +[**AssignmentSubmission**](AssignmentSubmission.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## enroll_class + +> enroll_class(enrollment_code) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +enrollment_code = 'enrollment_code_example' # String | The enrollment code, available to the teacher in `ClassDetails` + +begin + # Join a class + result = api_instance.enroll_class(enrollment_code) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->enroll_class: #{e}" +end +``` + +#### Using the enroll_class_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> enroll_class_with_http_info(enrollment_code) + +```ruby +begin + # Join a class + data, status_code, headers = api_instance.enroll_class_with_http_info(enrollment_code) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->enroll_class_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **enrollment_code** | **String** | The enrollment code, available to the teacher in `ClassDetails` | | + +### Return type + +[**ClassDetails**](ClassDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## export_submissions_reviews_as_csv + +> File export_submissions_reviews_as_csv(_class, assignment) + +CSV Grades exports + +Export list of submissions grades to a CSV file + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment + +begin + # CSV Grades exports + result = api_instance.export_submissions_reviews_as_csv(_class, assignment) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->export_submissions_reviews_as_csv: #{e}" +end +``` + +#### Using the export_submissions_reviews_as_csv_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> export_submissions_reviews_as_csv_with_http_info(_class, assignment) + +```ruby +begin + # CSV Grades exports + data, status_code, headers = api_instance.export_submissions_reviews_as_csv_with_http_info(_class, assignment) + p status_code # => 2xx + p headers # => { ... } + p data # => File +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->export_submissions_reviews_as_csv_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/csv + + +## export_submissions_reviews_as_excel + +> File export_submissions_reviews_as_excel(_class, assignment) + +Excel Grades exports + +Export list of submissions grades to an Excel file + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment + +begin + # Excel Grades exports + result = api_instance.export_submissions_reviews_as_excel(_class, assignment) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->export_submissions_reviews_as_excel: #{e}" +end +``` + +#### Using the export_submissions_reviews_as_excel_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> export_submissions_reviews_as_excel_with_http_info(_class, assignment) + +```ruby +begin + # Excel Grades exports + data, status_code, headers = api_instance.export_submissions_reviews_as_excel_with_http_info(_class, assignment) + p status_code # => 2xx + p headers # => { ... } + p data # => File +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->export_submissions_reviews_as_excel_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + +## get_assignment + +> get_assignment(_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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment + +begin + # Get an assignment + result = api_instance.get_assignment(_class, assignment) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_assignment: #{e}" +end +``` + +#### Using the get_assignment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_assignment_with_http_info(_class, assignment) + +```ruby +begin + # Get an assignment + data, status_code, headers = api_instance.get_assignment_with_http_info(_class, assignment) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_assignment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | 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 + + +## get_class + +> get_class(_class) + +Get the details of a single class + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class + +begin + # Get the details of a single class + result = api_instance.get_class(_class) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_class: #{e}" +end +``` + +#### Using the get_class_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_class_with_http_info(_class) + +```ruby +begin + # Get the details of a single class + data, status_code, headers = api_instance.get_class_with_http_info(_class) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_class_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | + +### Return type + +[**ClassDetails**](ClassDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_score_submissions + +> > get_score_submissions(score) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +score = 'score_example' # String | 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`). + +begin + # List submissions related to the score + result = api_instance.get_score_submissions(score) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_score_submissions: #{e}" +end +``` + +#### Using the get_score_submissions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_score_submissions_with_http_info(score) + +```ruby +begin + # List submissions related to the score + data, status_code, headers = api_instance.get_score_submissions_with_http_info(score) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_score_submissions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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`). | | + +### Return type + +[**Array<AssignmentSubmission>**](AssignmentSubmission.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_submission + +> get_submission(_class, assignment, submission) + +Get a student submission + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +submission = 'submission_example' # String | Unique identifier of the submission + +begin + # Get a student submission + result = api_instance.get_submission(_class, assignment, submission) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_submission: #{e}" +end +``` + +#### Using the get_submission_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_submission_with_http_info(_class, assignment, submission) + +```ruby +begin + # Get a student submission + data, status_code, headers = api_instance.get_submission_with_http_info(_class, assignment, submission) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_submission_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **submission** | **String** | Unique identifier of the submission | | + +### Return type + +[**AssignmentSubmission**](AssignmentSubmission.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_submission_comments + +> > get_submission_comments(_class, assignment, submission) + +List the feedback comments of a submission + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +submission = 'submission_example' # String | Unique identifier of the submission + +begin + # List the feedback comments of a submission + result = api_instance.get_submission_comments(_class, assignment, submission) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_submission_comments: #{e}" +end +``` + +#### Using the get_submission_comments_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_submission_comments_with_http_info(_class, assignment, submission) + +```ruby +begin + # List the feedback comments of a submission + data, status_code, headers = api_instance.get_submission_comments_with_http_info(_class, assignment, submission) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_submission_comments_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **submission** | **String** | Unique identifier of the submission | | + +### Return type + +[**Array<AssignmentSubmissionComment>**](AssignmentSubmissionComment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_submission_history + +> > get_submission_history(_class, assignment, submission) + +Get the history of the submission + +For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +submission = 'submission_example' # String | Unique identifier of the submission + +begin + # Get the history of the submission + result = api_instance.get_submission_history(_class, assignment, submission) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_submission_history: #{e}" +end +``` + +#### Using the get_submission_history_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_submission_history_with_http_info(_class, assignment, submission) + +```ruby +begin + # Get the history of the submission + data, status_code, headers = api_instance.get_submission_history_with_http_info(_class, assignment, submission) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_submission_history_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **submission** | **String** | Unique identifier of the submission | | + +### Return type + +[**Array<AssignmentSubmissionHistory>**](AssignmentSubmissionHistory.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_submissions + +> > get_submissions(_class, assignment) + +List the students' submissions + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment + +begin + # List the students' submissions + result = api_instance.get_submissions(_class, assignment) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_submissions: #{e}" +end +``` + +#### Using the get_submissions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_submissions_with_http_info(_class, assignment) + +```ruby +begin + # List the students' submissions + data, status_code, headers = api_instance.get_submissions_with_http_info(_class, assignment) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->get_submissions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | + +### Return type + +[**Array<AssignmentSubmission>**](AssignmentSubmission.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_assignments + +> > list_assignments(_class) + +Assignments listing + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class + +begin + # Assignments listing + result = api_instance.list_assignments(_class) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->list_assignments: #{e}" +end +``` + +#### Using the list_assignments_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_assignments_with_http_info(_class) + +```ruby +begin + # Assignments listing + data, status_code, headers = api_instance.list_assignments_with_http_info(_class) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->list_assignments_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | + +### Return type + +[**Array<ClassAssignment>**](ClassAssignment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_class_student_submissions + +> > list_class_student_submissions(_class, user) + +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 + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +user = 'user_example' # String | Unique identifier of the user + +begin + # List the submissions for a student + result = api_instance.list_class_student_submissions(_class, user) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->list_class_student_submissions: #{e}" +end +``` + +#### Using the list_class_student_submissions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_class_student_submissions_with_http_info(_class, user) + +```ruby +begin + # List the submissions for a student + data, status_code, headers = api_instance.list_class_student_submissions_with_http_info(_class, user) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->list_class_student_submissions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **user** | **String** | Unique identifier of the user | | + +### Return type + +[**Array<AssignmentSubmission>**](AssignmentSubmission.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_classes + +> > list_classes(opts) + +List the classes available for the current user + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +opts = { + state: 'active' # String | Filter the classes by state +} + +begin + # List the classes available for the current user + result = api_instance.list_classes(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->list_classes: #{e}" +end +``` + +#### Using the list_classes_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_classes_with_http_info(opts) + +```ruby +begin + # List the classes available for the current user + data, status_code, headers = api_instance.list_classes_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->list_classes_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **state** | **String** | Filter the classes by state | [optional][default to 'active'] | + +### Return type + +[**Array<ClassDetails>**](ClassDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## post_submission_comment + +> post_submission_comment(_class, assignment, submission, assignment_submission_comment_creation) + +Add a feedback comment to a submission + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +submission = 'submission_example' # String | Unique identifier of the submission +assignment_submission_comment_creation = FlatApi::AssignmentSubmissionCommentCreation.new({comment: 'comment_example'}) # AssignmentSubmissionCommentCreation | + +begin + # Add a feedback comment to a submission + result = api_instance.post_submission_comment(_class, assignment, submission, assignment_submission_comment_creation) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->post_submission_comment: #{e}" +end +``` + +#### Using the post_submission_comment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> post_submission_comment_with_http_info(_class, assignment, submission, assignment_submission_comment_creation) + +```ruby +begin + # Add a feedback comment to a submission + data, status_code, headers = api_instance.post_submission_comment_with_http_info(_class, assignment, submission, assignment_submission_comment_creation) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->post_submission_comment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **submission** | **String** | Unique identifier of the submission | | +| **assignment_submission_comment_creation** | [**AssignmentSubmissionCommentCreation**](AssignmentSubmissionCommentCreation.md) | | | + +### Return type + +[**AssignmentSubmissionComment**](AssignmentSubmissionComment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## unarchive_assignment + +> unarchive_assignment(_class, assignment) + +Unarchive the assignment. + +Mark the assignment as `active`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment + +begin + # Unarchive the assignment. + result = api_instance.unarchive_assignment(_class, assignment) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->unarchive_assignment: #{e}" +end +``` + +#### Using the unarchive_assignment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> unarchive_assignment_with_http_info(_class, assignment) + +```ruby +begin + # Unarchive the assignment. + data, status_code, headers = api_instance.unarchive_assignment_with_http_info(_class, assignment) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->unarchive_assignment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | 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 + + +## unarchive_class + +> unarchive_class(_class) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class + +begin + # Unarchive the class + result = api_instance.unarchive_class(_class) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->unarchive_class: #{e}" +end +``` + +#### Using the unarchive_class_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> unarchive_class_with_http_info(_class) + +```ruby +begin + # Unarchive the class + data, status_code, headers = api_instance.unarchive_class_with_http_info(_class) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->unarchive_class_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | + +### Return type + +[**ClassDetails**](ClassDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_class + +> update_class(_class, body) + +Update the class + +Update the meta information of the class + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +body = FlatApi::ClassUpdate.new # ClassUpdate | Details of the Class + +begin + # Update the class + result = api_instance.update_class(_class, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->update_class: #{e}" +end +``` + +#### Using the update_class_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_class_with_http_info(_class, body) + +```ruby +begin + # Update the class + data, status_code, headers = api_instance.update_class_with_http_info(_class, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->update_class_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **body** | [**ClassUpdate**](ClassUpdate.md) | Details of the Class | | + +### Return type + +[**ClassDetails**](ClassDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_class_assignment + +> update_class_assignment(_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`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +body = FlatApi::ClassAssignmentUpdate.new # ClassAssignmentUpdate | + +begin + # Update an assignment + result = api_instance.update_class_assignment(_class, assignment, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->update_class_assignment: #{e}" +end +``` + +#### Using the update_class_assignment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_class_assignment_with_http_info(_class, assignment, body) + +```ruby +begin + # Update an assignment + data, status_code, headers = api_instance.update_class_assignment_with_http_info(_class, assignment, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->update_class_assignment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | 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 + + +## update_submission_comment + +> update_submission_comment(_class, assignment, submission, comment, assignment_submission_comment_creation) + +Update a feedback comment to a submission + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ClassApi.new +_class = '_class_example' # String | Unique identifier of the class +assignment = 'assignment_example' # String | Unique identifier of the assignment +submission = 'submission_example' # String | Unique identifier of the submission +comment = 'comment_example' # String | Unique identifier of the comment +assignment_submission_comment_creation = FlatApi::AssignmentSubmissionCommentCreation.new({comment: 'comment_example'}) # AssignmentSubmissionCommentCreation | + +begin + # Update a feedback comment to a submission + result = api_instance.update_submission_comment(_class, assignment, submission, comment, assignment_submission_comment_creation) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->update_submission_comment: #{e}" +end +``` + +#### Using the update_submission_comment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_submission_comment_with_http_info(_class, assignment, submission, comment, assignment_submission_comment_creation) + +```ruby +begin + # Update a feedback comment to a submission + data, status_code, headers = api_instance.update_submission_comment_with_http_info(_class, assignment, submission, comment, assignment_submission_comment_creation) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ClassApi->update_submission_comment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_class** | **String** | Unique identifier of the class | | +| **assignment** | **String** | Unique identifier of the assignment | | +| **submission** | **String** | Unique identifier of the submission | | +| **comment** | **String** | Unique identifier of the comment | | +| **assignment_submission_comment_creation** | [**AssignmentSubmissionCommentCreation**](AssignmentSubmissionCommentCreation.md) | | | + +### Return type + +[**AssignmentSubmissionComment**](AssignmentSubmissionComment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/reference/ClassAssignment.md b/docs/reference/ClassAssignment.md new file mode 100644 index 0000000..938c667 --- /dev/null +++ b/docs/reference/ClassAssignment.md @@ -0,0 +1,98 @@ +# FlatApi::ClassAssignment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the assignment | | +| **type** | [**AssignmentType**](AssignmentType.md) | | | +| **capabilities** | [**AssignmentCapabilities**](AssignmentCapabilities.md) | | | +| **title** | **String** | Title of the assignment | | +| **description** | **String** | Student instructions and content of the assignment (plain text) | [optional] | +| **description_html** | **String** | 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** | **String** | 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** | **String** | 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** | **String** | The URL of the cover to display | [optional] | +| **cover_file** | **String** | The id of the cover to display | [optional] | +| **attachments** | [**Array<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** | **Boolean** | 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** | **String** | 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** | **Boolean** | Mixing worksheets exercises for each student | [optional] | +| **toolset** | **String** | 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** | **Boolean** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] | +| **restrict_to_audio_tracks** | **Boolean** | 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** | **String** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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** | **String** | The User unique identifier of the creator of this assignment | [optional] | +| **state** | **String** | State of the assignment | | +| **classroom** | **String** | The unique identifier of the class where this assignment was posted | [optional] | +| **creation_date** | **Time** | The creation date of this assignment | | +| **scheduled_date** | **Time** | 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** | **Time** | The due date of this assignment, late submissions will be marked as paste due. | [optional] | +| **assignee_mode** | **String** | Possible modes of assigning assignments | [optional] | +| **assigned_students** | **Array<String>** | Identifiers for the students that have access to the assignment | [optional] | +| **assigned_groups** | [**Array<AssignmentGroup>**](AssignmentGroup.md) | Groups that have access to the assignment (for shared writing assignments) | [optional] | +| **submissions** | [**Array<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** | **String** | Detected issue for this assignment | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassAssignment.new( + id: null, + type: null, + capabilities: null, + title: null, + description: null, + description_html: null, + teacher_instructions: null, + teacher_instructions_html: null, + cover: null, + cover_file: null, + attachments: null, + use_dedicated_attachments: null, + max_points: null, + release_grades: null, + shuffle_exercises: null, + toolset: null, + nb_playback_authorized: null, + restrict_play_note: null, + restrict_to_audio_tracks: null, + submission_students_mode: null, + recording_type: null, + allow_metronome: null, + allow_backing_track: null, + allow_speed_change: null, + free_record: null, + creator: null, + state: null, + classroom: null, + creation_date: null, + scheduled_date: null, + due_date: null, + assignee_mode: null, + assigned_students: null, + assigned_groups: null, + submissions: null, + google_classroom: null, + microsoft_graph: null, + mfc: null, + canvas: null, + lti: null, + issue: null +) +``` + diff --git a/docs/reference/ClassAssignmentAllOfCanvas.md b/docs/reference/ClassAssignmentAllOfCanvas.md new file mode 100644 index 0000000..ea7179e --- /dev/null +++ b/docs/reference/ClassAssignmentAllOfCanvas.md @@ -0,0 +1,20 @@ +# FlatApi::ClassAssignmentAllOfCanvas + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the course on Canvas assignment | [optional] | +| **alternate_link** | **String** | Link to Canvas assignment | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassAssignmentAllOfCanvas.new( + id: null, + alternate_link: null +) +``` + diff --git a/docs/reference/ClassAssignmentAllOfLti.md b/docs/reference/ClassAssignmentAllOfLti.md new file mode 100644 index 0000000..3e9b9f6 --- /dev/null +++ b/docs/reference/ClassAssignmentAllOfLti.md @@ -0,0 +1,18 @@ +# FlatApi::ClassAssignmentAllOfLti + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Resource ID in the LMS | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassAssignmentAllOfLti.new( + id: null +) +``` + diff --git a/docs/reference/ClassAssignmentAllOfMfc.md b/docs/reference/ClassAssignmentAllOfMfc.md new file mode 100644 index 0000000..ba0a26f --- /dev/null +++ b/docs/reference/ClassAssignmentAllOfMfc.md @@ -0,0 +1,20 @@ +# FlatApi::ClassAssignmentAllOfMfc + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the course on MusicFirst Task | [optional] | +| **alternate_link** | **String** | Link to MusicFirst Classroom task | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassAssignmentAllOfMfc.new( + id: null, + alternate_link: null +) +``` + diff --git a/docs/reference/ClassAssignmentUpdate.md b/docs/reference/ClassAssignmentUpdate.md new file mode 100644 index 0000000..086a63d --- /dev/null +++ b/docs/reference/ClassAssignmentUpdate.md @@ -0,0 +1,76 @@ +# FlatApi::ClassAssignmentUpdate + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | [**AssignmentType**](AssignmentType.md) | | [optional] | +| **title** | **String** | Title of the assignment | [optional] | +| **description** | **String** | Student instructions and content of the assignment (plain text) | [optional] | +| **description_html** | **String** | 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** | **String** | Teacher-only instructions (plain text) | [optional] | +| **teacher_instructions_html** | **String** | 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** | [**Array<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** | **Boolean** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] | +| **restrict_to_audio_tracks** | **Boolean** | Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. | [optional] | +| **toolset** | **String** | 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** | **String** | The id of the cover to display | [optional] | +| **cover** | **String** | 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** | **String** | 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** | **Boolean** | Mixing worksheets exercises for each student | [optional] | +| **submission_students_mode** | [**AssignmentSubmissionStudentsMode**](AssignmentSubmissionStudentsMode.md) | | [optional] | +| **recording_type** | **String** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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** | **Boolean** | 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** | **String** | State of the assignment | [optional] | +| **due_date** | **Time** | 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** | **Time** | 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** | **String** | Possible modes of assigning assignments | [optional] | +| **assigned_students** | **Array<String>** | Identifiers for the students that have access to the assignment | [optional] | +| **class_group_ids** | **Array<String>** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::ClassAssignmentUpdate.new( + type: null, + title: null, + description: null, + description_html: null, + teacher_instructions: null, + teacher_instructions_html: null, + attachments: null, + nb_playback_authorized: null, + restrict_play_note: null, + restrict_to_audio_tracks: null, + toolset: null, + cover_file: null, + cover: null, + max_points: null, + release_grades: null, + shuffle_exercises: null, + submission_students_mode: null, + recording_type: null, + allow_metronome: null, + allow_backing_track: null, + allow_speed_change: null, + free_record: null, + state: null, + due_date: null, + scheduled_date: null, + google_classroom: null, + microsoft_graph: null, + assignee_mode: null, + assigned_students: null, + class_group_ids: null +) +``` + diff --git a/docs/reference/ClassAssignmentUpdateAllOfGoogleClassroom.md b/docs/reference/ClassAssignmentUpdateAllOfGoogleClassroom.md new file mode 100644 index 0000000..c79f84b --- /dev/null +++ b/docs/reference/ClassAssignmentUpdateAllOfGoogleClassroom.md @@ -0,0 +1,18 @@ +# FlatApi::ClassAssignmentUpdateAllOfGoogleClassroom + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **topic_id** | **String** | Identifier of the topic where the assignment is created | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassAssignmentUpdateAllOfGoogleClassroom.new( + topic_id: null +) +``` + diff --git a/docs/reference/ClassAssignmentUpdateAllOfMicrosoftGraph.md b/docs/reference/ClassAssignmentUpdateAllOfMicrosoftGraph.md new file mode 100644 index 0000000..14f3048 --- /dev/null +++ b/docs/reference/ClassAssignmentUpdateAllOfMicrosoftGraph.md @@ -0,0 +1,18 @@ +# FlatApi::ClassAssignmentUpdateAllOfMicrosoftGraph + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **categories** | **Array<String>** | List of categories this assignment belongs to | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassAssignmentUpdateAllOfMicrosoftGraph.new( + categories: null +) +``` + diff --git a/docs/reference/ClassAttachmentCreation.md b/docs/reference/ClassAttachmentCreation.md new file mode 100644 index 0000000..b2fe8ff --- /dev/null +++ b/docs/reference/ClassAttachmentCreation.md @@ -0,0 +1,36 @@ +# FlatApi::ClassAttachmentCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | 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** | **String** | 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** | **String** | An unique worksheet identifier | [optional] | +| **revision** | **String** | An unique revision identifier of a score | [optional] | +| **part_uuid** | **String** | The UUID of the instrument part selected for this attachment (for performance submissions) | [optional] | +| **sharing_mode** | [**MediaScoreSharingMode**](MediaScoreSharingMode.md) | | [optional][default to 'read'] | +| **lock_score_template** | **Boolean** | 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** | **String** | The URL of the attachment. | [optional] | +| **google_drive_file_id** | **String** | The ID of the Google Drive File | [optional] | +| **teacher_only** | **Boolean** | Flag indicating if this attachment should only be visible to teachers | [optional][default to false] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassAttachmentCreation.new( + type: null, + score: null, + worksheet: null, + revision: null, + part_uuid: null, + sharing_mode: null, + lock_score_template: null, + url: null, + google_drive_file_id: null, + teacher_only: null +) +``` + diff --git a/docs/reference/ClassCreation.md b/docs/reference/ClassCreation.md new file mode 100644 index 0000000..97782b1 --- /dev/null +++ b/docs/reference/ClassCreation.md @@ -0,0 +1,26 @@ +# FlatApi::ClassCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | The name of the new class | | +| **section** | **String** | The section of the new class | [optional] | +| **level** | [**ClassGradeLevel**](ClassGradeLevel.md) | | [optional] | +| **skills_focused** | **Array<String>** | Specific skills that will be focused in classroom | [optional] | +| **size** | **Float** | Number of students in the classroom | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassCreation.new( + name: null, + section: null, + level: null, + skills_focused: null, + size: null +) +``` + diff --git a/docs/reference/ClassDetails.md b/docs/reference/ClassDetails.md new file mode 100644 index 0000000..3c9ab97 --- /dev/null +++ b/docs/reference/ClassDetails.md @@ -0,0 +1,66 @@ +# FlatApi::ClassDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the class | | +| **state** | [**ClassState**](ClassState.md) | | | +| **name** | **String** | The name of the class | | +| **section** | **String** | The section of the class | [optional] | +| **description** | **String** | An optionnal description for this class | [optional] | +| **organization** | **String** | The unique identifier of the Organization owning this class | [optional] | +| **owner** | **String** | The unique identifier of the User owning this class | [optional] | +| **creation_date** | **Time** | The date when the class was create | | +| **modification_date** | **Time** | The date when the class was last modified | [optional] | +| **enrollment_code** | **String** | [Teachers only] The enrollment code that can be used by the students to join the class | [optional] | +| **theme** | **String** | The theme identifier using in Flat User Interface | [optional] | +| **assignments_count** | **Float** | The number of assignments created in the class | [optional] | +| **students_group** | [**GroupDetails**](GroupDetails.md) | | [optional] | +| **teachers_group** | [**GroupDetails**](GroupDetails.md) | | [optional] | +| **issues** | [**ClassDetailsIssues**](ClassDetailsIssues.md) | | [optional] | +| **google_classroom** | [**ClassDetailsGoogleClassroom**](ClassDetailsGoogleClassroom.md) | | [optional] | +| **google_drive** | [**ClassDetailsGoogleDrive**](ClassDetailsGoogleDrive.md) | | [optional] | +| **microsoft_graph** | [**ClassDetailsMicrosoftGraph**](ClassDetailsMicrosoftGraph.md) | | [optional] | +| **lti** | [**ClassDetailsLti**](ClassDetailsLti.md) | | [optional] | +| **canvas** | [**ClassDetailsCanvas**](ClassDetailsCanvas.md) | | [optional] | +| **mfc** | [**ClassDetailsMfc**](ClassDetailsMfc.md) | | [optional] | +| **clever** | [**ClassDetailsClever**](ClassDetailsClever.md) | | [optional] | +| **level** | [**ClassGradeLevel**](ClassGradeLevel.md) | | [optional] | +| **skills_focused** | **Array<String>** | Specific skills that will be focused in classroom | [optional] | +| **size** | **Float** | Number of students in the classroom | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetails.new( + id: null, + state: null, + name: null, + section: null, + description: null, + organization: null, + owner: null, + creation_date: null, + modification_date: null, + enrollment_code: null, + theme: null, + assignments_count: null, + students_group: null, + teachers_group: null, + issues: null, + google_classroom: null, + google_drive: null, + microsoft_graph: null, + lti: null, + canvas: null, + mfc: null, + clever: null, + level: null, + skills_focused: null, + size: null +) +``` + diff --git a/docs/reference/ClassDetailsCanvas.md b/docs/reference/ClassDetailsCanvas.md new file mode 100644 index 0000000..3ecfefa --- /dev/null +++ b/docs/reference/ClassDetailsCanvas.md @@ -0,0 +1,20 @@ +# FlatApi::ClassDetailsCanvas + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the course on Canvas | [optional] | +| **domain** | **String** | Canvas instance domain (e.g. \"canvas.instructure.com\") | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetailsCanvas.new( + id: null, + domain: null +) +``` + diff --git a/docs/reference/ClassDetailsClever.md b/docs/reference/ClassDetailsClever.md new file mode 100644 index 0000000..eef63af --- /dev/null +++ b/docs/reference/ClassDetailsClever.md @@ -0,0 +1,30 @@ +# FlatApi::ClassDetailsClever + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Clever section unique identifier | [optional] | +| **creation_date** | **Time** | The creation date of the section on clever | [optional] | +| **modification_date** | **Time** | The last modification date of the section on clever | [optional] | +| **subject** | **String** | Normalized subject of the course | [optional] | +| **term_name** | **String** | Name of the term when this course happens | [optional] | +| **term_start_date** | **Time** | Beginning date of the term | [optional] | +| **term_end_date** | **Time** | End date of the term | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetailsClever.new( + id: null, + creation_date: null, + modification_date: null, + subject: null, + term_name: null, + term_start_date: null, + term_end_date: null +) +``` + diff --git a/docs/reference/ClassDetailsGoogleClassroom.md b/docs/reference/ClassDetailsGoogleClassroom.md new file mode 100644 index 0000000..95e4a52 --- /dev/null +++ b/docs/reference/ClassDetailsGoogleClassroom.md @@ -0,0 +1,20 @@ +# FlatApi::ClassDetailsGoogleClassroom + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The course identifier on Google Classroom | [optional] | +| **alternate_link** | **String** | Absolute link to this course in the Classroom web UI | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetailsGoogleClassroom.new( + id: null, + alternate_link: null +) +``` + diff --git a/docs/reference/ClassDetailsGoogleDrive.md b/docs/reference/ClassDetailsGoogleDrive.md new file mode 100644 index 0000000..482763e --- /dev/null +++ b/docs/reference/ClassDetailsGoogleDrive.md @@ -0,0 +1,20 @@ +# FlatApi::ClassDetailsGoogleDrive + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **teacher_folder_id** | **String** | [Teachers only] The Drive directory identifier of the teachers' folder | [optional] | +| **teacher_folder_alternate_link** | **String** | [Teachers only] The Drive URL of the teachers' folder | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetailsGoogleDrive.new( + teacher_folder_id: null, + teacher_folder_alternate_link: null +) +``` + diff --git a/docs/reference/ClassDetailsIssues.md b/docs/reference/ClassDetailsIssues.md new file mode 100644 index 0000000..3605139 --- /dev/null +++ b/docs/reference/ClassDetailsIssues.md @@ -0,0 +1,18 @@ +# FlatApi::ClassDetailsIssues + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sync** | [**Array<ClassDetailsIssuesSyncInner>**](ClassDetailsIssuesSyncInner.md) | Synchronization issues for the class | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetailsIssues.new( + sync: null +) +``` + diff --git a/docs/reference/ClassDetailsIssuesSyncInner.md b/docs/reference/ClassDetailsIssuesSyncInner.md new file mode 100644 index 0000000..2576a0b --- /dev/null +++ b/docs/reference/ClassDetailsIssuesSyncInner.md @@ -0,0 +1,22 @@ +# FlatApi::ClassDetailsIssuesSyncInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The account user identifier | [optional] | +| **email** | **String** | The email address of the user concerned by this sync issue | [optional] | +| **reason** | **String** | The reason why the account cannot be synced | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetailsIssuesSyncInner.new( + id: null, + email: null, + reason: null +) +``` + diff --git a/docs/reference/ClassDetailsLti.md b/docs/reference/ClassDetailsLti.md new file mode 100644 index 0000000..1152a10 --- /dev/null +++ b/docs/reference/ClassDetailsLti.md @@ -0,0 +1,24 @@ +# FlatApi::ClassDetailsLti + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **context_id** | **String** | Unique context identifier provided | [optional] | +| **context_title** | **String** | Context title | [optional] | +| **context_label** | **String** | Context label | [optional] | +| **has_nrps_service** | **Boolean** | If true, the class has been synchronized with the LTI 1.3 NRPS 2.0 service | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetailsLti.new( + context_id: null, + context_title: null, + context_label: null, + has_nrps_service: null +) +``` + diff --git a/docs/reference/ClassDetailsMfc.md b/docs/reference/ClassDetailsMfc.md new file mode 100644 index 0000000..a75008f --- /dev/null +++ b/docs/reference/ClassDetailsMfc.md @@ -0,0 +1,20 @@ +# FlatApi::ClassDetailsMfc + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the course on MusicFirst Classroom | [optional] | +| **alternate_link** | **String** | Link to MusicFirst Classroom class | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetailsMfc.new( + id: null, + alternate_link: null +) +``` + diff --git a/docs/reference/ClassDetailsMicrosoftGraph.md b/docs/reference/ClassDetailsMicrosoftGraph.md new file mode 100644 index 0000000..65b958e --- /dev/null +++ b/docs/reference/ClassDetailsMicrosoftGraph.md @@ -0,0 +1,18 @@ +# FlatApi::ClassDetailsMicrosoftGraph + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The course identifier on Microsoft Graph | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassDetailsMicrosoftGraph.new( + id: null +) +``` + diff --git a/docs/reference/ClassGradeLevel.md b/docs/reference/ClassGradeLevel.md new file mode 100644 index 0000000..a951225 --- /dev/null +++ b/docs/reference/ClassGradeLevel.md @@ -0,0 +1,15 @@ +# FlatApi::ClassGradeLevel + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassGradeLevel.new() +``` + diff --git a/docs/reference/ClassRoles.md b/docs/reference/ClassRoles.md new file mode 100644 index 0000000..50346fd --- /dev/null +++ b/docs/reference/ClassRoles.md @@ -0,0 +1,15 @@ +# FlatApi::ClassRoles + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassRoles.new() +``` + diff --git a/docs/reference/ClassState.md b/docs/reference/ClassState.md new file mode 100644 index 0000000..7c09704 --- /dev/null +++ b/docs/reference/ClassState.md @@ -0,0 +1,15 @@ +# FlatApi::ClassState + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassState.new() +``` + diff --git a/docs/reference/ClassUpdate.md b/docs/reference/ClassUpdate.md new file mode 100644 index 0000000..4db0643 --- /dev/null +++ b/docs/reference/ClassUpdate.md @@ -0,0 +1,26 @@ +# FlatApi::ClassUpdate + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | The name of the class | [optional] | +| **section** | **String** | The section of the class | [optional] | +| **level** | [**ClassGradeLevel**](ClassGradeLevel.md) | | [optional] | +| **skills_focused** | **Array<String>** | Specific skills that will be focused in classroom | [optional] | +| **size** | **Float** | Number of students in the classroom | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ClassUpdate.new( + name: null, + section: null, + level: null, + skills_focused: null, + size: null +) +``` + diff --git a/docs/reference/Collection.md b/docs/reference/Collection.md new file mode 100644 index 0000000..8a8bf2a --- /dev/null +++ b/docs/reference/Collection.md @@ -0,0 +1,52 @@ +# FlatApi::Collection + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the collection | | +| **title** | **String** | The title of the collection | | +| **html_url** | **String** | The url where the collection can be viewed in a web browser | | +| **type** | [**CollectionType**](CollectionType.md) | | | +| **label_key** | **String** | 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 'private'] | +| **sharing_key** | **String** | The private sharing key of the collection (available when the `privacy` mode is set to `privateLink`) | [optional] | +| **app** | [**CollectionApp**](CollectionApp.md) | | [optional] | +| **creation_date** | **Time** | The date when the collection was created | | +| **modification_date** | **Time** | The date when the collection was last modified | [optional] | +| **user** | [**UserPublicSummary**](UserPublicSummary.md) | | [optional] | +| **organization** | **String** | If the score has been created in an organization, the identifier of this organization. | [optional] | +| **rights** | [**ResourceRights**](ResourceRights.md) | | [optional] | +| **collaborators** | [**Array<ResourceCollaborator>**](ResourceCollaborator.md) | The list of the collaborators of the collection | [optional] | +| **is_pinned** | **Boolean** | Whether the collection is pinned by the owner | [optional] | +| **contents** | [**CollectionContents**](CollectionContents.md) | | | +| **capabilities** | [**CollectionCapabilities**](CollectionCapabilities.md) | | | +| **collections** | **Array<String>** | 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] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::Collection.new( + id: null, + title: null, + html_url: null, + type: null, + label_key: null, + privacy: null, + sharing_key: null, + app: null, + creation_date: null, + modification_date: null, + user: null, + organization: null, + rights: null, + collaborators: null, + is_pinned: null, + contents: null, + capabilities: null, + collections: null +) +``` + diff --git a/docs/reference/CollectionApi.md b/docs/reference/CollectionApi.md new file mode 100644 index 0000000..db67675 --- /dev/null +++ b/docs/reference/CollectionApi.md @@ -0,0 +1,677 @@ +# FlatApi::CollectionApi + +All URIs are relative to *https://api.flat.io/v2* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**add_score_to_collection**](CollectionApi.md#add_score_to_collection) | **PUT** /collections/{collection}/scores/{score} | Add a score to the collection | +| [**create_collection**](CollectionApi.md#create_collection) | **POST** /collections | Create a new collection | +| [**delete_collection**](CollectionApi.md#delete_collection) | **DELETE** /collections/{collection} | Delete the collection | +| [**delete_score_from_collection**](CollectionApi.md#delete_score_from_collection) | **DELETE** /collections/{collection}/scores/{score} | Delete a score from the collection | +| [**edit_collection**](CollectionApi.md#edit_collection) | **PUT** /collections/{collection} | Update a collection's metadata | +| [**get_collection**](CollectionApi.md#get_collection) | **GET** /collections/{collection} | Get collection details | +| [**list_collection_scores**](CollectionApi.md#list_collection_scores) | **GET** /collections/{collection}/scores | List the scores contained in a collection | +| [**list_collections**](CollectionApi.md#list_collections) | **GET** /collections | List the collections | +| [**untrash_collection**](CollectionApi.md#untrash_collection) | **POST** /collections/{collection}/untrash | Untrash a collection | + + +## add_score_to_collection + +> add_score_to_collection(collection, score, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::CollectionApi.new +collection = 'collection_example' # String | 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' # String | 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`). +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Add a score to the collection + result = api_instance.add_score_to_collection(collection, score, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->add_score_to_collection: #{e}" +end +``` + +#### Using the add_score_to_collection_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> add_score_to_collection_with_http_info(collection, score, opts) + +```ruby +begin + # Add a score to the collection + data, status_code, headers = api_instance.add_score_to_collection_with_http_info(collection, score, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->add_score_to_collection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | **String** | 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** | **String** | 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** | **String** | 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 + +[**ScoreDetails**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + + +## create_collection + +> create_collection(body) + +Create a new collection + +This method will create a new collection in your account. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::CollectionApi.new +body = FlatApi::CollectionCreation.new # CollectionCreation | + +begin + # Create a new collection + result = api_instance.create_collection(body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->create_collection: #{e}" +end +``` + +#### Using the create_collection_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_collection_with_http_info(body) + +```ruby +begin + # Create a new collection + data, status_code, headers = api_instance.create_collection_with_http_info(body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->create_collection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **body** | [**CollectionCreation**](CollectionCreation.md) | | | + +### Return type + +[**Collection**](Collection.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_collection + +> delete_collection(collection) + +Delete the collection + +This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::CollectionApi.new +collection = 'collection_example' # String | 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 + +begin + # Delete the collection + api_instance.delete_collection(collection) +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->delete_collection: #{e}" +end +``` + +#### Using the delete_collection_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_collection_with_http_info(collection) + +```ruby +begin + # Delete the collection + data, status_code, headers = api_instance.delete_collection_with_http_info(collection) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->delete_collection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | **String** | 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 + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_score_from_collection + +> delete_score_from_collection(collection, score, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::CollectionApi.new +collection = 'collection_example' # String | 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' # String | 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`). +opts = { + event_properties: '{"context":"discover","screenLevel0":"home","screenRoute":"/discover"}', # String | Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Delete a score from the collection + api_instance.delete_score_from_collection(collection, score, opts) +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->delete_score_from_collection: #{e}" +end +``` + +#### Using the delete_score_from_collection_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_score_from_collection_with_http_info(collection, score, opts) + +```ruby +begin + # Delete a score from the collection + data, status_code, headers = api_instance.delete_score_from_collection_with_http_info(collection, score, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->delete_score_from_collection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | **String** | 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** | **String** | 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** | **String** | 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** | **String** | 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 + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + + +## edit_collection + +> edit_collection(collection, body) + +Update a collection's metadata + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::CollectionApi.new +collection = 'collection_example' # String | 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 = FlatApi::CollectionModification.new # CollectionModification | + +begin + # Update a collection's metadata + result = api_instance.edit_collection(collection, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->edit_collection: #{e}" +end +``` + +#### Using the edit_collection_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> edit_collection_with_http_info(collection, body) + +```ruby +begin + # Update a collection's metadata + data, status_code, headers = api_instance.edit_collection_with_http_info(collection, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->edit_collection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | **String** | 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 + +[**Collection**](Collection.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_collection + +> get_collection(collection, opts) + +Get collection details + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::CollectionApi.new +collection = 'collection_example' # String | 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 +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Get collection details + result = api_instance.get_collection(collection, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->get_collection: #{e}" +end +``` + +#### Using the get_collection_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_collection_with_http_info(collection, opts) + +```ruby +begin + # Get collection details + data, status_code, headers = api_instance.get_collection_with_http_info(collection, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->get_collection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | **String** | 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** | **String** | 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 + +[**Collection**](Collection.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_collection_scores + +> > list_collection_scores(collection, opts) + +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`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::CollectionApi.new +collection = 'collection_example' # String | 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 +opts = { + sort: 'creationDate', # String | Sort + direction: 'asc', # String | Sort direction + limit: 56, # Integer | This is the maximum number of objects that may be returned + _next: '_next_example', # String | 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. + previous: 'previous_example', # String | 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. + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # List the scores contained in a collection + result = api_instance.list_collection_scores(collection, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->list_collection_scores: #{e}" +end +``` + +#### Using the list_collection_scores_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_collection_scores_with_http_info(collection, opts) + +```ruby +begin + # List the scores contained in a collection + data, status_code, headers = api_instance.list_collection_scores_with_http_info(collection, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->list_collection_scores_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | **String** | 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** | **String** | Sort | [optional] | +| **direction** | **String** | Sort direction | [optional] | +| **limit** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 25] | +| **_next** | **String** | 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** | **String** | 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** | **String** | 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 + +[**Array<ScoreDetails>**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_collections + +> > list_collections(opts) + +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`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::CollectionApi.new +opts = { + parent: 'parent_example', # String | 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`. + sort: 'creationDate', # String | Sort + direction: 'asc', # String | Sort direction + limit: 56, # Integer | This is the maximum number of objects that may be returned + _next: '_next_example', # String | 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. + previous: 'previous_example' # String | 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. +} + +begin + # List the collections + result = api_instance.list_collections(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->list_collections: #{e}" +end +``` + +#### Using the list_collections_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_collections_with_http_info(opts) + +```ruby +begin + # List the collections + data, status_code, headers = api_instance.list_collections_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->list_collections_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **parent** | **String** | 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** | **String** | Sort | [optional] | +| **direction** | **String** | Sort direction | [optional] | +| **limit** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 25] | +| **_next** | **String** | 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** | **String** | 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 + +[**Array<Collection>**](Collection.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## untrash_collection + +> untrash_collection(collection) + +Untrash a collection + +**DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::CollectionApi.new +collection = 'collection_example' # String | Unique identifier of the collection. + +begin + # Untrash a collection + result = api_instance.untrash_collection(collection) + p result +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->untrash_collection: #{e}" +end +``` + +#### Using the untrash_collection_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> untrash_collection_with_http_info(collection) + +```ruby +begin + # Untrash a collection + data, status_code, headers = api_instance.untrash_collection_with_http_info(collection) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling CollectionApi->untrash_collection_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | **String** | Unique identifier of the collection. | | + +### Return type + +[**FlatErrorResponse**](FlatErrorResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/reference/CollectionApp.md b/docs/reference/CollectionApp.md new file mode 100644 index 0000000..25912af --- /dev/null +++ b/docs/reference/CollectionApp.md @@ -0,0 +1,22 @@ +# FlatApi::CollectionApp + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The app unique identifier | [optional] | +| **name** | **String** | The name of the app | [optional] | +| **logo** | **String** | The app logo url | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::CollectionApp.new( + id: null, + name: null, + logo: null +) +``` + diff --git a/docs/reference/CollectionCapabilities.md b/docs/reference/CollectionCapabilities.md new file mode 100644 index 0000000..d595816 --- /dev/null +++ b/docs/reference/CollectionCapabilities.md @@ -0,0 +1,26 @@ +# FlatApi::CollectionCapabilities + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **can_edit** | **Boolean** | Whether the current user can modify the metadata for the collection | | +| **can_share** | **Boolean** | Whether the current user can modify the sharing settings for the collection | | +| **can_delete** | **Boolean** | Whether the current user can delete the collection | | +| **can_add_scores** | **Boolean** | 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. | | +| **can_delete_scores** | **Boolean** | 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. | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::CollectionCapabilities.new( + can_edit: null, + can_share: null, + can_delete: null, + can_add_scores: null, + can_delete_scores: null +) +``` + diff --git a/docs/reference/CollectionContents.md b/docs/reference/CollectionContents.md new file mode 100644 index 0000000..80831b9 --- /dev/null +++ b/docs/reference/CollectionContents.md @@ -0,0 +1,18 @@ +# FlatApi::CollectionContents + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **scores_count** | **Integer** | The number of scores in the collection | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::CollectionContents.new( + scores_count: null +) +``` + diff --git a/docs/reference/CollectionCreation.md b/docs/reference/CollectionCreation.md new file mode 100644 index 0000000..2a8ff38 --- /dev/null +++ b/docs/reference/CollectionCreation.md @@ -0,0 +1,20 @@ +# FlatApi::CollectionCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | The title of the collection | [optional] | +| **privacy** | [**CollectionPrivacy**](CollectionPrivacy.md) | | [optional][default to 'private'] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::CollectionCreation.new( + title: null, + privacy: null +) +``` + diff --git a/docs/reference/CollectionModification.md b/docs/reference/CollectionModification.md new file mode 100644 index 0000000..0f86618 --- /dev/null +++ b/docs/reference/CollectionModification.md @@ -0,0 +1,20 @@ +# FlatApi::CollectionModification + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | The title of the collection | [optional] | +| **privacy** | [**CollectionPrivacy**](CollectionPrivacy.md) | | [optional][default to 'private'] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::CollectionModification.new( + title: null, + privacy: null +) +``` + diff --git a/docs/reference/CollectionPrivacy.md b/docs/reference/CollectionPrivacy.md new file mode 100644 index 0000000..e10d02a --- /dev/null +++ b/docs/reference/CollectionPrivacy.md @@ -0,0 +1,15 @@ +# FlatApi::CollectionPrivacy + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::CollectionPrivacy.new() +``` + diff --git a/docs/reference/CollectionType.md b/docs/reference/CollectionType.md new file mode 100644 index 0000000..740ac1e --- /dev/null +++ b/docs/reference/CollectionType.md @@ -0,0 +1,15 @@ +# FlatApi::CollectionType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::CollectionType.new() +``` + diff --git a/docs/reference/CreditTransaction.md b/docs/reference/CreditTransaction.md new file mode 100644 index 0000000..5be13ad --- /dev/null +++ b/docs/reference/CreditTransaction.md @@ -0,0 +1,34 @@ +# FlatApi::CreditTransaction + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the credit transaction | | +| **type** | **String** | Credit category. `ai` covers every AI-powered feature. | | +| **feature** | **String** | 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** | **Integer** | 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** | **String** | 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** | **String** | 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** | **String** | 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** | **Time** | When the transaction was created | | +| **modification_date** | **Time** | When the transaction was last modified | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::CreditTransaction.new( + id: null, + type: null, + feature: null, + amount: null, + source: null, + state: null, + job: null, + creation_date: null, + modification_date: null +) +``` + diff --git a/docs/reference/EduLibrary.md b/docs/reference/EduLibrary.md new file mode 100644 index 0000000..98e8220 --- /dev/null +++ b/docs/reference/EduLibrary.md @@ -0,0 +1,24 @@ +# FlatApi::EduLibrary + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the library. This one can be used to list the underlying resources using `GET /v2/eduResources?parent={library-id}` | | +| **name** | **String** | Name of the lirbary | | +| **type** | **String** | Type of the library | | +| **visibility** | **String** | Visibility of the library | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduLibrary.new( + id: null, + name: null, + type: null, + visibility: null +) +``` + diff --git a/docs/reference/EduResource.md b/docs/reference/EduResource.md new file mode 100644 index 0000000..765d88f --- /dev/null +++ b/docs/reference/EduResource.md @@ -0,0 +1,46 @@ +# FlatApi::EduResource + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Resource unique identifier | | +| **creator** | **String** | The User identifier of the resource creator | [optional] | +| **type** | [**EduResourceType**](EduResourceType.md) | | | +| **privacy** | [**EduResourcePrivacy**](EduResourcePrivacy.md) | | [optional][default to 'private'] | +| **tags** | **Array<String>** | Specific attributes for the resource (e.g. sample resources with custom design) | [optional] | +| **parent** | **String** | Identifier of the parent resource, e.g. a folder or root | [optional] | +| **title** | **String** | Title of the resource | | +| **sharing_description** | **String** | Sharing description of this resource | [optional] | +| **sharing_description_html** | **String** | HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. | [optional] | +| **creation_date** | **Time** | The date when the resource was created | [optional] | +| **update_date** | **Time** | The date when the resource was updated | [optional] | +| **resource** | [**EduResourceResource**](EduResourceResource.md) | | [optional] | +| **capabilities** | [**EduResourceCapabilities**](EduResourceCapabilities.md) | | | +| **subjects** | [**Array<TeachingTheme>**](TeachingTheme.md) | The subjects of this resource, or the subjects of the resources included in the folder | [optional] | +| **grades** | [**Array<Grade>**](Grade.md) | The grades of this resource, or the grades of the resources included in the folder. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResource.new( + id: null, + creator: null, + type: null, + privacy: null, + tags: null, + parent: null, + title: null, + sharing_description: null, + sharing_description_html: null, + creation_date: null, + update_date: null, + resource: null, + capabilities: null, + subjects: null, + grades: null +) +``` + diff --git a/docs/reference/EduResourceAssignmentCreation.md b/docs/reference/EduResourceAssignmentCreation.md new file mode 100644 index 0000000..0ab2b9c --- /dev/null +++ b/docs/reference/EduResourceAssignmentCreation.md @@ -0,0 +1,18 @@ +# FlatApi::EduResourceAssignmentCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | [**AssignmentType**](AssignmentType.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceAssignmentCreation.new( + type: null +) +``` + diff --git a/docs/reference/EduResourceCapabilities.md b/docs/reference/EduResourceCapabilities.md new file mode 100644 index 0000000..0fb88b9 --- /dev/null +++ b/docs/reference/EduResourceCapabilities.md @@ -0,0 +1,24 @@ +# FlatApi::EduResourceCapabilities + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **can_edit** | **Boolean** | Whether the current user can modify this resource | [optional] | +| **can_add_resources** | **Boolean** | Whether the current user can add resources within this resource (e.g. `assignment` inside a `folder`) | [optional] | +| **can_add_folders** | **Boolean** | Whether the current user can add folders within this resource (e.g. `folder` inside `root`) | [optional] | +| **can_change_privacy** | **Boolean** | Whether the current user can change the privacy of this resource (e.g. to share as `organizationPublic` or unshare it with `private`) | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceCapabilities.new( + can_edit: null, + can_add_resources: null, + can_add_folders: null, + can_change_privacy: null +) +``` + diff --git a/docs/reference/EduResourceCopy.md b/docs/reference/EduResourceCopy.md new file mode 100644 index 0000000..21205d4 --- /dev/null +++ b/docs/reference/EduResourceCopy.md @@ -0,0 +1,18 @@ +# FlatApi::EduResourceCopy + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **destination** | **String** | 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. | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceCopy.new( + destination: null +) +``` + diff --git a/docs/reference/EduResourceCreation.md b/docs/reference/EduResourceCreation.md new file mode 100644 index 0000000..808af0e --- /dev/null +++ b/docs/reference/EduResourceCreation.md @@ -0,0 +1,28 @@ +# FlatApi::EduResourceCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | [**EduResourceType**](EduResourceType.md) | | | +| **title** | **String** | Title of the resource | | +| **parent** | **String** | Identifier of the parent resource where the new one will created, e.g. a folder id or `root` | [optional][default to 'root'] | +| **sharing_description** | **String** | Sharing description of the resource | [optional] | +| **sharing_description_html** | **String** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceCreation.new( + type: null, + title: null, + parent: null, + sharing_description: null, + sharing_description_html: null, + resource: null +) +``` + diff --git a/docs/reference/EduResourceFolder.md b/docs/reference/EduResourceFolder.md new file mode 100644 index 0000000..3c0cce5 --- /dev/null +++ b/docs/reference/EduResourceFolder.md @@ -0,0 +1,22 @@ +# FlatApi::EduResourceFolder + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | Title of the folder | [optional] | +| **assignments_types** | [**Array<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 + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceFolder.new( + title: null, + assignments_types: null, + resources_count: null +) +``` + diff --git a/docs/reference/EduResourceLtiLink.md b/docs/reference/EduResourceLtiLink.md new file mode 100644 index 0000000..9719d33 --- /dev/null +++ b/docs/reference/EduResourceLtiLink.md @@ -0,0 +1,18 @@ +# FlatApi::EduResourceLtiLink + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lti_url** | **String** | An URL that can be used to launch LTI with this resource in a classroom. | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceLtiLink.new( + lti_url: null +) +``` + diff --git a/docs/reference/EduResourceMove.md b/docs/reference/EduResourceMove.md new file mode 100644 index 0000000..3f2d185 --- /dev/null +++ b/docs/reference/EduResourceMove.md @@ -0,0 +1,18 @@ +# FlatApi::EduResourceMove + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **destination** | **String** | 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. | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceMove.new( + destination: null +) +``` + diff --git a/docs/reference/EduResourcePrivacy.md b/docs/reference/EduResourcePrivacy.md new file mode 100644 index 0000000..86e0432 --- /dev/null +++ b/docs/reference/EduResourcePrivacy.md @@ -0,0 +1,15 @@ +# FlatApi::EduResourcePrivacy + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourcePrivacy.new() +``` + diff --git a/docs/reference/EduResourceResource.md b/docs/reference/EduResourceResource.md new file mode 100644 index 0000000..7be8317 --- /dev/null +++ b/docs/reference/EduResourceResource.md @@ -0,0 +1,49 @@ +# FlatApi::EduResourceResource + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::EduResourceResource.openapi_one_of +# => +# [ +# :'Assignment', +# :'EduResourceFolder' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::EduResourceResource.build(data) +# => # + +FlatApi::EduResourceResource.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Assignment` +- `EduResourceFolder` +- `nil` (if no type matches) + diff --git a/docs/reference/EduResourceType.md b/docs/reference/EduResourceType.md new file mode 100644 index 0000000..7c5bbb2 --- /dev/null +++ b/docs/reference/EduResourceType.md @@ -0,0 +1,15 @@ +# FlatApi::EduResourceType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceType.new() +``` + diff --git a/docs/reference/EduResourceUpdate.md b/docs/reference/EduResourceUpdate.md new file mode 100644 index 0000000..65e6e9e --- /dev/null +++ b/docs/reference/EduResourceUpdate.md @@ -0,0 +1,28 @@ +# FlatApi::EduResourceUpdate + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | Title of the resource | [optional] | +| **sharing_description** | **String** | Sharing description of the resource | [optional] | +| **sharing_description_html** | **String** | 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 'private'] | +| **subjects** | [**Array<TeachingTheme>**](TeachingTheme.md) | The subjects of this resource, or the subjects of the resources included in the folder | [optional] | +| **grades** | [**Array<Grade>**](Grade.md) | The grades of this resource, or the grades of the resources included in the folder. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceUpdate.new( + title: null, + sharing_description: null, + sharing_description_html: null, + privacy: null, + subjects: null, + grades: null +) +``` + diff --git a/docs/reference/EduResourceUseInClass.md b/docs/reference/EduResourceUseInClass.md new file mode 100644 index 0000000..054be44 --- /dev/null +++ b/docs/reference/EduResourceUseInClass.md @@ -0,0 +1,20 @@ +# FlatApi::EduResourceUseInClass + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **classroom** | **String** | The destination classroom where the resource will be copied. | | +| **assignment** | **String** | An optional destination assignment where the original assignement will be copied. Must be a draft. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::EduResourceUseInClass.new( + classroom: null, + assignment: null +) +``` + diff --git a/docs/reference/EduResourcesApi.md b/docs/reference/EduResourcesApi.md new file mode 100644 index 0000000..af163f6 --- /dev/null +++ b/docs/reference/EduResourcesApi.md @@ -0,0 +1,859 @@ +# FlatApi::EduResourcesApi + +All URIs are relative to *https://api.flat.io/v2* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**copy_edu_resource**](EduResourcesApi.md#copy_edu_resource) | **POST** /eduResources/{resource}/copy | Copy an education resource to a Resource Library | +| [**copy_edu_resource_to_demo_class**](EduResourcesApi.md#copy_edu_resource_to_demo_class) | **POST** /eduResources/{resource}/copyToDemoClass | Copy an education assignment to a teacher demo class | +| [**create_edu_resource**](EduResourcesApi.md#create_edu_resource) | **POST** /eduResources | Create a new education resource | +| [**create_edu_resource_lti_link**](EduResourcesApi.md#create_edu_resource_lti_link) | **POST** /eduResources/{resource}/createLtiLink | Create an LTI link for an education resource | +| [**delete_edu_resource**](EduResourcesApi.md#delete_edu_resource) | **DELETE** /eduResources/{resource} | Delete an education resource | +| [**get_edu_resource**](EduResourcesApi.md#get_edu_resource) | **GET** /eduResources/{resource} | Get an education resource | +| [**list_edu_libraries**](EduResourcesApi.md#list_edu_libraries) | **GET** /eduResources/libraries | List the education libraries | +| [**list_edu_resources**](EduResourcesApi.md#list_edu_resources) | **GET** /eduResources | List education resources in a library or folder | +| [**move_edu_resource**](EduResourcesApi.md#move_edu_resource) | **POST** /eduResources/{resource}/move | Move an education resource | +| [**update_edu_resource**](EduResourcesApi.md#update_edu_resource) | **PUT** /eduResources/{resource} | Update an education resource metadata | +| [**update_edu_resource_assignment**](EduResourcesApi.md#update_edu_resource_assignment) | **PUT** /eduResources/{resource}/assignment | Update an education resource assignment | +| [**use_edu_resource_in_class**](EduResourcesApi.md#use_edu_resource_in_class) | **POST** /eduResources/{resource}/useInClass | Use an education resource in a class | + + +## copy_edu_resource + +> copy_edu_resource(resource, edu_resource_copy) + +Copy an education resource to a Resource Library + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +resource = 'resource_example' # String | Unique identifier of the resource +edu_resource_copy = FlatApi::EduResourceCopy.new({destination: 'destination_example'}) # EduResourceCopy | + +begin + # Copy an education resource to a Resource Library + result = api_instance.copy_edu_resource(resource, edu_resource_copy) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->copy_edu_resource: #{e}" +end +``` + +#### Using the copy_edu_resource_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> copy_edu_resource_with_http_info(resource, edu_resource_copy) + +```ruby +begin + # Copy an education resource to a Resource Library + data, status_code, headers = api_instance.copy_edu_resource_with_http_info(resource, edu_resource_copy) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->copy_edu_resource_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource** | **String** | Unique identifier of the resource | | +| **edu_resource_copy** | [**EduResourceCopy**](EduResourceCopy.md) | | | + +### Return type + +[**EduResource**](EduResource.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## copy_edu_resource_to_demo_class + +> copy_edu_resource_to_demo_class(resource) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +resource = 'resource_example' # String | Unique identifier of the resource + +begin + # Copy an education assignment to a teacher demo class + result = api_instance.copy_edu_resource_to_demo_class(resource) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->copy_edu_resource_to_demo_class: #{e}" +end +``` + +#### Using the copy_edu_resource_to_demo_class_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> copy_edu_resource_to_demo_class_with_http_info(resource) + +```ruby +begin + # Copy an education assignment to a teacher demo class + data, status_code, headers = api_instance.copy_edu_resource_to_demo_class_with_http_info(resource) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->copy_edu_resource_to_demo_class_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource** | **String** | Unique identifier of the resource | | + +### Return type + +[**ClassAssignment**](ClassAssignment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## create_edu_resource + +> create_edu_resource(edu_resource_creation) + +Create a new education resource + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +edu_resource_creation = FlatApi::EduResourceCreation.new({type: FlatApi::EduResourceType::ASSIGNMENT, title: 'title_example'}) # EduResourceCreation | + +begin + # Create a new education resource + result = api_instance.create_edu_resource(edu_resource_creation) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->create_edu_resource: #{e}" +end +``` + +#### Using the create_edu_resource_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_edu_resource_with_http_info(edu_resource_creation) + +```ruby +begin + # Create a new education resource + data, status_code, headers = api_instance.create_edu_resource_with_http_info(edu_resource_creation) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->create_edu_resource_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **edu_resource_creation** | [**EduResourceCreation**](EduResourceCreation.md) | | | + +### Return type + +[**EduResource**](EduResource.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_edu_resource_lti_link + +> create_edu_resource_lti_link(resource) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +resource = 'resource_example' # String | Unique identifier of the resource + +begin + # Create an LTI link for an education resource + result = api_instance.create_edu_resource_lti_link(resource) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->create_edu_resource_lti_link: #{e}" +end +``` + +#### Using the create_edu_resource_lti_link_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_edu_resource_lti_link_with_http_info(resource) + +```ruby +begin + # Create an LTI link for an education resource + data, status_code, headers = api_instance.create_edu_resource_lti_link_with_http_info(resource) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->create_edu_resource_lti_link_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource** | **String** | Unique identifier of the resource | | + +### Return type + +[**EduResourceLtiLink**](EduResourceLtiLink.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_edu_resource + +> delete_edu_resource(resource) + +Delete an education resource + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +resource = 'resource_example' # String | Unique identifier of the resource + +begin + # Delete an education resource + api_instance.delete_edu_resource(resource) +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->delete_edu_resource: #{e}" +end +``` + +#### Using the delete_edu_resource_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_edu_resource_with_http_info(resource) + +```ruby +begin + # Delete an education resource + data, status_code, headers = api_instance.delete_edu_resource_with_http_info(resource) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->delete_edu_resource_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource** | **String** | Unique identifier of the resource | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_edu_resource + +> get_edu_resource(resource) + +Get an education resource + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +resource = 'resource_example' # String | Unique identifier of the resource + +begin + # Get an education resource + result = api_instance.get_edu_resource(resource) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->get_edu_resource: #{e}" +end +``` + +#### Using the get_edu_resource_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_edu_resource_with_http_info(resource) + +```ruby +begin + # Get an education resource + data, status_code, headers = api_instance.get_edu_resource_with_http_info(resource) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->get_edu_resource_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource** | **String** | Unique identifier of the resource | | + +### Return type + +[**EduResource**](EduResource.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_edu_libraries + +> > list_edu_libraries + +List the education libraries + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new + +begin + # List the education libraries + result = api_instance.list_edu_libraries + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->list_edu_libraries: #{e}" +end +``` + +#### Using the list_edu_libraries_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_edu_libraries_with_http_info + +```ruby +begin + # List the education libraries + data, status_code, headers = api_instance.list_edu_libraries_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->list_edu_libraries_with_http_info: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Array<EduLibrary>**](EduLibrary.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_edu_resources + +> > list_edu_resources(opts) + +List education resources in a library or folder + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +opts = { + parent: 'parent_example', # String | 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 + without_subfolders_resources: true, # Boolean | 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: 'assignment', # String | Filter the returned resources by type + subjects: [FlatApi::TeachingTheme::COMPOSITION], # Array | Filter the returned resources by subjects + assignment_types: [FlatApi::AssignmentType::NONE], # Array | Filter the returned resources by assignment types + grades: [FlatApi::Grade::N1], # Array | Filter the returned resources by grades + sort: 'creationDate', # String | Sort + direction: 'asc', # String | Sort direction + limit: 56, # Integer | This is the maximum number of resources that may be returned + _next: '_next_example', # String | 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. + previous: 'previous_example' # String | 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. +} + +begin + # List education resources in a library or folder + result = api_instance.list_edu_resources(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->list_edu_resources: #{e}" +end +``` + +#### Using the list_edu_resources_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_edu_resources_with_http_info(opts) + +```ruby +begin + # List education resources in a library or folder + data, status_code, headers = api_instance.list_edu_resources_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->list_edu_resources_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **parent** | **String** | 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** | **Boolean** | 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** | **String** | Filter the returned resources by type | [optional] | +| **subjects** | [**Array<TeachingTheme>**](TeachingTheme.md) | Filter the returned resources by subjects | [optional] | +| **assignment_types** | [**Array<AssignmentType>**](AssignmentType.md) | Filter the returned resources by assignment types | [optional] | +| **grades** | [**Array<Grade>**](Grade.md) | Filter the returned resources by grades | [optional] | +| **sort** | **String** | Sort | [optional][default to 'creationDate'] | +| **direction** | **String** | Sort direction | [optional] | +| **limit** | **Integer** | This is the maximum number of resources that may be returned | [optional][default to 25] | +| **_next** | **String** | 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** | **String** | 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 + +[**Array<EduResource>**](EduResource.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## move_edu_resource + +> move_edu_resource(resource, edu_resource_move) + +Move an education resource + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +resource = 'resource_example' # String | Unique identifier of the resource +edu_resource_move = FlatApi::EduResourceMove.new({destination: 'destination_example'}) # EduResourceMove | + +begin + # Move an education resource + result = api_instance.move_edu_resource(resource, edu_resource_move) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->move_edu_resource: #{e}" +end +``` + +#### Using the move_edu_resource_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> move_edu_resource_with_http_info(resource, edu_resource_move) + +```ruby +begin + # Move an education resource + data, status_code, headers = api_instance.move_edu_resource_with_http_info(resource, edu_resource_move) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->move_edu_resource_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource** | **String** | Unique identifier of the resource | | +| **edu_resource_move** | [**EduResourceMove**](EduResourceMove.md) | | | + +### Return type + +[**EduResource**](EduResource.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_edu_resource + +> update_edu_resource(resource, edu_resource_update) + +Update an education resource metadata + +Update any resources metadata (e.g. title). Use this method to rename education resources folders or assignments. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +resource = 'resource_example' # String | Unique identifier of the resource +edu_resource_update = FlatApi::EduResourceUpdate.new # EduResourceUpdate | + +begin + # Update an education resource metadata + result = api_instance.update_edu_resource(resource, edu_resource_update) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->update_edu_resource: #{e}" +end +``` + +#### Using the update_edu_resource_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_edu_resource_with_http_info(resource, edu_resource_update) + +```ruby +begin + # Update an education resource metadata + data, status_code, headers = api_instance.update_edu_resource_with_http_info(resource, edu_resource_update) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->update_edu_resource_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource** | **String** | Unique identifier of the resource | | +| **edu_resource_update** | [**EduResourceUpdate**](EduResourceUpdate.md) | | | + +### Return type + +[**EduResource**](EduResource.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_edu_resource_assignment + +> update_edu_resource_assignment(resource, assignment_update) + +Update an education resource assignment + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +resource = 'resource_example' # String | Unique identifier of the resource +assignment_update = FlatApi::AssignmentUpdate.new # AssignmentUpdate | + +begin + # Update an education resource assignment + result = api_instance.update_edu_resource_assignment(resource, assignment_update) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->update_edu_resource_assignment: #{e}" +end +``` + +#### Using the update_edu_resource_assignment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_edu_resource_assignment_with_http_info(resource, assignment_update) + +```ruby +begin + # Update an education resource assignment + data, status_code, headers = api_instance.update_edu_resource_assignment_with_http_info(resource, assignment_update) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->update_edu_resource_assignment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource** | **String** | Unique identifier of the resource | | +| **assignment_update** | [**AssignmentUpdate**](AssignmentUpdate.md) | | | + +### Return type + +[**Assignment**](Assignment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## use_edu_resource_in_class + +> use_edu_resource_in_class(resource, edu_resource_use_in_class) + +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.). + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::EduResourcesApi.new +resource = 'resource_example' # String | Unique identifier of the resource +edu_resource_use_in_class = FlatApi::EduResourceUseInClass.new({classroom: 'classroom_example'}) # EduResourceUseInClass | + +begin + # Use an education resource in a class + result = api_instance.use_edu_resource_in_class(resource, edu_resource_use_in_class) + p result +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->use_edu_resource_in_class: #{e}" +end +``` + +#### Using the use_edu_resource_in_class_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> use_edu_resource_in_class_with_http_info(resource, edu_resource_use_in_class) + +```ruby +begin + # Use an education resource in a class + data, status_code, headers = api_instance.use_edu_resource_in_class_with_http_info(resource, edu_resource_use_in_class) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling EduResourcesApi->use_edu_resource_in_class_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource** | **String** | Unique identifier of the resource | | +| **edu_resource_use_in_class** | [**EduResourceUseInClass**](EduResourceUseInClass.md) | | | + +### Return type + +[**ClassAssignment**](ClassAssignment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/reference/FlatErrorResponse.md b/docs/reference/FlatErrorResponse.md new file mode 100644 index 0000000..1aacb30 --- /dev/null +++ b/docs/reference/FlatErrorResponse.md @@ -0,0 +1,26 @@ +# FlatApi::FlatErrorResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **String** | A corresponding code for this error | | +| **message** | **String** | A printable message for this error | | +| **id** | **String** | An unique error identifier generated for the request | [optional] | +| **param** | **String** | The related parameter that caused the error | [optional] | +| **provider_message** | **String** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::FlatErrorResponse.new( + code: null, + message: null, + id: null, + param: null, + provider_message: null +) +``` + diff --git a/docs/reference/GoogleClassroomCoursework.md b/docs/reference/GoogleClassroomCoursework.md new file mode 100644 index 0000000..c87b928 --- /dev/null +++ b/docs/reference/GoogleClassroomCoursework.md @@ -0,0 +1,24 @@ +# FlatApi::GoogleClassroomCoursework + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Identifier of the coursework assigned by Classroom | [optional] | +| **state** | **String** | State of the coursework | [optional] | +| **alternate_link** | **String** | Absolute link to this coursework in the Classroom web UI | [optional] | +| **topic_id** | **String** | Identifier of the topic where the assignment is created | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::GoogleClassroomCoursework.new( + id: null, + state: null, + alternate_link: null, + topic_id: null +) +``` + diff --git a/docs/reference/GoogleClassroomSubmission.md b/docs/reference/GoogleClassroomSubmission.md new file mode 100644 index 0000000..bab7a16 --- /dev/null +++ b/docs/reference/GoogleClassroomSubmission.md @@ -0,0 +1,22 @@ +# FlatApi::GoogleClassroomSubmission + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Identifier of the coursework submission assigned by Classroom | | +| **state** | **String** | State of the submission on Google Classroom | | +| **alternate_link** | **String** | Absolute link to this coursework in the Classroom web UI | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::GoogleClassroomSubmission.new( + id: null, + state: null, + alternate_link: null +) +``` + diff --git a/docs/reference/Grade.md b/docs/reference/Grade.md new file mode 100644 index 0000000..0675ac7 --- /dev/null +++ b/docs/reference/Grade.md @@ -0,0 +1,15 @@ +# FlatApi::Grade + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::Grade.new() +``` + diff --git a/docs/reference/Group.md b/docs/reference/Group.md new file mode 100644 index 0000000..8f9a02e --- /dev/null +++ b/docs/reference/Group.md @@ -0,0 +1,30 @@ +# FlatApi::Group + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the group | [optional] | +| **name** | **String** | The display name of the group | [optional] | +| **type** | [**GroupType**](GroupType.md) | | [optional] | +| **users_count** | **Float** | The number of users in this group | [optional] | +| **read_only** | **Boolean** | `True` if the group is set in read-only | [optional] | +| **organization** | **String** | If the group is related to an organization, this field will contain the unique identifier of the organization | [optional] | +| **creation_date** | **Time** | The creation date of the group | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::Group.new( + id: null, + name: null, + type: null, + users_count: null, + read_only: null, + organization: null, + creation_date: null +) +``` + diff --git a/docs/reference/GroupApi.md b/docs/reference/GroupApi.md new file mode 100644 index 0000000..c8a5811 --- /dev/null +++ b/docs/reference/GroupApi.md @@ -0,0 +1,651 @@ +# FlatApi::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 + +> 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) + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::GroupApi.new +group = 'group_example' # String | Unique identifier of a Flat group +add_group_user_request = FlatApi::AddGroupUserRequest.new({user: 'user_example'}) # AddGroupUserRequest | + +begin + # Add a student to a group + result = api_instance.add_group_user(group, add_group_user_request) + p result +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->add_group_user: #{e}" +end +``` + +#### Using the add_group_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> add_group_user_with_http_info(group, add_group_user_request) + +```ruby +begin + # Add a student to a group + data, status_code, headers = api_instance.add_group_user_with_http_info(group, add_group_user_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->add_group_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **group** | **String** | 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 + + +## create_group + +> create_group(group_creation) + +Create a new group + +Create a group of the given type, tied to a classroom, optionally with initial members. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::GroupApi.new +group_creation = FlatApi::GroupCreation.new({type: 'classStudentsSubGroup', classroom: 'classroom_example'}) # GroupCreation | + +begin + # Create a new group + result = api_instance.create_group(group_creation) + p result +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->create_group: #{e}" +end +``` + +#### Using the create_group_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_group_with_http_info(group_creation) + +```ruby +begin + # Create a new group + data, status_code, headers = api_instance.create_group_with_http_info(group_creation) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->create_group_with_http_info: #{e}" +end +``` + +### 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 + + +## delete_group + +> delete_group(group) + +Delete a group + +Delete a group. Only available to teachers of the classroom. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::GroupApi.new +group = 'group_example' # String | Unique identifier of a Flat group + +begin + # Delete a group + api_instance.delete_group(group) +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->delete_group: #{e}" +end +``` + +#### Using the delete_group_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_group_with_http_info(group) + +```ruby +begin + # Delete a group + data, status_code, headers = api_instance.delete_group_with_http_info(group) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->delete_group_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **group** | **String** | Unique identifier of a Flat group | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_group_details + +> get_group_details(group) + +Get group information + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::GroupApi.new +group = 'group_example' # String | Unique identifier of a Flat group + +begin + # Get group information + result = api_instance.get_group_details(group) + p result +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->get_group_details: #{e}" +end +``` + +#### Using the get_group_details_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_group_details_with_http_info(group) + +```ruby +begin + # Get group information + data, status_code, headers = api_instance.get_group_details_with_http_info(group) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->get_group_details_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **group** | **String** | 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 + + +## get_group_scores + +> > get_group_scores(group, opts) + +List group's scores + +Get the list of scores shared with a group. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::GroupApi.new +group = 'group_example' # String | Unique identifier of a Flat group +opts = { + parent: 'parent_example' # String | Filter the score forked from the score id `parent` +} + +begin + # List group's scores + result = api_instance.get_group_scores(group, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->get_group_scores: #{e}" +end +``` + +#### Using the get_group_scores_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_group_scores_with_http_info(group, opts) + +```ruby +begin + # List group's scores + data, status_code, headers = api_instance.get_group_scores_with_http_info(group, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->get_group_scores_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **group** | **String** | Unique identifier of a Flat group | | +| **parent** | **String** | Filter the score forked from the score id `parent` | [optional] | + +### Return type + +[**Array<ScoreDetails>**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_group_users + +> > list_group_users(group, opts) + +List group's users + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::GroupApi.new +group = 'group_example' # String | Unique identifier of a Flat group +opts = { + source: 'googleClassroom' # String | Filter the users by their source +} + +begin + # List group's users + result = api_instance.list_group_users(group, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->list_group_users: #{e}" +end +``` + +#### Using the list_group_users_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_group_users_with_http_info(group, opts) + +```ruby +begin + # List group's users + data, status_code, headers = api_instance.list_group_users_with_http_info(group, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->list_group_users_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **group** | **String** | Unique identifier of a Flat group | | +| **source** | **String** | Filter the users by their source | [optional] | + +### Return type + +[**Array<UserPublic>**](UserPublic.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_groups + +> > list_groups(type, opts) + +List groups + +List all groups of a given type, filtered by either a classroom or an assignment. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::GroupApi.new +type = 'classStudentsSubGroup' # String | +opts = { + classroom: 'classroom_example', # String | Classroom ID to filter by + assignment: 'assignment_example' # String | Assignment ID to filter by +} + +begin + # List groups + result = api_instance.list_groups(type, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->list_groups: #{e}" +end +``` + +#### Using the list_groups_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_groups_with_http_info(type, opts) + +```ruby +begin + # List groups + data, status_code, headers = api_instance.list_groups_with_http_info(type, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->list_groups_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | | +| **classroom** | **String** | Classroom ID to filter by | [optional] | +| **assignment** | **String** | Assignment ID to filter by | [optional] | + +### Return type + +[**Array<GroupDetails>**](GroupDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## remove_group_user + +> remove_group_user(group, user) + +Remove a student from a class group + +Remove a student from a class group + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::GroupApi.new +group = 'group_example' # String | Unique identifier of a Flat group +user = 'user_example' # String | User ID + +begin + # Remove a student from a class group + api_instance.remove_group_user(group, user) +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->remove_group_user: #{e}" +end +``` + +#### Using the remove_group_user_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> remove_group_user_with_http_info(group, user) + +```ruby +begin + # Remove a student from a class group + data, status_code, headers = api_instance.remove_group_user_with_http_info(group, user) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->remove_group_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **group** | **String** | Unique identifier of a Flat group | | +| **user** | **String** | User ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## rename_group + +> rename_group(group, rename_group_request) + +Rename a group + +Rename a sub-group. Only available for class student groups. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::GroupApi.new +group = 'group_example' # String | Unique identifier of a Flat group +rename_group_request = FlatApi::RenameGroupRequest.new({name: 'name_example'}) # RenameGroupRequest | + +begin + # Rename a group + result = api_instance.rename_group(group, rename_group_request) + p result +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->rename_group: #{e}" +end +``` + +#### Using the rename_group_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> rename_group_with_http_info(group, rename_group_request) + +```ruby +begin + # Rename a group + data, status_code, headers = api_instance.rename_group_with_http_info(group, rename_group_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling GroupApi->rename_group_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **group** | **String** | 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 + diff --git a/docs/reference/GroupCreation.md b/docs/reference/GroupCreation.md new file mode 100644 index 0000000..d1fabe4 --- /dev/null +++ b/docs/reference/GroupCreation.md @@ -0,0 +1,24 @@ +# FlatApi::GroupCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Type of group (currently only classStudentsSubGroup is supported) | | +| **classroom** | **String** | Classroom ID | | +| **name** | **String** | 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** | **Array<String>** | Array of student IDs to add to the group | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::GroupCreation.new( + type: null, + classroom: null, + name: null, + members: null +) +``` + diff --git a/docs/reference/GroupDetails.md b/docs/reference/GroupDetails.md new file mode 100644 index 0000000..ddbabc0 --- /dev/null +++ b/docs/reference/GroupDetails.md @@ -0,0 +1,38 @@ +# FlatApi::GroupDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the group | | +| **name** | **String** | The displayable name of the group | | +| **type** | [**GroupType**](GroupType.md) | | | +| **organization** | **String** | The unique identifier of the Organization owning the group | [optional] | +| **classroom** | **String** | The unique identifier of the classroom owning the group. Only available for groups of type 'classromStudentsSubGroup' or 'assignmentStudentsSubGroup' | [optional] | +| **assignment** | **String** | The unique identifier of the assignment owning the group. Only available for groups of type 'assignmentStudentsSubGroup'. | [optional] | +| **parent** | **String** | 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** | **Time** | The date when the group was create | | +| **users_count** | **Float** | The number of students in this group | | +| **read_only** | **Boolean** | `true` if the properties and members of this group are in in read-only | | +| **tags** | **Array<String>** | Tags for categorizing groups. * `edu:testing-students`: Marks this group as containing test student accounts | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::GroupDetails.new( + id: null, + name: null, + type: null, + organization: null, + classroom: null, + assignment: null, + parent: null, + creation_date: null, + users_count: null, + read_only: null, + tags: null +) +``` + diff --git a/docs/reference/GroupType.md b/docs/reference/GroupType.md new file mode 100644 index 0000000..af29a15 --- /dev/null +++ b/docs/reference/GroupType.md @@ -0,0 +1,15 @@ +# FlatApi::GroupType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::GroupType.new() +``` + diff --git a/docs/reference/LicenseMode.md b/docs/reference/LicenseMode.md new file mode 100644 index 0000000..22a2fcf --- /dev/null +++ b/docs/reference/LicenseMode.md @@ -0,0 +1,15 @@ +# FlatApi::LicenseMode + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LicenseMode.new() +``` + diff --git a/docs/reference/LicenseSources.md b/docs/reference/LicenseSources.md new file mode 100644 index 0000000..4093379 --- /dev/null +++ b/docs/reference/LicenseSources.md @@ -0,0 +1,15 @@ +# FlatApi::LicenseSources + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LicenseSources.new() +``` + diff --git a/docs/reference/LmsName.md b/docs/reference/LmsName.md new file mode 100644 index 0000000..51baf74 --- /dev/null +++ b/docs/reference/LmsName.md @@ -0,0 +1,15 @@ +# FlatApi::LmsName + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LmsName.new() +``` + diff --git a/docs/reference/LtiConfiguration.md b/docs/reference/LtiConfiguration.md new file mode 100644 index 0000000..7fae7d0 --- /dev/null +++ b/docs/reference/LtiConfiguration.md @@ -0,0 +1,79 @@ +# FlatApi::LtiConfiguration + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfiguration.openapi_one_of +# => +# [ +# :'LtiConfiguration1p1', +# :'LtiConfiguration1p3' +# ] +``` + +### `openapi_discriminator_name` + +Returns the discriminator's property name. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfiguration.openapi_discriminator_name +# => :'lti_version' +``` + +### `openapi_discriminator_name` + +Returns the discriminator's mapping. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfiguration.openapi_discriminator_mapping +# => +# { +# :'1p1' => :'LtiConfiguration1p1', +# :'1p3' => :'LtiConfiguration1p3' +# } +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfiguration.build(data) +# => # + +FlatApi::LtiConfiguration.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `LtiConfiguration1p1` +- `LtiConfiguration1p3` +- `nil` (if no type matches) + diff --git a/docs/reference/LtiConfiguration1p1.md b/docs/reference/LtiConfiguration1p1.md new file mode 100644 index 0000000..c2ba765 --- /dev/null +++ b/docs/reference/LtiConfiguration1p1.md @@ -0,0 +1,42 @@ +# FlatApi::LtiConfiguration1p1 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Configuration ID | | +| **lti_version** | **String** | LTI version (1.1) | | +| **organization_id** | **String** | Organization ID | [optional] | +| **organization_name** | **String** | Organization name | [optional] | +| **creator_id** | **String** | ID of the user who created this configuration | [optional] | +| **creation_date** | **Time** | Configuration creation date | | +| **last_used_date** | **Time** | Last time this configuration was used | [optional] | +| **status** | **String** | Configuration status indicator | [optional] | +| **consumer_key** | **String** | LTI 1.1 consumer key | [optional] | +| **consumer_secret** | **String** | LTI 1.1 consumer secret (only included for admins) | [optional] | +| **lms** | **String** | LMS type | [optional] | +| **name** | **String** | Configuration name | [optional] | +| **tool** | [**LtiConfiguration1p1AllOfTool**](LtiConfiguration1p1AllOfTool.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p1.new( + id: null, + lti_version: null, + organization_id: null, + organization_name: null, + creator_id: null, + creation_date: null, + last_used_date: null, + status: null, + consumer_key: null, + consumer_secret: null, + lms: null, + name: null, + tool: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p1AllOfTool.md b/docs/reference/LtiConfiguration1p1AllOfTool.md new file mode 100644 index 0000000..3202c67 --- /dev/null +++ b/docs/reference/LtiConfiguration1p1AllOfTool.md @@ -0,0 +1,28 @@ +# FlatApi::LtiConfiguration1p1AllOfTool + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **product** | **String** | Product family code (e.g., canvas, moodle, schoology) | [optional] | +| **version** | **String** | Platform version string | [optional] | +| **instance_name** | **String** | Instance display name | [optional] | +| **instance_guid** | **String** | Unique instance identifier | [optional] | +| **instance_contact** | **String** | Contact email or handle for the instance | [optional] | +| **instance_domain** | **String** | Instance root domain | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p1AllOfTool.new( + product: null, + version: null, + instance_name: null, + instance_guid: null, + instance_contact: null, + instance_domain: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p3.md b/docs/reference/LtiConfiguration1p3.md new file mode 100644 index 0000000..d9c7494 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3.md @@ -0,0 +1,51 @@ +# FlatApi::LtiConfiguration1p3 + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfiguration1p3.openapi_one_of +# => +# [ +# :'LtiConfiguration1p3Deployment', +# :'LtiConfiguration1p3Dynamic', +# :'LtiConfiguration1p3Manual' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfiguration1p3.build(data) +# => # + +FlatApi::LtiConfiguration1p3.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `LtiConfiguration1p3Deployment` +- `LtiConfiguration1p3Dynamic` +- `LtiConfiguration1p3Manual` +- `nil` (if no type matches) + diff --git a/docs/reference/LtiConfiguration1p3Base.md b/docs/reference/LtiConfiguration1p3Base.md new file mode 100644 index 0000000..46d99e4 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3Base.md @@ -0,0 +1,46 @@ +# FlatApi::LtiConfiguration1p3Base + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **mode** | **String** | LTI 1.3 configuration mode | [optional] | +| **platform_iss** | **String** | Platform issuer URL | [optional] | +| **platform_name** | **String** | Platform display name | [optional] | +| **client_id** | **String** | OAuth2 client_id allocated by the platform | [optional] | +| **deployment_id** | **String** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] | +| **access_token_url** | **String** | OAuth2 token endpoint (for AGS/NRPS) | [optional] | +| **authorization_url** | **String** | OIDC authorization/login endpoint | [optional] | +| **jwks_url** | **String** | Platform JWKS endpoint (public keys) | [optional] | +| **deployment_mode** | **String** | 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** | **String** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] | +| **initiate_login_url** | **String** | URL for the platform to initiate LTI login | [optional] | +| **redirect_uris** | **Array<String>** | Allowed redirect URIs for LTI launches | [optional] | +| **enable_email_matching** | **Boolean** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p3Base.new( + mode: null, + platform_iss: null, + platform_name: null, + client_id: null, + deployment_id: null, + access_token_url: null, + authorization_url: null, + jwks_url: null, + deployment_mode: null, + supported_services: null, + tool: null, + public_keyset_url: null, + initiate_login_url: null, + redirect_uris: null, + enable_email_matching: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p3BaseSupportedServices.md b/docs/reference/LtiConfiguration1p3BaseSupportedServices.md new file mode 100644 index 0000000..a4c21d3 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseSupportedServices.md @@ -0,0 +1,22 @@ +# FlatApi::LtiConfiguration1p3BaseSupportedServices + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ags** | [**LtiConfiguration1p3BaseSupportedServicesAgs**](LtiConfiguration1p3BaseSupportedServicesAgs.md) | | [optional] | +| **nrps** | [**LtiConfiguration1p3BaseSupportedServicesNrps**](LtiConfiguration1p3BaseSupportedServicesNrps.md) | | [optional] | +| **deep_linking** | [**LtiConfiguration1p3BaseSupportedServicesDeepLinking**](LtiConfiguration1p3BaseSupportedServicesDeepLinking.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p3BaseSupportedServices.new( + ags: null, + nrps: null, + deep_linking: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p3BaseSupportedServicesAgs.md b/docs/reference/LtiConfiguration1p3BaseSupportedServicesAgs.md new file mode 100644 index 0000000..8135f45 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseSupportedServicesAgs.md @@ -0,0 +1,24 @@ +# FlatApi::LtiConfiguration1p3BaseSupportedServicesAgs + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **available** | **Boolean** | Whether AGS claims were detected in launches from this platform | [optional] | +| **version** | **String** | AGS version supported (e.g., \"2.0\") | [optional] | +| **enabled** | **Boolean** | Whether we have AGS enabled for this platform | [optional] | +| **lineitems_url** | **String** | Base URL for line items operations as provided by the platform | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p3BaseSupportedServicesAgs.new( + available: null, + version: null, + enabled: null, + lineitems_url: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p3BaseSupportedServicesDeepLinking.md b/docs/reference/LtiConfiguration1p3BaseSupportedServicesDeepLinking.md new file mode 100644 index 0000000..31b558d --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseSupportedServicesDeepLinking.md @@ -0,0 +1,20 @@ +# FlatApi::LtiConfiguration1p3BaseSupportedServicesDeepLinking + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **available** | **Boolean** | Whether Deep Linking claims were detected in launches from this platform | [optional] | +| **version** | **String** | Deep Linking version supported (e.g., \"2.0\") | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p3BaseSupportedServicesDeepLinking.new( + available: null, + version: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p3BaseSupportedServicesNrps.md b/docs/reference/LtiConfiguration1p3BaseSupportedServicesNrps.md new file mode 100644 index 0000000..9e65da7 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseSupportedServicesNrps.md @@ -0,0 +1,22 @@ +# FlatApi::LtiConfiguration1p3BaseSupportedServicesNrps + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **available** | **Boolean** | Whether NRPS claims were detected in launches from this platform | [optional] | +| **version** | **String** | NRPS version supported (e.g., \"2.0\") | [optional] | +| **enabled** | **Boolean** | Whether we have NRPS enabled for this platform | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p3BaseSupportedServicesNrps.new( + available: null, + version: null, + enabled: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p3BaseTool.md b/docs/reference/LtiConfiguration1p3BaseTool.md new file mode 100644 index 0000000..23d1529 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseTool.md @@ -0,0 +1,28 @@ +# FlatApi::LtiConfiguration1p3BaseTool + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **product** | **String** | Product family code (e.g., canvas, moodle, schoology) | [optional] | +| **version** | **String** | Platform version string | [optional] | +| **instance_name** | **String** | Instance name (e.g., 'My University Canvas') | [optional] | +| **instance_guid** | **String** | Unique instance identifier | [optional] | +| **instance_contact** | **String** | Contact email or handle for the instance | [optional] | +| **instance_domain** | **String** | Instance root domain | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p3BaseTool.new( + product: null, + version: null, + instance_name: null, + instance_guid: null, + instance_contact: null, + instance_domain: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p3Deployment.md b/docs/reference/LtiConfiguration1p3Deployment.md new file mode 100644 index 0000000..ff9aa57 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3Deployment.md @@ -0,0 +1,70 @@ +# FlatApi::LtiConfiguration1p3Deployment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Configuration ID | | +| **lti_version** | **String** | LTI version (1.3) | | +| **organization_id** | **String** | Organization ID | [optional] | +| **organization_name** | **String** | Organization name | [optional] | +| **creator_id** | **String** | ID of the user who created this configuration | [optional] | +| **creation_date** | **Time** | Configuration creation date | | +| **last_used_date** | **Time** | Last time this configuration was used | [optional] | +| **status** | **String** | Configuration status indicator | [optional] | +| **mode** | **String** | Deployment-based LTI 1.3 configuration mode | [optional] | +| **platform_iss** | **String** | Platform issuer URL | [optional] | +| **platform_name** | **String** | Platform display name | [optional] | +| **client_id** | **String** | OAuth2 client_id allocated by the platform | [optional] | +| **deployment_id** | **String** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] | +| **access_token_url** | **String** | OAuth2 token endpoint (for AGS/NRPS) | [optional] | +| **authorization_url** | **String** | OIDC authorization/login endpoint | [optional] | +| **jwks_url** | **String** | Platform JWKS endpoint (public keys) | [optional] | +| **deployment_mode** | **String** | 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** | **String** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] | +| **initiate_login_url** | **String** | URL for the platform to initiate LTI login | [optional] | +| **redirect_uris** | **Array<String>** | Allowed redirect URIs for LTI launches | [optional] | +| **enable_email_matching** | **Boolean** | 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** | **String** | Parent configuration ID (for deployment-based configs) | [optional] | +| **deployment_key** | **String** | Deployment key (e.g., schoology, classlink) | [optional] | +| **deployment_breakdown_by** | **String** | Custom claim used for tenant identification (parent platforms only, read-only) | [optional] | +| **deployment_breakdown_id** | **String** | Value of the custom claim that identifies this specific tenant (child platforms only) | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p3Deployment.new( + id: null, + lti_version: null, + organization_id: null, + organization_name: null, + creator_id: null, + creation_date: null, + last_used_date: null, + status: null, + mode: null, + platform_iss: null, + platform_name: null, + client_id: null, + deployment_id: null, + access_token_url: null, + authorization_url: null, + jwks_url: null, + deployment_mode: null, + supported_services: null, + tool: null, + public_keyset_url: null, + initiate_login_url: null, + redirect_uris: null, + enable_email_matching: null, + parent_id: null, + deployment_key: null, + deployment_breakdown_by: null, + deployment_breakdown_id: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p3Dynamic.md b/docs/reference/LtiConfiguration1p3Dynamic.md new file mode 100644 index 0000000..aa3a507 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3Dynamic.md @@ -0,0 +1,70 @@ +# FlatApi::LtiConfiguration1p3Dynamic + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Configuration ID | | +| **lti_version** | **String** | LTI version (1.3) | | +| **organization_id** | **String** | Organization ID | [optional] | +| **organization_name** | **String** | Organization name | [optional] | +| **creator_id** | **String** | ID of the user who created this configuration | [optional] | +| **creation_date** | **Time** | Configuration creation date | | +| **last_used_date** | **Time** | Last time this configuration was used | [optional] | +| **status** | **String** | Configuration status indicator | [optional] | +| **mode** | **String** | Dynamic registration LTI 1.3 configuration mode | [optional] | +| **platform_iss** | **String** | Platform issuer URL | [optional] | +| **platform_name** | **String** | Platform display name | [optional] | +| **client_id** | **String** | OAuth2 client_id allocated by the platform | [optional] | +| **deployment_id** | **String** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] | +| **access_token_url** | **String** | OAuth2 token endpoint (for AGS/NRPS) | [optional] | +| **authorization_url** | **String** | OIDC authorization/login endpoint | [optional] | +| **jwks_url** | **String** | Platform JWKS endpoint (public keys) | [optional] | +| **deployment_mode** | **String** | 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** | **String** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] | +| **initiate_login_url** | **String** | URL for the platform to initiate LTI login | [optional] | +| **redirect_uris** | **Array<String>** | Allowed redirect URIs for LTI launches | [optional] | +| **enable_email_matching** | **Boolean** | 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** | **String** | Only included for admins | [optional] | +| **registration_url** | **String** | Dynamic registration URL (only included for admins when available) | [optional] | +| **registration_token_used** | **Boolean** | Whether dynamic registration token has been used | [optional] | +| **registration_completion_date** | **Time** | Date when dynamic registration completed (null when not completed) | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p3Dynamic.new( + id: null, + lti_version: null, + organization_id: null, + organization_name: null, + creator_id: null, + creation_date: null, + last_used_date: null, + status: null, + mode: null, + platform_iss: null, + platform_name: null, + client_id: null, + deployment_id: null, + access_token_url: null, + authorization_url: null, + jwks_url: null, + deployment_mode: null, + supported_services: null, + tool: null, + public_keyset_url: null, + initiate_login_url: null, + redirect_uris: null, + enable_email_matching: null, + registration_token: null, + registration_url: null, + registration_token_used: null, + registration_completion_date: null +) +``` + diff --git a/docs/reference/LtiConfiguration1p3Manual.md b/docs/reference/LtiConfiguration1p3Manual.md new file mode 100644 index 0000000..7633ae5 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3Manual.md @@ -0,0 +1,62 @@ +# FlatApi::LtiConfiguration1p3Manual + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Configuration ID | | +| **lti_version** | **String** | LTI version (1.3) | | +| **organization_id** | **String** | Organization ID | [optional] | +| **organization_name** | **String** | Organization name | [optional] | +| **creator_id** | **String** | ID of the user who created this configuration | [optional] | +| **creation_date** | **Time** | Configuration creation date | | +| **last_used_date** | **Time** | Last time this configuration was used | [optional] | +| **status** | **String** | Configuration status indicator | [optional] | +| **mode** | **String** | Manual LTI 1.3 configuration mode | [optional] | +| **platform_iss** | **String** | Platform issuer URL | [optional] | +| **platform_name** | **String** | Platform display name | [optional] | +| **client_id** | **String** | OAuth2 client_id allocated by the platform | [optional] | +| **deployment_id** | **String** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] | +| **access_token_url** | **String** | OAuth2 token endpoint (for AGS/NRPS) | [optional] | +| **authorization_url** | **String** | OIDC authorization/login endpoint | [optional] | +| **jwks_url** | **String** | Platform JWKS endpoint (public keys) | [optional] | +| **deployment_mode** | **String** | 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** | **String** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] | +| **initiate_login_url** | **String** | URL for the platform to initiate LTI login | [optional] | +| **redirect_uris** | **Array<String>** | Allowed redirect URIs for LTI launches | [optional] | +| **enable_email_matching** | **Boolean** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfiguration1p3Manual.new( + id: null, + lti_version: null, + organization_id: null, + organization_name: null, + creator_id: null, + creation_date: null, + last_used_date: null, + status: null, + mode: null, + platform_iss: null, + platform_name: null, + client_id: null, + deployment_id: null, + access_token_url: null, + authorization_url: null, + jwks_url: null, + deployment_mode: null, + supported_services: null, + tool: null, + public_keyset_url: null, + initiate_login_url: null, + redirect_uris: null, + enable_email_matching: null +) +``` + diff --git a/docs/reference/LtiConfigurationBase.md b/docs/reference/LtiConfigurationBase.md new file mode 100644 index 0000000..4d849f2 --- /dev/null +++ b/docs/reference/LtiConfigurationBase.md @@ -0,0 +1,32 @@ +# FlatApi::LtiConfigurationBase + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Configuration ID | | +| **lti_version** | **String** | LTI version | | +| **organization_id** | **String** | Organization ID | [optional] | +| **organization_name** | **String** | Organization name | [optional] | +| **creator_id** | **String** | ID of the user who created this configuration | [optional] | +| **creation_date** | **Time** | Configuration creation date | | +| **last_used_date** | **Time** | Last time this configuration was used | [optional] | +| **status** | **String** | Configuration status indicator | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfigurationBase.new( + id: null, + lti_version: null, + organization_id: null, + organization_name: null, + creator_id: null, + creation_date: null, + last_used_date: null, + status: null +) +``` + diff --git a/docs/reference/LtiConfigurationCreate.md b/docs/reference/LtiConfigurationCreate.md new file mode 100644 index 0000000..5bec8ad --- /dev/null +++ b/docs/reference/LtiConfigurationCreate.md @@ -0,0 +1,85 @@ +# FlatApi::LtiConfigurationCreate + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfigurationCreate.openapi_one_of +# => +# [ +# :'LtiConfigurationCreate1p1', +# :'LtiConfigurationCreate1p3Deployment', +# :'LtiConfigurationCreate1p3Dynamic', +# :'LtiConfigurationCreate1p3Manual' +# ] +``` + +### `openapi_discriminator_name` + +Returns the discriminator's property name. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfigurationCreate.openapi_discriminator_name +# => :'mode' +``` + +### `openapi_discriminator_name` + +Returns the discriminator's mapping. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfigurationCreate.openapi_discriminator_mapping +# => +# { +# :'1p1-manual' => :'LtiConfigurationCreate1p1', +# :'1p3-deployment' => :'LtiConfigurationCreate1p3Deployment', +# :'1p3-dynamic' => :'LtiConfigurationCreate1p3Dynamic', +# :'1p3-manual' => :'LtiConfigurationCreate1p3Manual' +# } +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::LtiConfigurationCreate.build(data) +# => # + +FlatApi::LtiConfigurationCreate.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `LtiConfigurationCreate1p1` +- `LtiConfigurationCreate1p3Deployment` +- `LtiConfigurationCreate1p3Dynamic` +- `LtiConfigurationCreate1p3Manual` +- `nil` (if no type matches) + diff --git a/docs/reference/LtiConfigurationCreate1p1.md b/docs/reference/LtiConfigurationCreate1p1.md new file mode 100644 index 0000000..acd52ec --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p1.md @@ -0,0 +1,22 @@ +# FlatApi::LtiConfigurationCreate1p1 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **mode** | **String** | LTI 1.1 manual creation mode | | +| **name** | **String** | Display name for LTI 1.1 credentials | [optional] | +| **lms** | **String** | LMS identifier for LTI 1.1 credentials | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfigurationCreate1p1.new( + mode: null, + name: null, + lms: null +) +``` + diff --git a/docs/reference/LtiConfigurationCreate1p3Deployment.md b/docs/reference/LtiConfigurationCreate1p3Deployment.md new file mode 100644 index 0000000..c505ac4 --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p3Deployment.md @@ -0,0 +1,26 @@ +# FlatApi::LtiConfigurationCreate1p3Deployment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **mode** | **String** | LTI 1.3 deployment-based creation mode | | +| **deployment_type** | **String** | Parent platform key (e.g., canvas, blackboard, schoology, classlink) | | +| **deployment_id** | **String** | Deployment identifier provided by the platform | | +| **client_id** | **String** | OAuth2 client_id for the tenant; required for ClassLink deployments | [optional] | +| **deployment_breakdown_id** | **String** | Value of the custom claim that identifies this specific tenant (for multi-tenant platforms like Schoology) | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfigurationCreate1p3Deployment.new( + mode: null, + deployment_type: null, + deployment_id: null, + client_id: null, + deployment_breakdown_id: null +) +``` + diff --git a/docs/reference/LtiConfigurationCreate1p3Dynamic.md b/docs/reference/LtiConfigurationCreate1p3Dynamic.md new file mode 100644 index 0000000..06b5a32 --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p3Dynamic.md @@ -0,0 +1,22 @@ +# FlatApi::LtiConfigurationCreate1p3Dynamic + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **mode** | **String** | LTI 1.3 dynamic registration mode | | +| **platform_info** | [**LtiConfigurationCreate1p3DynamicPlatformInfo**](LtiConfigurationCreate1p3DynamicPlatformInfo.md) | | [optional] | +| **locale** | **String** | Optional locale code for registration URL. Input values will be automatically normalized to a supported locale code. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfigurationCreate1p3Dynamic.new( + mode: null, + platform_info: null, + locale: null +) +``` + diff --git a/docs/reference/LtiConfigurationCreate1p3DynamicPlatformInfo.md b/docs/reference/LtiConfigurationCreate1p3DynamicPlatformInfo.md new file mode 100644 index 0000000..c756dea --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p3DynamicPlatformInfo.md @@ -0,0 +1,20 @@ +# FlatApi::LtiConfigurationCreate1p3DynamicPlatformInfo + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Platform display name | [optional] | +| **url** | **String** | Optional platform homepage or admin URL for reference | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfigurationCreate1p3DynamicPlatformInfo.new( + name: null, + url: null +) +``` + diff --git a/docs/reference/LtiConfigurationCreate1p3Manual.md b/docs/reference/LtiConfigurationCreate1p3Manual.md new file mode 100644 index 0000000..3310433 --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p3Manual.md @@ -0,0 +1,34 @@ +# FlatApi::LtiConfigurationCreate1p3Manual + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **mode** | **String** | LTI 1.3 manual creation mode | | +| **platform_iss** | **String** | Platform issuer URL | [optional] | +| **platform_name** | **String** | Platform display name | [optional] | +| **client_id** | **String** | OAuth2 client_id allocated by the platform | [optional] | +| **deployment_id** | **String** | Deployment identifier provided by the platform | [optional] | +| **access_token_url** | **String** | Platform access token endpoint URL | [optional] | +| **authorization_url** | **String** | Platform OIDC authorization endpoint URL | [optional] | +| **jwks_url** | **String** | Platform JWKS endpoint URL for public keys | [optional] | +| **enable_email_matching** | **Boolean** | Enable email-based user matching during LTI authentication | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfigurationCreate1p3Manual.new( + mode: null, + platform_iss: null, + platform_name: null, + client_id: null, + deployment_id: null, + access_token_url: null, + authorization_url: null, + jwks_url: null, + enable_email_matching: null +) +``` + diff --git a/docs/reference/LtiConfigurationUpdate.md b/docs/reference/LtiConfigurationUpdate.md new file mode 100644 index 0000000..42177b6 --- /dev/null +++ b/docs/reference/LtiConfigurationUpdate.md @@ -0,0 +1,34 @@ +# FlatApi::LtiConfigurationUpdate + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **deployment_id** | **String** | Deployment identifier provided by the platform | [optional] | +| **deployment_breakdown_id** | **String** | Specific tenant identifier for multi-tenant platforms | [optional] | +| **enable_email_matching** | **Boolean** | Enable email-based user matching during LTI authentication | [optional] | +| **platform_iss** | **String** | Platform issuer URL | [optional] | +| **platform_name** | **String** | Platform display name | [optional] | +| **client_id** | **String** | OAuth2 client_id allocated by the platform | [optional] | +| **access_token_url** | **String** | Platform access token endpoint URL | [optional] | +| **authorization_url** | **String** | Platform OIDC authorization endpoint URL | [optional] | +| **jwks_url** | **String** | Platform JWKS endpoint URL for public keys | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfigurationUpdate.new( + deployment_id: null, + deployment_breakdown_id: null, + enable_email_matching: null, + platform_iss: null, + platform_name: null, + client_id: null, + access_token_url: null, + authorization_url: null, + jwks_url: null +) +``` + diff --git a/docs/reference/LtiConfigurationUpdateDeployment.md b/docs/reference/LtiConfigurationUpdateDeployment.md new file mode 100644 index 0000000..f5432f2 --- /dev/null +++ b/docs/reference/LtiConfigurationUpdateDeployment.md @@ -0,0 +1,22 @@ +# FlatApi::LtiConfigurationUpdateDeployment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **deployment_id** | **String** | Deployment identifier provided by the platform | [optional] | +| **deployment_breakdown_id** | **String** | Specific tenant identifier for multi-tenant platforms | [optional] | +| **enable_email_matching** | **Boolean** | Enable email-based user matching during LTI authentication | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfigurationUpdateDeployment.new( + deployment_id: null, + deployment_breakdown_id: null, + enable_email_matching: null +) +``` + diff --git a/docs/reference/LtiConfigurationUpdateStandalone.md b/docs/reference/LtiConfigurationUpdateStandalone.md new file mode 100644 index 0000000..26e775e --- /dev/null +++ b/docs/reference/LtiConfigurationUpdateStandalone.md @@ -0,0 +1,32 @@ +# FlatApi::LtiConfigurationUpdateStandalone + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **deployment_id** | **String** | Deployment identifier provided by the platform | [optional] | +| **platform_iss** | **String** | Platform issuer URL | [optional] | +| **platform_name** | **String** | Platform display name | [optional] | +| **client_id** | **String** | OAuth2 client_id allocated by the platform | [optional] | +| **access_token_url** | **String** | Platform access token endpoint URL | [optional] | +| **authorization_url** | **String** | Platform OIDC authorization endpoint URL | [optional] | +| **jwks_url** | **String** | Platform JWKS endpoint URL for public keys | [optional] | +| **enable_email_matching** | **Boolean** | Enable email-based user matching during LTI authentication | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiConfigurationUpdateStandalone.new( + deployment_id: null, + platform_iss: null, + platform_name: null, + client_id: null, + access_token_url: null, + authorization_url: null, + jwks_url: null, + enable_email_matching: null +) +``` + diff --git a/docs/reference/LtiCredentials.md b/docs/reference/LtiCredentials.md new file mode 100644 index 0000000..17490ea --- /dev/null +++ b/docs/reference/LtiCredentials.md @@ -0,0 +1,36 @@ +# FlatApi::LtiCredentials + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of this couple of credentials | [optional] | +| **name** | **String** | Name of the couple of credentials | [optional] | +| **lms** | [**LmsName**](LmsName.md) | | [optional] | +| **organization** | **String** | The unique identifier of the Organization associated to these credentials | [optional] | +| **creator** | **String** | Unique identifier of the user who created these credentials | [optional] | +| **creation_date** | **Time** | The creation date of thse credentials | [optional] | +| **last_usage** | **Time** | The last time these credentials were used | [optional] | +| **consumer_key** | **String** | OAuth 1 Consumer Key | [optional] | +| **consumer_secret** | **String** | OAuth 1 Consumer Secret | [optional] | +| **enable_email_matching** | **Boolean** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::LtiCredentials.new( + id: null, + name: null, + lms: null, + organization: null, + creator: null, + creation_date: null, + last_usage: null, + consumer_key: null, + consumer_secret: null, + enable_email_matching: null +) +``` + diff --git a/docs/reference/LtiCredentialsCreation.md b/docs/reference/LtiCredentialsCreation.md new file mode 100644 index 0000000..5237acb --- /dev/null +++ b/docs/reference/LtiCredentialsCreation.md @@ -0,0 +1,20 @@ +# FlatApi::LtiCredentialsCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the couple of credentials | | +| **lms** | [**LmsName**](LmsName.md) | | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::LtiCredentialsCreation.new( + name: null, + lms: null +) +``` + diff --git a/docs/reference/MediaAttachment.md b/docs/reference/MediaAttachment.md new file mode 100644 index 0000000..318a134 --- /dev/null +++ b/docs/reference/MediaAttachment.md @@ -0,0 +1,64 @@ +# FlatApi::MediaAttachment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | 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** | **String** | An unique Flat score identifier | [optional] | +| **revision** | **String** | An unique revision identifier of a score | [optional] | +| **worksheet** | **String** | An unique worksheet identifier | [optional] | +| **dedicated** | **Boolean** | 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** | **String** | A unique track identifier | [optional] | +| **part_uuid** | **String** | The UUID of the instrument part selected for this attachment (for performance submissions) | [optional] | +| **sharing_mode** | [**MediaScoreSharingMode**](MediaScoreSharingMode.md) | | [optional][default to 'read'] | +| **lock_score_template** | **Boolean** | 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** | **String** | The resolved title of the attachment | [optional] | +| **description** | **String** | The resolved description of the attachment | [optional] | +| **html** | **String** | If the attachment type is `rich` or `video`, the HTML code of the media to display | [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** | **String** | The url of the attachment | [optional] | +| **thumbnail_url** | **String** | If the attachment type is `rich`, `video`, `photo` or `link`, a displayable thumbnail for this attachment | [optional] | +| **thumbnail_width** | **Integer** | If the `thumbnailUrl` is available, the width of the thumbnail | [optional] | +| **thumbnail_height** | **Integer** | If the `thumbnailUrl` is available, the width of the thumbnail | [optional] | +| **author_name** | **String** | The resolved author name of the attachment | [optional] | +| **author_url** | **String** | The resolved author url of the attachment | [optional] | +| **icon_url** | **String** | The URL of the icon | [optional] | +| **mime_type** | **String** | The mine type of the file | [optional] | +| **google_drive_file_id** | **String** | The ID of the Google Drive File | [optional] | +| **teacher_only** | **Boolean** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::MediaAttachment.new( + type: null, + score: null, + revision: null, + worksheet: null, + dedicated: null, + track: null, + part_uuid: null, + sharing_mode: null, + lock_score_template: null, + title: null, + description: null, + html: null, + html_width: null, + html_height: null, + url: null, + thumbnail_url: null, + thumbnail_width: null, + thumbnail_height: null, + author_name: null, + author_url: null, + icon_url: null, + mime_type: null, + google_drive_file_id: null, + teacher_only: null +) +``` + diff --git a/docs/reference/MediaScoreSharingMode.md b/docs/reference/MediaScoreSharingMode.md new file mode 100644 index 0000000..c3cf58d --- /dev/null +++ b/docs/reference/MediaScoreSharingMode.md @@ -0,0 +1,15 @@ +# FlatApi::MediaScoreSharingMode + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::MediaScoreSharingMode.new() +``` + diff --git a/docs/reference/MicrosoftGraphAssignment.md b/docs/reference/MicrosoftGraphAssignment.md new file mode 100644 index 0000000..39f7afb --- /dev/null +++ b/docs/reference/MicrosoftGraphAssignment.md @@ -0,0 +1,30 @@ +# FlatApi::MicrosoftGraphAssignment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Identifier of the assignment assigned by Microsoft Teams | [optional] | +| **state** | **String** | 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** | **String** | Absolute link to this assignment in the Microsoft Teams web UI | [optional] | +| **assign_date_time** | **Time** | 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** | **Array<String>** | List of categories where this assignment is published under | [optional] | +| **assign_to_type** | **String** | 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** | **Array<String>** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::MicrosoftGraphAssignment.new( + id: null, + state: null, + alternate_link: null, + assign_date_time: null, + categories: null, + assign_to_type: null, + assigned_students_ms_ids: null +) +``` + diff --git a/docs/reference/MicrosoftGraphSubmission.md b/docs/reference/MicrosoftGraphSubmission.md new file mode 100644 index 0000000..160d18e --- /dev/null +++ b/docs/reference/MicrosoftGraphSubmission.md @@ -0,0 +1,20 @@ +# FlatApi::MicrosoftGraphSubmission + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Identifier of the submission assigned by Microsoft Teams | | +| **state** | **String** | State of the submission | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::MicrosoftGraphSubmission.new( + id: null, + state: null +) +``` + diff --git a/docs/reference/OMRApi.md b/docs/reference/OMRApi.md new file mode 100644 index 0000000..a6e2fb5 --- /dev/null +++ b/docs/reference/OMRApi.md @@ -0,0 +1,915 @@ +# FlatApi::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 + +> add_omr_job_file(job, omr_job_file_upload, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +job = 'job_example' # String | Unique identifier of the OMR job +omr_job_file_upload = FlatApi::OmrJobFileUpload.new({file: 'file_example'}) # OmrJobFileUpload | +opts = { + x_flat_locale: 'fr' # String | 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`. +} + +begin + # Add a file to an OMR job + result = api_instance.add_omr_job_file(job, omr_job_file_upload, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->add_omr_job_file: #{e}" +end +``` + +#### Using the add_omr_job_file_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> add_omr_job_file_with_http_info(job, omr_job_file_upload, opts) + +```ruby +begin + # Add a file to an OMR job + data, status_code, headers = api_instance.add_omr_job_file_with_http_info(job, omr_job_file_upload, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->add_omr_job_file_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **job** | **String** | Unique identifier of the OMR job | | +| **omr_job_file_upload** | [**OmrJobFileUpload**](OmrJobFileUpload.md) | | | +| **x_flat_locale** | **String** | 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 + + +## cancel_omr_job + +> cancel_omr_job(job, opts) + +Cancel an OMR job + +Cancel a draft or in-flight job. Any charged credits are reversed. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +job = 'job_example' # String | Unique identifier of the OMR job +opts = { + x_flat_locale: 'fr' # String | 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`. +} + +begin + # Cancel an OMR job + result = api_instance.cancel_omr_job(job, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->cancel_omr_job: #{e}" +end +``` + +#### Using the cancel_omr_job_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> cancel_omr_job_with_http_info(job, opts) + +```ruby +begin + # Cancel an OMR job + data, status_code, headers = api_instance.cancel_omr_job_with_http_info(job, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->cancel_omr_job_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **job** | **String** | Unique identifier of the OMR job | | +| **x_flat_locale** | **String** | 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 + + +## create_omr_job + +> create_omr_job(omr_job_creation, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +omr_job_creation = FlatApi::OmrJobCreation.new # OmrJobCreation | +opts = { + x_flat_locale: 'fr' # String | 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`. +} + +begin + # Create an OMR job + result = api_instance.create_omr_job(omr_job_creation, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->create_omr_job: #{e}" +end +``` + +#### Using the create_omr_job_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_omr_job_with_http_info(omr_job_creation, opts) + +```ruby +begin + # Create an OMR job + data, status_code, headers = api_instance.create_omr_job_with_http_info(omr_job_creation, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->create_omr_job_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **omr_job_creation** | [**OmrJobCreation**](OmrJobCreation.md) | | | +| **x_flat_locale** | **String** | 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 + + +## delete_omr_job + +> delete_omr_job(job, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +job = 'job_example' # String | Unique identifier of the OMR job +opts = { + x_flat_locale: 'fr' # String | 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`. +} + +begin + # Delete an OMR job's data + result = api_instance.delete_omr_job(job, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->delete_omr_job: #{e}" +end +``` + +#### Using the delete_omr_job_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> delete_omr_job_with_http_info(job, opts) + +```ruby +begin + # Delete an OMR job's data + data, status_code, headers = api_instance.delete_omr_job_with_http_info(job, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->delete_omr_job_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **job** | **String** | Unique identifier of the OMR job | | +| **x_flat_locale** | **String** | 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 + + +## get_omr_capabilities + +> get_omr_capabilities(opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +opts = { + x_flat_locale: 'fr' # String | 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`. +} + +begin + # OMR capabilities and limits + result = api_instance.get_omr_capabilities(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->get_omr_capabilities: #{e}" +end +``` + +#### Using the get_omr_capabilities_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_omr_capabilities_with_http_info(opts) + +```ruby +begin + # OMR capabilities and limits + data, status_code, headers = api_instance.get_omr_capabilities_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->get_omr_capabilities_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **x_flat_locale** | **String** | 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 + + +## get_omr_job + +> get_omr_job(job, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +job = 'job_example' # String | Unique identifier of the OMR job +opts = { + wait: 56, # Integer | Long-poll up to this many seconds for a state change before returning. + x_flat_locale: 'fr' # String | 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`. +} + +begin + # Get an OMR job + result = api_instance.get_omr_job(job, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->get_omr_job: #{e}" +end +``` + +#### Using the get_omr_job_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_omr_job_with_http_info(job, opts) + +```ruby +begin + # Get an OMR job + data, status_code, headers = api_instance.get_omr_job_with_http_info(job, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->get_omr_job_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **job** | **String** | Unique identifier of the OMR job | | +| **wait** | **Integer** | Long-poll up to this many seconds for a state change before returning. | [optional] | +| **x_flat_locale** | **String** | 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 + + +## get_omr_job_export + +> File get_omr_job_export(job, format, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +job = 'job_example' # String | Unique identifier of the OMR job +format = 'musicxml' # String | 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`). +opts = { + x_flat_locale: 'fr' # String | 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`. +} + +begin + # Download the finalized result + result = api_instance.get_omr_job_export(job, format, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->get_omr_job_export: #{e}" +end +``` + +#### Using the get_omr_job_export_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> get_omr_job_export_with_http_info(job, format, opts) + +```ruby +begin + # Download the finalized result + data, status_code, headers = api_instance.get_omr_job_export_with_http_info(job, format, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => File +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->get_omr_job_export_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **job** | **String** | Unique identifier of the OMR job | | +| **format** | **String** | 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** | **String** | 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 + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream, application/json + + +## get_omr_job_file + +> File get_omr_job_file(job, index, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +job = 'job_example' # String | Unique identifier of the OMR job +index = 56 # Integer | 0-based index of the input file (page) to fetch. +opts = { + x_flat_locale: 'fr' # String | 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`. +} + +begin + # Get an input page image + result = api_instance.get_omr_job_file(job, index, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->get_omr_job_file: #{e}" +end +``` + +#### Using the get_omr_job_file_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> get_omr_job_file_with_http_info(job, index, opts) + +```ruby +begin + # Get an input page image + data, status_code, headers = api_instance.get_omr_job_file_with_http_info(job, index, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => File +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->get_omr_job_file_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **job** | **String** | Unique identifier of the OMR job | | +| **index** | **Integer** | 0-based index of the input file (page) to fetch. | | +| **x_flat_locale** | **String** | 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 + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: image/jpeg, application/json + + +## list_billing_credits_history + +> > list_billing_credits_history(opts) + +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`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +opts = { + limit: 56, # Integer | This is the maximum number of objects that may be returned + _next: '_next_example', # String | 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. + previous: 'previous_example' # String | 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. +} + +begin + # List credit history + result = api_instance.list_billing_credits_history(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->list_billing_credits_history: #{e}" +end +``` + +#### Using the list_billing_credits_history_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_billing_credits_history_with_http_info(opts) + +```ruby +begin + # List credit history + data, status_code, headers = api_instance.list_billing_credits_history_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->list_billing_credits_history_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 50] | +| **_next** | **String** | 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** | **String** | 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 + +[**Array<CreditTransaction>**](CreditTransaction.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_omr_jobs + +> > list_omr_jobs(opts) + +List OMR jobs + +List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +opts = { + status: FlatApi::OmrJobStatus::DRAFT, # OmrJobStatus | Filter jobs by status + expired: true, # Boolean | 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. + limit: 56, # Integer | This is the maximum number of objects that may be returned + _next: '_next_example', # String | 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. + previous: 'previous_example', # String | 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. + x_flat_locale: 'fr' # String | 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`. +} + +begin + # List OMR jobs + result = api_instance.list_omr_jobs(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->list_omr_jobs: #{e}" +end +``` + +#### Using the list_omr_jobs_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_omr_jobs_with_http_info(opts) + +```ruby +begin + # List OMR jobs + data, status_code, headers = api_instance.list_omr_jobs_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->list_omr_jobs_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | [**OmrJobStatus**](.md) | Filter jobs by status | [optional] | +| **expired** | **Boolean** | 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** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 50] | +| **_next** | **String** | 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** | **String** | 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** | **String** | 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 + +[**Array<OmrJob>**](OmrJob.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## start_omr_job + +> start_omr_job(job, opts) + +Start an OMR job + +Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +job = 'job_example' # String | Unique identifier of the OMR job +opts = { + x_flat_locale: 'fr' # String | 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`. +} + +begin + # Start an OMR job + result = api_instance.start_omr_job(job, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->start_omr_job: #{e}" +end +``` + +#### Using the start_omr_job_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> start_omr_job_with_http_info(job, opts) + +```ruby +begin + # Start an OMR job + data, status_code, headers = api_instance.start_omr_job_with_http_info(job, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->start_omr_job_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **job** | **String** | Unique identifier of the OMR job | | +| **x_flat_locale** | **String** | 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 + + +## submit_omr_job_step + +> submit_omr_job_step(job, step, body, opts) + +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). + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OMRApi.new +job = 'job_example' # String | Unique identifier of the OMR job +step = FlatApi::OmrStepName::DETAILS # OmrStepName | The pending step being submitted +body = 3.56 # OmrDetailsSubmission | +opts = { + x_flat_locale: 'fr' # String | 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`. +} + +begin + # Submit an interactive step + result = api_instance.submit_omr_job_step(job, step, body, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->submit_omr_job_step: #{e}" +end +``` + +#### Using the submit_omr_job_step_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> submit_omr_job_step_with_http_info(job, step, body, opts) + +```ruby +begin + # Submit an interactive step + data, status_code, headers = api_instance.submit_omr_job_step_with_http_info(job, step, body, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OMRApi->submit_omr_job_step_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **job** | **String** | Unique identifier of the OMR job | | +| **step** | [**OmrStepName**](.md) | The pending step being submitted | | +| **body** | **OmrDetailsSubmission** | | | +| **x_flat_locale** | **String** | 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 + diff --git a/docs/reference/OmrCapabilities.md b/docs/reference/OmrCapabilities.md new file mode 100644 index 0000000..ec24df0 --- /dev/null +++ b/docs/reference/OmrCapabilities.md @@ -0,0 +1,44 @@ +# FlatApi::OmrCapabilities + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **steps** | [**Array<OmrStepName>**](OmrStepName.md) | Interactive steps this server supports. | | +| **formats** | **Array<String>** | Export formats available via `getOmrJobExport`. | | +| **outputs** | [**Array<OmrJobOutput>**](OmrJobOutput.md) | Output destinations the account can use when creating a job. | | +| **max_files** | **Integer** | Maximum number of input files that can be added to a single job. | | +| **max_pages** | **Integer** | Maximum number of pages allowed across all input files of a single job. | | +| **max_parallel_jobs** | **Integer** | Maximum number of OMR jobs that can run in parallel for this account. | | +| **max_file_size** | **Integer** | Maximum size of a single file, in bytes. | | +| **accepted_mime_types** | **Array<String>** | 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** | **Array<String>** | 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** | **Integer** | Credits charged per page. | [optional] | +| **remaining_credits** | **Integer** | OMR credits remaining for the account. | [optional] | +| **retention_days** | **Integer** | 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** | **Array<String>** | 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** | [**Array<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 + +```ruby +require 'flat_api' + +instance = FlatApi::OmrCapabilities.new( + steps: null, + formats: null, + outputs: null, + max_files: null, + max_pages: null, + max_parallel_jobs: null, + max_file_size: null, + accepted_mime_types: null, + accepted_extensions: null, + cost_per_page: null, + remaining_credits: null, + retention_days: null, + locales: null, + locales_details: null +) +``` + diff --git a/docs/reference/OmrDetailsStepData.md b/docs/reference/OmrDetailsStepData.md new file mode 100644 index 0000000..23f88b4 --- /dev/null +++ b/docs/reference/OmrDetailsStepData.md @@ -0,0 +1,22 @@ +# FlatApi::OmrDetailsStepData + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **step** | **String** | Discriminator for `OmrPendingStep.data`; always `details` for this payload. | | +| **title** | **String** | OCR-detected work title. | [optional] | +| **instruments** | [**Array<OmrDetectedInstrument>**](OmrDetectedInstrument.md) | | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrDetailsStepData.new( + step: null, + title: null, + instruments: null +) +``` + diff --git a/docs/reference/OmrDetailsSubmission.md b/docs/reference/OmrDetailsSubmission.md new file mode 100644 index 0000000..8ba86f9 --- /dev/null +++ b/docs/reference/OmrDetailsSubmission.md @@ -0,0 +1,24 @@ +# FlatApi::OmrDetailsSubmission + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **step** | **String** | Discriminator for `OmrStepSubmission`; always `details` for this submission. | | +| **title** | **String** | Override the detected work title. | [optional] | +| **main_language** | **String** | 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** | [**Array<OmrInstrumentOverride>**](OmrInstrumentOverride.md) | Per-part overrides, each matched to a detected part by `index`. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrDetailsSubmission.new( + step: null, + title: null, + main_language: null, + instruments: null +) +``` + diff --git a/docs/reference/OmrDetectedInstrument.md b/docs/reference/OmrDetectedInstrument.md new file mode 100644 index 0000000..312fbe4 --- /dev/null +++ b/docs/reference/OmrDetectedInstrument.md @@ -0,0 +1,30 @@ +# FlatApi::OmrDetectedInstrument + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **index** | **Integer** | 0-based position of the part in the score. | | +| **part_name** | **String** | Verbatim part name read from the score. | [optional] | +| **instrument_id** | **String** | 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** | **String** | Localized display name, resolved server-side so the client needs no instruments dictionary. | [optional] | +| **midi_program** | **Integer** | General MIDI program number. | [optional] | +| **transpose_key** | **String** | Transposition or written key shown in the UI, for example `F` for Horn in F. | [optional] | +| **resolved_confidence** | **String** | Server confidence in the resolved instrument match. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrDetectedInstrument.new( + index: null, + part_name: null, + instrument_id: null, + instrument_name: null, + midi_program: null, + transpose_key: null, + resolved_confidence: null +) +``` + diff --git a/docs/reference/OmrImportedMetadata.md b/docs/reference/OmrImportedMetadata.md new file mode 100644 index 0000000..d5f7793 --- /dev/null +++ b/docs/reference/OmrImportedMetadata.md @@ -0,0 +1,24 @@ +# FlatApi::OmrImportedMetadata + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **instruments** | **Array<String>** | Instrument IDs of the assembled parts. | [optional] | +| **number_measures** | **Integer** | Number of measures in the recognized score. | [optional] | +| **main_tempo_qpm** | **Float** | Main tempo, in quarter notes per minute. | [optional] | +| **main_key_signature** | **Integer** | Main key signature as a fifths count (negative for flats, positive for sharps, 0 for C major / A minor). | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrImportedMetadata.new( + instruments: null, + number_measures: null, + main_tempo_qpm: null, + main_key_signature: null +) +``` + diff --git a/docs/reference/OmrInstrumentOverride.md b/docs/reference/OmrInstrumentOverride.md new file mode 100644 index 0000000..ad376e9 --- /dev/null +++ b/docs/reference/OmrInstrumentOverride.md @@ -0,0 +1,26 @@ +# FlatApi::OmrInstrumentOverride + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **index** | **Integer** | 0-based position of the part to override, matching the `index` of the detected part. | | +| **instrument_id** | **String** | 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** | **String** | Override the part name. | [optional] | +| **transpose_key** | **String** | 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** | **Integer** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::OmrInstrumentOverride.new( + index: null, + instrument_id: null, + part_name: null, + transpose_key: null, + midi_program: null +) +``` + diff --git a/docs/reference/OmrJob.md b/docs/reference/OmrJob.md new file mode 100644 index 0000000..bc9817e --- /dev/null +++ b/docs/reference/OmrJob.md @@ -0,0 +1,50 @@ +# FlatApi::OmrJob + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the OMR job. | | +| **status** | [**OmrJobStatus**](OmrJobStatus.md) | | | +| **output** | [**OmrJobOutput**](OmrJobOutput.md) | | [default to 'library'] | +| **interactive_steps** | [**Array<OmrStepName>**](OmrStepName.md) | Steps this job pauses at for client input, echoing the value set at creation. | | +| **locales** | **Array<String>** | 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** | **Integer** | 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** | **String** | 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** | **String** | 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** | **Time** | When the job was created. | [optional] | +| **modification_date** | **Time** | When the job was last updated. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJob.new( + id: null, + status: null, + output: null, + interactive_steps: null, + locales: null, + current_step: null, + pending_step: null, + estimated_credits: null, + progress: null, + original_file_metadata: null, + imported_metadata: null, + result: null, + retention: null, + error_code: null, + error_message: null, + creation_date: null, + modification_date: null +) +``` + diff --git a/docs/reference/OmrJobCreation.md b/docs/reference/OmrJobCreation.md new file mode 100644 index 0000000..bd71987 --- /dev/null +++ b/docs/reference/OmrJobCreation.md @@ -0,0 +1,30 @@ +# FlatApi::OmrJobCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **output** | [**OmrJobOutput**](OmrJobOutput.md) | | [optional][default to 'library'] | +| **interactive_steps** | [**Array<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] | +| **locales** | **Array<String>** | 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** | **String** | Target collection ID. Only used when `output` is `library`. | [optional] | +| **idempotency_key** | **String** | 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** | [**Array<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** | **Boolean** | Start processing immediately. Only valid when `files` is provided. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobCreation.new( + output: null, + interactive_steps: null, + locales: null, + collection: null, + idempotency_key: null, + files: null, + auto_start: null +) +``` + diff --git a/docs/reference/OmrJobFileMetadata.md b/docs/reference/OmrJobFileMetadata.md new file mode 100644 index 0000000..140d71d --- /dev/null +++ b/docs/reference/OmrJobFileMetadata.md @@ -0,0 +1,28 @@ +# FlatApi::OmrJobFileMetadata + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **number_of_pages** | **Integer** | Total number of pages across all input files. | [optional] | +| **file_count** | **Integer** | Number of input files attached. | [optional] | +| **filename** | **String** | Original filename of the input as uploaded (of the first file when several were combined). | [optional] | +| **file_size** | **Integer** | Combined size of the input files, in bytes. | [optional] | +| **mime_type** | **String** | MIME type of the input (of the first file when several were combined). | [optional] | +| **file_extension** | **String** | File extension of the input, without the leading dot (for example `pdf`). | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobFileMetadata.new( + number_of_pages: null, + file_count: null, + filename: null, + file_size: null, + mime_type: null, + file_extension: null +) +``` + diff --git a/docs/reference/OmrJobFileUpload.md b/docs/reference/OmrJobFileUpload.md new file mode 100644 index 0000000..7a38fef --- /dev/null +++ b/docs/reference/OmrJobFileUpload.md @@ -0,0 +1,20 @@ +# FlatApi::OmrJobFileUpload + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **file** | **String** | 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** | **String** | Optional original filename, kept for display. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobFileUpload.new( + file: null, + filename: null +) +``` + diff --git a/docs/reference/OmrJobFileUploadResult.md b/docs/reference/OmrJobFileUploadResult.md new file mode 100644 index 0000000..15e058b --- /dev/null +++ b/docs/reference/OmrJobFileUploadResult.md @@ -0,0 +1,20 @@ +# FlatApi::OmrJobFileUploadResult + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **file_index** | **Integer** | 0-based index assigned to the uploaded file. | [optional] | +| **file_count** | **Integer** | Total number of files now attached to the job. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobFileUploadResult.new( + file_index: null, + file_count: null +) +``` + diff --git a/docs/reference/OmrJobInputFile.md b/docs/reference/OmrJobInputFile.md new file mode 100644 index 0000000..f047db5 --- /dev/null +++ b/docs/reference/OmrJobInputFile.md @@ -0,0 +1,20 @@ +# FlatApi::OmrJobInputFile + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **file** | **String** | 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** | **String** | Optional original filename, kept for display. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobInputFile.new( + file: null, + filename: null +) +``` + diff --git a/docs/reference/OmrJobOutput.md b/docs/reference/OmrJobOutput.md new file mode 100644 index 0000000..88d252e --- /dev/null +++ b/docs/reference/OmrJobOutput.md @@ -0,0 +1,15 @@ +# FlatApi::OmrJobOutput + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobOutput.new() +``` + diff --git a/docs/reference/OmrJobProgress.md b/docs/reference/OmrJobProgress.md new file mode 100644 index 0000000..301b650 --- /dev/null +++ b/docs/reference/OmrJobProgress.md @@ -0,0 +1,22 @@ +# FlatApi::OmrJobProgress + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **percent** | **Float** | Completion percentage (0-100). | [optional] | +| **text** | **String** | Localized progress message, ready to display. | [optional] | +| **key** | **String** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobProgress.new( + percent: null, + text: null, + key: null +) +``` + diff --git a/docs/reference/OmrJobResult.md b/docs/reference/OmrJobResult.md new file mode 100644 index 0000000..7d95179 --- /dev/null +++ b/docs/reference/OmrJobResult.md @@ -0,0 +1,20 @@ +# FlatApi::OmrJobResult + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | Created score ID, when `output` is `library`. | [optional] | +| **exports** | **Array<String>** | Formats available via `getOmrJobExport`, for example `[\"musicxml\", \"mxl\", \"midi\"]`. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobResult.new( + score: null, + exports: null +) +``` + diff --git a/docs/reference/OmrJobRetention.md b/docs/reference/OmrJobRetention.md new file mode 100644 index 0000000..7a191fe --- /dev/null +++ b/docs/reference/OmrJobRetention.md @@ -0,0 +1,20 @@ +# FlatApi::OmrJobRetention + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **expiry_date** | **Time** | 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** | **Time** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobRetention.new( + expiry_date: null, + expired_date: null +) +``` + diff --git a/docs/reference/OmrJobStatus.md b/docs/reference/OmrJobStatus.md new file mode 100644 index 0000000..f152b55 --- /dev/null +++ b/docs/reference/OmrJobStatus.md @@ -0,0 +1,15 @@ +# FlatApi::OmrJobStatus + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrJobStatus.new() +``` + diff --git a/docs/reference/OmrLocaleDetails.md b/docs/reference/OmrLocaleDetails.md new file mode 100644 index 0000000..ea644d6 --- /dev/null +++ b/docs/reference/OmrLocaleDetails.md @@ -0,0 +1,20 @@ +# FlatApi::OmrLocaleDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **String** | BCP 47 locale code. Always one of the codes listed in `locales`. | | +| **name** | **String** | English name of the language, for display in a picker. | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrLocaleDetails.new( + code: vi, + name: Vietnamese +) +``` + diff --git a/docs/reference/OmrPendingStep.md b/docs/reference/OmrPendingStep.md new file mode 100644 index 0000000..ce1ed06 --- /dev/null +++ b/docs/reference/OmrPendingStep.md @@ -0,0 +1,20 @@ +# FlatApi::OmrPendingStep + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **step** | [**OmrStepName**](OmrStepName.md) | | | +| **data** | [**OmrDetailsStepData**](OmrDetailsStepData.md) | | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrPendingStep.new( + step: null, + data: null +) +``` + diff --git a/docs/reference/OmrStepName.md b/docs/reference/OmrStepName.md new file mode 100644 index 0000000..c428cee --- /dev/null +++ b/docs/reference/OmrStepName.md @@ -0,0 +1,15 @@ +# FlatApi::OmrStepName + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OmrStepName.new() +``` + diff --git a/docs/reference/OrganizationApi.md b/docs/reference/OrganizationApi.md new file mode 100644 index 0000000..231ad3b --- /dev/null +++ b/docs/reference/OrganizationApi.md @@ -0,0 +1,1219 @@ +# FlatApi::OrganizationApi + +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 + +> Integer count_orga_users(opts) + +Count the organization users using the provided filters + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +opts = { + role: ['user'], # Array | Filter users by role + q: 'q_example', # String | The query to search + group: ['inner_example'], # Array | Filter users by group + no_active_license: true, # Boolean | Filter users who don't have an active license + test_accounts: 'exclude' # String | 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. +} + +begin + # Count the organization users using the provided filters + result = api_instance.count_orga_users(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->count_orga_users: #{e}" +end +``` + +#### Using the count_orga_users_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> count_orga_users_with_http_info(opts) + +```ruby +begin + # Count the organization users using the provided filters + data, status_code, headers = api_instance.count_orga_users_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => Integer +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->count_orga_users_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **role** | [**Array<String>**](String.md) | Filter users by role | [optional] | +| **q** | **String** | The query to search | [optional] | +| **group** | [**Array<String>**](String.md) | Filter users by group | [optional] | +| **no_active_license** | **Boolean** | Filter users who don't have an active license | [optional] | +| **test_accounts** | **String** | 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 + +**Integer** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## create_lti_configuration + +> create_lti_configuration(lti_configuration_create) + +Create a new LTI configuration (1.1 or 1.3) + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +lti_configuration_create = FlatApi::LtiConfigurationCreate1p1.new({mode: '1p1-manual'}) # LtiConfigurationCreate | + +begin + # Create a new LTI configuration (1.1 or 1.3) + result = api_instance.create_lti_configuration(lti_configuration_create) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_lti_configuration: #{e}" +end +``` + +#### Using the create_lti_configuration_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_lti_configuration_with_http_info(lti_configuration_create) + +```ruby +begin + # Create a new LTI configuration (1.1 or 1.3) + data, status_code, headers = api_instance.create_lti_configuration_with_http_info(lti_configuration_create) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_lti_configuration_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lti_configuration_create** | [**LtiConfigurationCreate**](LtiConfigurationCreate.md) | | | + +### Return type + +[**LtiConfiguration**](LtiConfiguration.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_lti_credentials + +> create_lti_credentials(body) + +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/). + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +body = FlatApi::LtiCredentialsCreation.new({name: 'name_example', lms: FlatApi::LmsName::CANVAS}) # LtiCredentialsCreation | + +begin + # Create a new couple of LTI 1.x credentials + result = api_instance.create_lti_credentials(body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_lti_credentials: #{e}" +end +``` + +#### Using the create_lti_credentials_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_lti_credentials_with_http_info(body) + +```ruby +begin + # Create a new couple of LTI 1.x credentials + data, status_code, headers = api_instance.create_lti_credentials_with_http_info(body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_lti_credentials_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **body** | [**LtiCredentialsCreation**](LtiCredentialsCreation.md) | | | + +### Return type + +[**LtiCredentials**](LtiCredentials.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_organization_invitation + +> create_organization_invitation(body) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +body = FlatApi::OrganizationInvitationCreation.new # OrganizationInvitationCreation | + +begin + # Create a new invitation to join the organization + result = api_instance.create_organization_invitation(body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_organization_invitation: #{e}" +end +``` + +#### Using the create_organization_invitation_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_organization_invitation_with_http_info(body) + +```ruby +begin + # Create a new invitation to join the organization + data, status_code, headers = api_instance.create_organization_invitation_with_http_info(body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_organization_invitation_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **body** | [**OrganizationInvitationCreation**](OrganizationInvitationCreation.md) | | | + +### Return type + +[**OrganizationInvitation**](OrganizationInvitation.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_organization_user + +> create_organization_user(body) + +Create a new user account + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +body = FlatApi::UserCreation.new({username: 'username_example', password: 'password_example'}) # UserCreation | + +begin + # Create a new user account + result = api_instance.create_organization_user(body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_organization_user: #{e}" +end +``` + +#### Using the create_organization_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_organization_user_with_http_info(body) + +```ruby +begin + # Create a new user account + data, status_code, headers = api_instance.create_organization_user_with_http_info(body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_organization_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **body** | [**UserCreation**](UserCreation.md) | | | + +### Return type + +[**UserDetailsAdmin**](UserDetailsAdmin.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_organization_user_access_token + +> create_organization_user_access_token(user, organization_user_access_token_creation) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +user = 'user_example' # String | Unique identifier of the Flat account +organization_user_access_token_creation = FlatApi::OrganizationUserAccessTokenCreation.new({scopes: [FlatApi::AppScopes::ACCOUNT_PUBLIC_PROFILE]}) # OrganizationUserAccessTokenCreation | + +begin + # Create a delegated API access token for an organization user + result = api_instance.create_organization_user_access_token(user, organization_user_access_token_creation) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_organization_user_access_token: #{e}" +end +``` + +#### Using the create_organization_user_access_token_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_organization_user_access_token_with_http_info(user, organization_user_access_token_creation) + +```ruby +begin + # Create a delegated API access token for an organization user + data, status_code, headers = api_instance.create_organization_user_access_token_with_http_info(user, organization_user_access_token_creation) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_organization_user_access_token_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | Unique identifier of the Flat account | | +| **organization_user_access_token_creation** | [**OrganizationUserAccessTokenCreation**](OrganizationUserAccessTokenCreation.md) | | | + +### Return type + +[**ApiAccessToken**](ApiAccessToken.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_organization_user_signin_link + +> create_organization_user_signin_link(user, user_signin_link_creation) + +Create a sign in link for an organization user + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +user = 'user_example' # String | Unique identifier of the Flat account +user_signin_link_creation = FlatApi::UserSigninLinkCreation.new # UserSigninLinkCreation | + +begin + # Create a sign in link for an organization user + result = api_instance.create_organization_user_signin_link(user, user_signin_link_creation) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_organization_user_signin_link: #{e}" +end +``` + +#### Using the create_organization_user_signin_link_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_organization_user_signin_link_with_http_info(user, user_signin_link_creation) + +```ruby +begin + # Create a sign in link for an organization user + data, status_code, headers = api_instance.create_organization_user_signin_link_with_http_info(user, user_signin_link_creation) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->create_organization_user_signin_link_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | Unique identifier of the Flat account | | +| **user_signin_link_creation** | [**UserSigninLinkCreation**](UserSigninLinkCreation.md) | | | + +### Return type + +[**UserSigninLink**](UserSigninLink.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_lti_configuration + +> delete_lti_configuration(configuration) + +Delete an LTI configuration + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +configuration = 'configuration_example' # String | Configuration unique identifier + +begin + # Delete an LTI configuration + api_instance.delete_lti_configuration(configuration) +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->delete_lti_configuration: #{e}" +end +``` + +#### Using the delete_lti_configuration_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_lti_configuration_with_http_info(configuration) + +```ruby +begin + # Delete an LTI configuration + data, status_code, headers = api_instance.delete_lti_configuration_with_http_info(configuration) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->delete_lti_configuration_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **configuration** | **String** | Configuration unique identifier | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_lti_configurations + +> > list_lti_configurations + +List LTI configurations (1.1 and 1.3) + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new + +begin + # List LTI configurations (1.1 and 1.3) + result = api_instance.list_lti_configurations + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->list_lti_configurations: #{e}" +end +``` + +#### Using the list_lti_configurations_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_lti_configurations_with_http_info + +```ruby +begin + # List LTI configurations (1.1 and 1.3) + data, status_code, headers = api_instance.list_lti_configurations_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->list_lti_configurations_with_http_info: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Array<LtiConfiguration>**](LtiConfiguration.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_lti_credentials + +> > 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`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new + +begin + # List LTI 1.x credentials + result = api_instance.list_lti_credentials + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->list_lti_credentials: #{e}" +end +``` + +#### Using the list_lti_credentials_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_lti_credentials_with_http_info + +```ruby +begin + # List LTI 1.x credentials + data, status_code, headers = api_instance.list_lti_credentials_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->list_lti_credentials_with_http_info: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Array<LtiCredentials>**](LtiCredentials.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_organization_invitations + +> > list_organization_invitations(opts) + +List the organization invitations + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +opts = { + role: 'user', # String | Filter users by role + limit: 56, # Integer | This is the maximum number of objects that may be returned + _next: '_next_example', # String | 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. + previous: 'previous_example' # String | 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. +} + +begin + # List the organization invitations + result = api_instance.list_organization_invitations(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->list_organization_invitations: #{e}" +end +``` + +#### Using the list_organization_invitations_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_organization_invitations_with_http_info(opts) + +```ruby +begin + # List the organization invitations + data, status_code, headers = api_instance.list_organization_invitations_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->list_organization_invitations_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **role** | **String** | Filter users by role | [optional] | +| **limit** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 50] | +| **_next** | **String** | 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** | **String** | 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 + +[**Array<OrganizationInvitation>**](OrganizationInvitation.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_organization_users + +> > list_organization_users(opts) + +List the organization users + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +opts = { + sort: 'creationDate', # String | 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. + direction: 'asc', # String | Sort direction + _next: '_next_example', # String | 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. + previous: 'previous_example', # String | 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. + role: ['user'], # Array | Filter users by role + q: 'q_example', # String | The query to search + group: ['inner_example'], # Array | Filter users by group + no_active_license: true, # Boolean | Filter users who don't have an active license + test_accounts: 'exclude', # String | 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. + license_expiration_date: ['inner_example'], # Array | Filter users by license expiration date or `active` / `notActive` + only_ids: true, # Boolean | Return only user ids + limit: 56 # Integer | This is the maximum number of objects that may be returned +} + +begin + # List the organization users + result = api_instance.list_organization_users(opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->list_organization_users: #{e}" +end +``` + +#### Using the list_organization_users_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_organization_users_with_http_info(opts) + +```ruby +begin + # List the organization users + data, status_code, headers = api_instance.list_organization_users_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->list_organization_users_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sort** | **String** | 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** | **String** | Sort direction | [optional] | +| **_next** | **String** | 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** | **String** | 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] | +| **role** | [**Array<String>**](String.md) | Filter users by role | [optional] | +| **q** | **String** | The query to search | [optional] | +| **group** | [**Array<String>**](String.md) | Filter users by group | [optional] | +| **no_active_license** | **Boolean** | Filter users who don't have an active license | [optional] | +| **test_accounts** | **String** | 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** | [**Array<String>**](String.md) | Filter users by license expiration date or `active` / `notActive` | [optional] | +| **only_ids** | **Boolean** | Return only user ids | [optional] | +| **limit** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 25] | + +### Return type + +[**Array<UserDetailsAdmin>**](UserDetailsAdmin.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## remove_organization_invitation + +> remove_organization_invitation(invitation) + +Remove an organization invitation + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +invitation = 'invitation_example' # String | Unique identifier of the invitation + +begin + # Remove an organization invitation + api_instance.remove_organization_invitation(invitation) +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->remove_organization_invitation: #{e}" +end +``` + +#### Using the remove_organization_invitation_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> remove_organization_invitation_with_http_info(invitation) + +```ruby +begin + # Remove an organization invitation + data, status_code, headers = api_instance.remove_organization_invitation_with_http_info(invitation) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->remove_organization_invitation_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **invitation** | **String** | Unique identifier of the invitation | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## remove_organization_user + +> remove_organization_user(user, opts) + +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) + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +user = 'user_example' # String | Unique identifier of the Flat account +opts = { + convert_to_individual: true # Boolean | 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. +} + +begin + # Remove an account from Flat + api_instance.remove_organization_user(user, opts) +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->remove_organization_user: #{e}" +end +``` + +#### Using the remove_organization_user_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> remove_organization_user_with_http_info(user, opts) + +```ruby +begin + # Remove an account from Flat + data, status_code, headers = api_instance.remove_organization_user_with_http_info(user, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->remove_organization_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | Unique identifier of the Flat account | | +| **convert_to_individual** | **Boolean** | 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. | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## revoke_lti_credentials + +> revoke_lti_credentials(credentials) + +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`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +credentials = 'credentials_example' # String | Credentials unique identifier + +begin + # Revoke LTI 1.x credentials + api_instance.revoke_lti_credentials(credentials) +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->revoke_lti_credentials: #{e}" +end +``` + +#### Using the revoke_lti_credentials_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> revoke_lti_credentials_with_http_info(credentials) + +```ruby +begin + # Revoke LTI 1.x credentials + data, status_code, headers = api_instance.revoke_lti_credentials_with_http_info(credentials) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->revoke_lti_credentials_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **credentials** | **String** | Credentials unique identifier | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_lti_configuration + +> update_lti_configuration(configuration, lti_configuration_update) + +Update an existing LTI configuration (edit 1.3; 1.1 not editable) + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +configuration = 'configuration_example' # String | Configuration unique identifier +lti_configuration_update = FlatApi::LtiConfigurationUpdate.new # LtiConfigurationUpdate | + +begin + # Update an existing LTI configuration (edit 1.3; 1.1 not editable) + result = api_instance.update_lti_configuration(configuration, lti_configuration_update) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->update_lti_configuration: #{e}" +end +``` + +#### Using the update_lti_configuration_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_lti_configuration_with_http_info(configuration, lti_configuration_update) + +```ruby +begin + # Update an existing LTI configuration (edit 1.3; 1.1 not editable) + data, status_code, headers = api_instance.update_lti_configuration_with_http_info(configuration, lti_configuration_update) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->update_lti_configuration_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **configuration** | **String** | 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 + + +## update_organization_user + +> update_organization_user(user, body) + +Update account information + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::OrganizationApi.new +user = 'user_example' # String | Unique identifier of the Flat account +body = FlatApi::UserAdminUpdate.new # UserAdminUpdate | + +begin + # Update account information + result = api_instance.update_organization_user(user, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->update_organization_user: #{e}" +end +``` + +#### Using the update_organization_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_organization_user_with_http_info(user, body) + +```ruby +begin + # Update account information + data, status_code, headers = api_instance.update_organization_user_with_http_info(user, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling OrganizationApi->update_organization_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | Unique identifier of the Flat account | | +| **body** | [**UserAdminUpdate**](UserAdminUpdate.md) | | | + +### Return type + +[**UserDetailsAdmin**](UserDetailsAdmin.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/reference/OrganizationInvitation.md b/docs/reference/OrganizationInvitation.md new file mode 100644 index 0000000..42699fa --- /dev/null +++ b/docs/reference/OrganizationInvitation.md @@ -0,0 +1,36 @@ +# FlatApi::OrganizationInvitation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The invitation unique identifier | [optional] | +| **creation_date** | **Time** | The creation date of the invitation | [optional] | +| **organization** | **String** | The unique identifier of the Organization owning this class | | +| **organization_role** | [**OrganizationRoles**](OrganizationRoles.md) | | | +| **custom_code** | **String** | Enrollment code to use when joining this organization | | +| **email** | **String** | The email address this invitation was sent to | [optional] | +| **invited_by** | **String** | The unique identifier of the User who created this invitation | [optional] | +| **html_url** | **String** | URL to join the organization using this invitation | [optional] | +| **allow_multiple_use** | **Boolean** | If true, the invitation can be used multiple times. If false, the invitation can only be used once. | | +| **used_by** | **Array<String>** | List of users who used this invitation | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OrganizationInvitation.new( + id: null, + creation_date: null, + organization: null, + organization_role: null, + custom_code: null, + email: null, + invited_by: null, + html_url: null, + allow_multiple_use: null, + used_by: null +) +``` + diff --git a/docs/reference/OrganizationInvitationCreation.md b/docs/reference/OrganizationInvitationCreation.md new file mode 100644 index 0000000..a058ad9 --- /dev/null +++ b/docs/reference/OrganizationInvitationCreation.md @@ -0,0 +1,20 @@ +# FlatApi::OrganizationInvitationCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | The email address you want to send the invitation to | [optional] | +| **organization_role** | **String** | User's Organization Role | [optional][default to 'teacher'] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OrganizationInvitationCreation.new( + email: null, + organization_role: null +) +``` + diff --git a/docs/reference/OrganizationRoles.md b/docs/reference/OrganizationRoles.md new file mode 100644 index 0000000..8b9d118 --- /dev/null +++ b/docs/reference/OrganizationRoles.md @@ -0,0 +1,15 @@ +# FlatApi::OrganizationRoles + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OrganizationRoles.new() +``` + diff --git a/docs/reference/OrganizationUserAccessTokenCreation.md b/docs/reference/OrganizationUserAccessTokenCreation.md new file mode 100644 index 0000000..9acd5d7 --- /dev/null +++ b/docs/reference/OrganizationUserAccessTokenCreation.md @@ -0,0 +1,18 @@ +# FlatApi::OrganizationUserAccessTokenCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **scopes** | [**Array<AppScopes>**](AppScopes.md) | List of requested scopes for this credential | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::OrganizationUserAccessTokenCreation.new( + scopes: null +) +``` + diff --git a/docs/reference/RenameGroupRequest.md b/docs/reference/RenameGroupRequest.md new file mode 100644 index 0000000..c0ad7fd --- /dev/null +++ b/docs/reference/RenameGroupRequest.md @@ -0,0 +1,18 @@ +# FlatApi::RenameGroupRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | New name for the group | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::RenameGroupRequest.new( + name: null +) +``` + diff --git a/docs/reference/ResourceCollaborator.md b/docs/reference/ResourceCollaborator.md new file mode 100644 index 0000000..d2bd9d2 --- /dev/null +++ b/docs/reference/ResourceCollaborator.md @@ -0,0 +1,42 @@ +# FlatApi::ResourceCollaborator + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **acl_read** | **Boolean** | `True` if the current user can read the current document | [default to false] | +| **acl_write** | **Boolean** | `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** | **Boolean** | `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** | **Boolean** | `True` if the current user is a collaborator of the current document (direct or via group). | [optional][default to false] | +| **collaborator_type** | **String** | The type of the collaborator for the resource | [optional] | +| **id** | **String** | The unique identifier of the permission | [optional] | +| **date** | **Time** | The date when the permission was added | [optional] | +| **score** | **String** | If this object is a permission of a score, this property will contain the unique identifier of the score | [optional] | +| **collection** | **String** | If this object is a permission of a collection, this property will contain the unique identifier of the collection | [optional] | +| **user** | [**UserPublic**](UserPublic.md) | | [optional] | +| **group** | [**Group**](Group.md) | | [optional] | +| **user_email** | **String** | If the collaborator is not a user of Flat yet, this field will contain their email. | [optional] | +| **invited** | **Boolean** | If this property is `true`, this is still a pending invitation | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ResourceCollaborator.new( + acl_read: null, + acl_write: null, + acl_admin: null, + is_collaborator: null, + collaborator_type: null, + id: null, + date: null, + score: null, + collection: null, + user: null, + group: null, + user_email: null, + invited: null +) +``` + diff --git a/docs/reference/ResourceCollaboratorCreation.md b/docs/reference/ResourceCollaboratorCreation.md new file mode 100644 index 0000000..0d6e0aa --- /dev/null +++ b/docs/reference/ResourceCollaboratorCreation.md @@ -0,0 +1,30 @@ +# FlatApi::ResourceCollaboratorCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | The unique identifier of a Flat user | [optional] | +| **group** | **String** | The unique identifier of a Flat group | [optional] | +| **user_email** | **String** | Fill this field to invite an individual user by email. | [optional] | +| **user_token** | **String** | Token received in an invitation to join the score. | [optional] | +| **acl_read** | **Boolean** | `True` if the related user can read the score. (probably true if the user has a permission on the document). | [optional][default to true] | +| **acl_write** | **Boolean** | `True` if the related user can modify the score. | [optional][default to false] | +| **acl_admin** | **Boolean** | `True` if the related user can can manage the current document, i.e. changing the document permissions and deleting the document | [optional][default to false] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ResourceCollaboratorCreation.new( + user: null, + group: null, + user_email: null, + user_token: null, + acl_read: null, + acl_write: null, + acl_admin: null +) +``` + diff --git a/docs/reference/ResourceRights.md b/docs/reference/ResourceRights.md new file mode 100644 index 0000000..ef029cc --- /dev/null +++ b/docs/reference/ResourceRights.md @@ -0,0 +1,26 @@ +# FlatApi::ResourceRights + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **acl_read** | **Boolean** | `True` if the current user can read the current document | [default to false] | +| **acl_write** | **Boolean** | `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** | **Boolean** | `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** | **Boolean** | `True` if the current user is a collaborator of the current document (direct or via group). | [optional][default to false] | +| **collaborator_type** | **String** | The type of the collaborator for the resource | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ResourceRights.new( + acl_read: null, + acl_write: null, + acl_admin: null, + is_collaborator: null, + collaborator_type: null +) +``` + diff --git a/docs/reference/ScoreApi.md b/docs/reference/ScoreApi.md new file mode 100644 index 0000000..9bb77bf --- /dev/null +++ b/docs/reference/ScoreApi.md @@ -0,0 +1,2248 @@ +# FlatApi::ScoreApi + +All URIs are relative to *https://api.flat.io/v2* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**add_score_collaborator**](ScoreApi.md#add_score_collaborator) | **POST** /scores/{score}/collaborators | Add a new collaborator | +| [**add_score_track**](ScoreApi.md#add_score_track) | **POST** /scores/{score}/tracks | Add a new video or audio track to the score | +| [**create_export_task**](ScoreApi.md#create_export_task) | **POST** /scores/{score}/revisions/{revision}/{format}/task | Create a new score export task | +| [**create_score**](ScoreApi.md#create_score) | **POST** /scores | Create a new score | +| [**create_score_revision**](ScoreApi.md#create_score_revision) | **POST** /scores/{score}/revisions | Create a new revision | +| [**delete_score**](ScoreApi.md#delete_score) | **DELETE** /scores/{score} | Delete a score | +| [**delete_score_comment**](ScoreApi.md#delete_score_comment) | **DELETE** /scores/{score}/comments/{comment} | Delete a comment | +| [**delete_score_track**](ScoreApi.md#delete_score_track) | **DELETE** /scores/{score}/tracks/{track} | Remove an audio or video track linked to the score | +| [**edit_score**](ScoreApi.md#edit_score) | **PUT** /scores/{score} | Edit a score's metadata | +| [**fork_score**](ScoreApi.md#fork_score) | **POST** /scores/{score}/fork | Fork a score | +| [**get_group_scores**](ScoreApi.md#get_group_scores) | **GET** /groups/{group}/scores | List group's scores | +| [**get_score**](ScoreApi.md#get_score) | **GET** /scores/{score} | Get a score's metadata | +| [**get_score_collaborator**](ScoreApi.md#get_score_collaborator) | **GET** /scores/{score}/collaborators/{collaborator} | Get a collaborator | +| [**get_score_collaborators**](ScoreApi.md#get_score_collaborators) | **GET** /scores/{score}/collaborators | List the collaborators | +| [**get_score_comments**](ScoreApi.md#get_score_comments) | **GET** /scores/{score}/comments | List comments | +| [**get_score_revision**](ScoreApi.md#get_score_revision) | **GET** /scores/{score}/revisions/{revision} | Get a score revision | +| [**get_score_revision_data**](ScoreApi.md#get_score_revision_data) | **GET** /scores/{score}/revisions/{revision}/{format} | Get a score revision data | +| [**get_score_revisions**](ScoreApi.md#get_score_revisions) | **GET** /scores/{score}/revisions | List the revisions | +| [**get_score_submissions**](ScoreApi.md#get_score_submissions) | **GET** /scores/{score}/submissions | List submissions related to the score | +| [**get_score_track**](ScoreApi.md#get_score_track) | **GET** /scores/{score}/tracks/{track} | Retrieve the details of an audio or video track linked to a score | +| [**get_user_likes**](ScoreApi.md#get_user_likes) | **GET** /users/{user}/likes | List liked scores | +| [**get_user_scores**](ScoreApi.md#get_user_scores) | **GET** /users/{user}/scores | List user's scores | +| [**list_score_tracks**](ScoreApi.md#list_score_tracks) | **GET** /scores/{score}/tracks | List the audio or video tracks linked to a score | +| [**mark_score_comment_resolved**](ScoreApi.md#mark_score_comment_resolved) | **PUT** /scores/{score}/comments/{comment}/resolved | Mark the comment as resolved | +| [**mark_score_comment_unresolved**](ScoreApi.md#mark_score_comment_unresolved) | **DELETE** /scores/{score}/comments/{comment}/resolved | Mark the comment as unresolved | +| [**post_score_comment**](ScoreApi.md#post_score_comment) | **POST** /scores/{score}/comments | Post a new comment | +| [**remove_score_collaborator**](ScoreApi.md#remove_score_collaborator) | **DELETE** /scores/{score}/collaborators/{collaborator} | Delete a collaborator | +| [**untrash_score**](ScoreApi.md#untrash_score) | **POST** /scores/{score}/untrash | Untrash a score | +| [**update_score_comment**](ScoreApi.md#update_score_comment) | **PUT** /scores/{score}/comments/{comment} | Update an existing comment | +| [**update_score_track**](ScoreApi.md#update_score_track) | **PUT** /scores/{score}/tracks/{track} | Update an audio or video track linked to a score | + + +## add_score_collaborator + +> add_score_collaborator(score, body) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = FlatApi::ResourceCollaboratorCreation.new # ResourceCollaboratorCreation | + +begin + # Add a new collaborator + result = api_instance.add_score_collaborator(score, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->add_score_collaborator: #{e}" +end +``` + +#### Using the add_score_collaborator_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> add_score_collaborator_with_http_info(score, body) + +```ruby +begin + # Add a new collaborator + data, status_code, headers = api_instance.add_score_collaborator_with_http_info(score, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->add_score_collaborator_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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**](ResourceCollaboratorCreation.md) | | | + +### Return type + +[**ResourceCollaborator**](ResourceCollaborator.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## add_score_track + +> 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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = FlatApi::ScoreTrackCreation.new # ScoreTrackCreation | + +begin + # Add a new video or audio track to the score + result = api_instance.add_score_track(score, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->add_score_track: #{e}" +end +``` + +#### Using the add_score_track_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> add_score_track_with_http_info(score, body) + +```ruby +begin + # Add a new video or audio track to the score + data, status_code, headers = api_instance.add_score_track_with_http_info(score, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->add_score_track_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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**](ScoreTrackCreation.md) | | | + +### Return type + +[**ScoreTrackCreationResponse**](ScoreTrackCreationResponse.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_export_task + +> create_export_task(score, revision, format, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = 'revision_example' # String | Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. +format = 'mp3' # String | The format of the file that will be generated or the target service name where the file will be exported +opts = { + sharing_key: 'sharing_key_example', # String | 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. + body: FlatApi::TaskExportOptions.new # TaskExportOptions | +} + +begin + # Create a new score export task + result = api_instance.create_export_task(score, revision, format, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->create_export_task: #{e}" +end +``` + +#### Using the create_export_task_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_export_task_with_http_info(score, revision, format, opts) + +```ruby +begin + # Create a new score export task + data, status_code, headers = api_instance.create_export_task_with_http_info(score, revision, format, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->create_export_task_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. | | +| **format** | **String** | The format of the file that will be generated or the target service name where the file will be exported | | +| **sharing_key** | **String** | 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] | +| **body** | [**TaskExportOptions**](TaskExportOptions.md) | | [optional] | + +### Return type + +[**Task**](Task.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_score + +> create_score(body) + +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}`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +body = FlatApi::ScoreCreationBuilderData.new({builder_data: FlatApi::ScoreCreationBuilderDataAllOfBuilderData.new({score_data: FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData.new({instruments: [FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.new({group: 'group_example', instrument: 'instrument_example'})]})})}) # ScoreCreation | + +begin + # Create a new score + result = api_instance.create_score(body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->create_score: #{e}" +end +``` + +#### Using the create_score_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_score_with_http_info(body) + +```ruby +begin + # Create a new score + data, status_code, headers = api_instance.create_score_with_http_info(body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->create_score_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **body** | [**ScoreCreation**](ScoreCreation.md) | | | + +### Return type + +[**ScoreDetails**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_score_revision + +> create_score_revision(score, body) + +Create a new revision + +Update a score by uploading a new revision for this one. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = FlatApi::ScoreRevisionCreation.new({data: ''}) # ScoreRevisionCreation | + +begin + # Create a new revision + result = api_instance.create_score_revision(score, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->create_score_revision: #{e}" +end +``` + +#### Using the create_score_revision_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_score_revision_with_http_info(score, body) + +```ruby +begin + # Create a new revision + data, status_code, headers = api_instance.create_score_revision_with_http_info(score, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->create_score_revision_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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**](ScoreRevisionCreation.md) | | | + +### Return type + +[**ScoreRevision**](ScoreRevision.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_score + +> delete_score(score, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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`). +opts = { + now: true # Boolean | If `true`, the score deletion will be scheduled to be done ASAP +} + +begin + # Delete a score + api_instance.delete_score(score, opts) +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->delete_score: #{e}" +end +``` + +#### Using the delete_score_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_score_with_http_info(score, opts) + +```ruby +begin + # Delete a score + data, status_code, headers = api_instance.delete_score_with_http_info(score, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->delete_score_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **Boolean** | If `true`, the score deletion will be scheduled to be done ASAP | [optional][default to false] | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_score_comment + +> delete_score_comment(score, comment, opts) + +Delete a comment + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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' # String | Unique identifier of a sheet music comment +opts = { + event_properties: '{"context":"discover","screenLevel0":"home","screenRoute":"/discover"}', # String | Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Delete a comment + api_instance.delete_score_comment(score, comment, opts) +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->delete_score_comment: #{e}" +end +``` + +#### Using the delete_score_comment_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_score_comment_with_http_info(score, comment, opts) + +```ruby +begin + # Delete a comment + data, status_code, headers = api_instance.delete_score_comment_with_http_info(score, comment, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->delete_score_comment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a sheet music comment | | +| **event_properties** | **String** | 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** | **String** | 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 + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + + +## delete_score_track + +> delete_score_track(score, track) + +Remove an audio or video track linked to the score + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = 'track_example' # String | Unique identifier of a score audio track + +begin + # Remove an audio or video track linked to the score + api_instance.delete_score_track(score, track) +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->delete_score_track: #{e}" +end +``` + +#### Using the delete_score_track_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_score_track_with_http_info(score, track) + +```ruby +begin + # Remove an audio or video track linked to the score + data, status_code, headers = api_instance.delete_score_track_with_http_info(score, track) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->delete_score_track_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a score audio track | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## edit_score + +> edit_score(score, 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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = FlatApi::ScoreModification.new # ScoreModification | + +begin + # Edit a score's metadata + result = api_instance.edit_score(score, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->edit_score: #{e}" +end +``` + +#### Using the edit_score_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> edit_score_with_http_info(score, body) + +```ruby +begin + # Edit a score's metadata + data, status_code, headers = api_instance.edit_score_with_http_info(score, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->edit_score_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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**](ScoreModification.md) | | | + +### Return type + +[**ScoreDetails**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## fork_score + +> fork_score(score, body, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = FlatApi::ScoreFork.new # ScoreFork | +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Fork a score + result = api_instance.fork_score(score, body, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->fork_score: #{e}" +end +``` + +#### Using the fork_score_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> fork_score_with_http_info(score, body, opts) + +```ruby +begin + # Fork a score + data, status_code, headers = api_instance.fork_score_with_http_info(score, body, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->fork_score_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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**](ScoreFork.md) | | | +| **sharing_key** | **String** | 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 + +[**ScoreDetails**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_group_scores + +> > get_group_scores(group, opts) + +List group's scores + +Get the list of scores shared with a group. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +group = 'group_example' # String | Unique identifier of a Flat group +opts = { + parent: 'parent_example' # String | Filter the score forked from the score id `parent` +} + +begin + # List group's scores + result = api_instance.get_group_scores(group, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_group_scores: #{e}" +end +``` + +#### Using the get_group_scores_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_group_scores_with_http_info(group, opts) + +```ruby +begin + # List group's scores + data, status_code, headers = api_instance.get_group_scores_with_http_info(group, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_group_scores_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **group** | **String** | Unique identifier of a Flat group | | +| **parent** | **String** | Filter the score forked from the score id `parent` | [optional] | + +### Return type + +[**Array<ScoreDetails>**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_score + +> get_score(score, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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`). +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Get a score's metadata + result = api_instance.get_score(score, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score: #{e}" +end +``` + +#### Using the get_score_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_score_with_http_info(score, opts) + +```ruby +begin + # Get a score's metadata + data, status_code, headers = api_instance.get_score_with_http_info(score, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | 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 + +[**ScoreDetails**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_score_collaborator + +> get_score_collaborator(score, collaborator, opts) + +Get a collaborator + +Get the information about a collaborator (User or Group). + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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' # String | Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Get a collaborator + result = api_instance.get_score_collaborator(score, collaborator, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_collaborator: #{e}" +end +``` + +#### Using the get_score_collaborator_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_score_collaborator_with_http_info(score, collaborator, opts) + +```ruby +begin + # Get a collaborator + data, status_code, headers = api_instance.get_score_collaborator_with_http_info(score, collaborator, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_collaborator_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** | | +| **sharing_key** | **String** | 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 + +[**ResourceCollaborator**](ResourceCollaborator.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_score_collaborators + +> > get_score_collaborators(score, opts) + +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). + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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`). +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # List the collaborators + result = api_instance.get_score_collaborators(score, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_collaborators: #{e}" +end +``` + +#### Using the get_score_collaborators_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_score_collaborators_with_http_info(score, opts) + +```ruby +begin + # List the collaborators + data, status_code, headers = api_instance.get_score_collaborators_with_http_info(score, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_collaborators_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | 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 + +[**Array<ResourceCollaborator>**](ResourceCollaborator.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_score_comments + +> > get_score_comments(score, opts) + +List comments + +This method lists the different comments added on a music score (documents and inline) sorted by their post dates. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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`). +opts = { + type: 'document', # String | Filter the comments by type + sort: 'date', # String | Sort + direction: 'asc', # String | Sort direction + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # List comments + result = api_instance.get_score_comments(score, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_comments: #{e}" +end +``` + +#### Using the get_score_comments_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_score_comments_with_http_info(score, opts) + +```ruby +begin + # List comments + data, status_code, headers = api_instance.get_score_comments_with_http_info(score, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_comments_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Filter the comments by type | [optional] | +| **sort** | **String** | Sort | [optional] | +| **direction** | **String** | Sort direction | [optional] | +| **sharing_key** | **String** | 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 + +[**Array<ScoreComment>**](ScoreComment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_score_revision + +> get_score_revision(score, revision, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = 'revision_example' # String | Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Get a score revision + result = api_instance.get_score_revision(score, revision, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_revision: #{e}" +end +``` + +#### Using the get_score_revision_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_score_revision_with_http_info(score, revision, opts) + +```ruby +begin + # Get a score revision + data, status_code, headers = api_instance.get_score_revision_with_http_info(score, revision, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_revision_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. | | +| **sharing_key** | **String** | 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 + +[**ScoreRevision**](ScoreRevision.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_score_revision_data + +> File get_score_revision_data(score, revision, format, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = 'revision_example' # String | Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. +format = 'json' # String | The format of the file you will retrieve +opts = { + sharing_key: 'sharing_key_example', # String | 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. + parts: 'parts_example', # String | 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\". + default_track: true, # Boolean | 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. + url: true # Boolean | Returns a json with the `url` in it instead of redirecting +} + +begin + # Get a score revision data + result = api_instance.get_score_revision_data(score, revision, format, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_revision_data: #{e}" +end +``` + +#### Using the get_score_revision_data_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> get_score_revision_data_with_http_info(score, revision, format, opts) + +```ruby +begin + # Get a score revision data + data, status_code, headers = api_instance.get_score_revision_data_with_http_info(score, revision, format, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => File +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_revision_data_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. | | +| **format** | **String** | The format of the file you will retrieve | | +| **sharing_key** | **String** | 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] | +| **parts** | **String** | 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\". | [optional] | +| **default_track** | **Boolean** | 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. | [optional] | +| **url** | **Boolean** | Returns a json with the `url` in it instead of redirecting | [optional] | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### 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, application/octet-stream + + +## get_score_revisions + +> > get_score_revisions(score, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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`). +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # List the revisions + result = api_instance.get_score_revisions(score, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_revisions: #{e}" +end +``` + +#### Using the get_score_revisions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_score_revisions_with_http_info(score, opts) + +```ruby +begin + # List the revisions + data, status_code, headers = api_instance.get_score_revisions_with_http_info(score, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_revisions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | 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 + +[**Array<ScoreRevision>**](ScoreRevision.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_score_submissions + +> > get_score_submissions(score) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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`). + +begin + # List submissions related to the score + result = api_instance.get_score_submissions(score) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_submissions: #{e}" +end +``` + +#### Using the get_score_submissions_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_score_submissions_with_http_info(score) + +```ruby +begin + # List submissions related to the score + data, status_code, headers = api_instance.get_score_submissions_with_http_info(score) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_submissions_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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`). | | + +### Return type + +[**Array<AssignmentSubmission>**](AssignmentSubmission.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_score_track + +> get_score_track(score, track, opts) + +Retrieve the details of an audio or video track linked to a score + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = 'track_example' # String | Unique identifier of a score audio track +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Retrieve the details of an audio or video track linked to a score + result = api_instance.get_score_track(score, track, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_track: #{e}" +end +``` + +#### Using the get_score_track_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_score_track_with_http_info(score, track, opts) + +```ruby +begin + # Retrieve the details of an audio or video track linked to a score + data, status_code, headers = api_instance.get_score_track_with_http_info(score, track, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_score_track_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a score audio track | | +| **sharing_key** | **String** | 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 + +[**ScoreTrack**](ScoreTrack.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_user_likes + +> > get_user_likes(user, opts) + +List liked scores + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +user = 'user_example' # String | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. +opts = { + _next: '_next_example', # String | 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. + previous: 'previous_example', # String | 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. + limit: 56, # Integer | This is the maximum number of objects that may be returned + ids: true # Boolean | Return only the identifiers of the scores +} + +begin + # List liked scores + result = api_instance.get_user_likes(user, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_user_likes: #{e}" +end +``` + +#### Using the get_user_likes_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_user_likes_with_http_info(user, opts) + +```ruby +begin + # List liked scores + data, status_code, headers = api_instance.get_user_likes_with_http_info(user, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_user_likes_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. | | +| **_next** | **String** | 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** | **String** | 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] | +| **limit** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 25] | +| **ids** | **Boolean** | Return only the identifiers of the scores | [optional] | + +### Return type + +[**Array<ScoreDetails>**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_user_scores + +> > get_user_scores(user, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +user = 'user_example' # String | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. +opts = { + paginate: true, # Boolean | 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. + sort: 'creationDate', # String | Sort + direction: 'asc', # String | Sort direction + limit: 56, # Integer | This is the maximum number of objects that may be returned + _next: '_next_example', # String | 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. + previous: 'previous_example' # String | 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. +} + +begin + # List user's scores + result = api_instance.get_user_scores(user, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_user_scores: #{e}" +end +``` + +#### Using the get_user_scores_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_user_scores_with_http_info(user, opts) + +```ruby +begin + # List user's scores + data, status_code, headers = api_instance.get_user_scores_with_http_info(user, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->get_user_scores_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. | | +| **paginate** | **Boolean** | 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** | **String** | Sort | [optional] | +| **direction** | **String** | Sort direction | [optional] | +| **limit** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 25] | +| **_next** | **String** | 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** | **String** | 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 + +[**Array<ScoreDetails>**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## list_score_tracks + +> > list_score_tracks(score, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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`). +opts = { + sharing_key: 'sharing_key_example', # String | 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. + assignment: 'assignment_example', # String | An assignment id with which all the tracks returned will be related to + list_auto_track: true # Boolean | If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track +} + +begin + # List the audio or video tracks linked to a score + result = api_instance.list_score_tracks(score, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->list_score_tracks: #{e}" +end +``` + +#### Using the list_score_tracks_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> list_score_tracks_with_http_info(score, opts) + +```ruby +begin + # List the audio or video tracks linked to a score + data, status_code, headers = api_instance.list_score_tracks_with_http_info(score, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->list_score_tracks_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | 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] | +| **assignment** | **String** | An assignment id with which all the tracks returned will be related to | [optional] | +| **list_auto_track** | **Boolean** | If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track | [optional] | + +### Return type + +[**Array<ScoreTrack>**](ScoreTrack.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## mark_score_comment_resolved + +> mark_score_comment_resolved(score, comment, opts) + +Mark the comment as resolved + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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' # String | Unique identifier of a sheet music comment +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Mark the comment as resolved + api_instance.mark_score_comment_resolved(score, comment, opts) +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->mark_score_comment_resolved: #{e}" +end +``` + +#### Using the mark_score_comment_resolved_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> mark_score_comment_resolved_with_http_info(score, comment, opts) + +```ruby +begin + # Mark the comment as resolved + data, status_code, headers = api_instance.mark_score_comment_resolved_with_http_info(score, comment, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->mark_score_comment_resolved_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a sheet music comment | | +| **sharing_key** | **String** | 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 + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## mark_score_comment_unresolved + +> mark_score_comment_unresolved(score, comment, opts) + +Mark the comment as unresolved + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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' # String | Unique identifier of a sheet music comment +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Mark the comment as unresolved + api_instance.mark_score_comment_unresolved(score, comment, opts) +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->mark_score_comment_unresolved: #{e}" +end +``` + +#### Using the mark_score_comment_unresolved_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> mark_score_comment_unresolved_with_http_info(score, comment, opts) + +```ruby +begin + # Mark the comment as unresolved + data, status_code, headers = api_instance.mark_score_comment_unresolved_with_http_info(score, comment, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->mark_score_comment_unresolved_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a sheet music comment | | +| **sharing_key** | **String** | 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 + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## post_score_comment + +> post_score_comment(score, body, opts) + +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`. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = FlatApi::ScoreCommentCreation.new({comment: 'comment_example'}) # ScoreCommentCreation | +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Post a new comment + result = api_instance.post_score_comment(score, body, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->post_score_comment: #{e}" +end +``` + +#### Using the post_score_comment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> post_score_comment_with_http_info(score, body, opts) + +```ruby +begin + # Post a new comment + data, status_code, headers = api_instance.post_score_comment_with_http_info(score, body, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->post_score_comment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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**](ScoreCommentCreation.md) | | | +| **sharing_key** | **String** | 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 + +[**ScoreComment**](ScoreComment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## remove_score_collaborator + +> remove_score_collaborator(score, collaborator, opts) + +Delete a collaborator + +Remove the specified collaborator from the score + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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' # String | Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** +opts = { + event_properties: '{"context":"discover","screenLevel0":"home","screenRoute":"/discover"}' # String | Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` +} + +begin + # Delete a collaborator + api_instance.remove_score_collaborator(score, collaborator, opts) +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->remove_score_collaborator: #{e}" +end +``` + +#### Using the remove_score_collaborator_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> remove_score_collaborator_with_http_info(score, collaborator, opts) + +```ruby +begin + # Delete a collaborator + data, status_code, headers = api_instance.remove_score_collaborator_with_http_info(score, collaborator, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->remove_score_collaborator_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** | | +| **event_properties** | **String** | 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 + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + + +## untrash_score + +> untrash_score(score) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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`). + +begin + # Untrash a score + api_instance.untrash_score(score) +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->untrash_score: #{e}" +end +``` + +#### Using the untrash_score_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> untrash_score_with_http_info(score) + +```ruby +begin + # Untrash a score + data, status_code, headers = api_instance.untrash_score_with_http_info(score) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->untrash_score_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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`). | | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_score_comment + +> update_score_comment(score, comment, body, opts) + +Update an existing comment + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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' # String | Unique identifier of a sheet music comment +body = FlatApi::ScoreCommentUpdate.new # ScoreCommentUpdate | +opts = { + sharing_key: 'sharing_key_example' # String | 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. +} + +begin + # Update an existing comment + result = api_instance.update_score_comment(score, comment, body, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->update_score_comment: #{e}" +end +``` + +#### Using the update_score_comment_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_score_comment_with_http_info(score, comment, body, opts) + +```ruby +begin + # Update an existing comment + data, status_code, headers = api_instance.update_score_comment_with_http_info(score, comment, body, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->update_score_comment_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a sheet music comment | | +| **body** | [**ScoreCommentUpdate**](ScoreCommentUpdate.md) | | | +| **sharing_key** | **String** | 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 + +[**ScoreComment**](ScoreComment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_score_track + +> update_score_track(score, track, body) + +Update an audio or video track linked to a score + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::ScoreApi.new +score = 'score_example' # String | 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 = 'track_example' # String | Unique identifier of a score audio track +body = FlatApi::ScoreTrackUpdate.new # ScoreTrackUpdate | + +begin + # Update an audio or video track linked to a score + result = api_instance.update_score_track(score, track, body) + p result +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->update_score_track: #{e}" +end +``` + +#### Using the update_score_track_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_score_track_with_http_info(score, track, body) + +```ruby +begin + # Update an audio or video track linked to a score + data, status_code, headers = api_instance.update_score_track_with_http_info(score, track, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling ScoreApi->update_score_track_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score** | **String** | 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** | **String** | Unique identifier of a score audio track | | +| **body** | [**ScoreTrackUpdate**](ScoreTrackUpdate.md) | | | + +### Return type + +[**ScoreTrack**](ScoreTrack.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/reference/ScoreComment.md b/docs/reference/ScoreComment.md new file mode 100644 index 0000000..6e8071a --- /dev/null +++ b/docs/reference/ScoreComment.md @@ -0,0 +1,48 @@ +# FlatApi::ScoreComment + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The comment unique identifier | | +| **type** | **String** | The type of the comment | | +| **user** | **String** | The author unique identifier | | +| **score** | **String** | The unique identifier of the score where the comment was posted | | +| **revision** | **String** | The unique identifier of revision the comment was posted | [optional] | +| **reply_to** | **String** | When the comment is a reply to another comment, the unique identifier of the parent comment | [optional] | +| **date** | **Time** | The date when the comment was posted | | +| **modification_date** | **Time** | The date of the last comment modification | [optional] | +| **comment** | **String** | The comment text that can includes mentions using the following format: `@[id:username]`. | | +| **raw_comment** | **String** | A raw version of the comment, that can be displayed without parsing the mentions. | | +| **context** | [**ScoreCommentContext**](ScoreCommentContext.md) | | [optional] | +| **mentions** | **Array<String>** | The list of user identifier mentioned on the score | [optional] | +| **resolved** | **Boolean** | For inline comments, the comment can be marked as resolved and will be hidden in the future responses | [optional] | +| **resolved_by** | **String** | If the user is marked as resolved, this will contain the unique identifier of the User who marked this comment as resolved | [optional] | +| **moderation** | [**ScoreCommentModeration**](ScoreCommentModeration.md) | | [optional] | +| **spam** | **Boolean** | `true if the message has been detected as spam and hidden from other users | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreComment.new( + id: null, + type: null, + user: null, + score: null, + revision: null, + reply_to: null, + date: null, + modification_date: null, + comment: null, + raw_comment: null, + context: null, + mentions: null, + resolved: null, + resolved_by: null, + moderation: null, + spam: null +) +``` + diff --git a/docs/reference/ScoreCommentContext.md b/docs/reference/ScoreCommentContext.md new file mode 100644 index 0000000..c8f3fd9 --- /dev/null +++ b/docs/reference/ScoreCommentContext.md @@ -0,0 +1,32 @@ +# FlatApi::ScoreCommentContext + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **part_uuid** | **String** | The unique identifier (UUID) of the score part | | +| **staff_idx** | **Float** | (Deprecated, use `staffUuid`) The identififer of the staff | [optional] | +| **staff_uuid** | **String** | The unique identififer (UUID) of the staff | [optional] | +| **measure_uuids** | **Array<String>** | The list of measure UUIds | | +| **start_time_pos** | **Float** | | | +| **stop_time_pos** | **Float** | | | +| **start_dpq** | **Float** | | | +| **stop_dpq** | **Float** | | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCommentContext.new( + part_uuid: null, + staff_idx: null, + staff_uuid: null, + measure_uuids: null, + start_time_pos: null, + stop_time_pos: null, + start_dpq: null, + stop_dpq: null +) +``` + diff --git a/docs/reference/ScoreCommentCreation.md b/docs/reference/ScoreCommentCreation.md new file mode 100644 index 0000000..9c76141 --- /dev/null +++ b/docs/reference/ScoreCommentCreation.md @@ -0,0 +1,28 @@ +# FlatApi::ScoreCommentCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **revision** | **String** | 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** | **String** | The comment text that can includes mentions using the following format: `@[id:username]`. | | +| **raw_comment** | **String** | A raw version of the comment, that can be displayed without the mentions. If you use mentions, this property must be set. | [optional] | +| **mentions** | **Array<String>** | The list of user identifiers mentioned in this comment | [optional] | +| **reply_to** | **String** | When the comment is a reply to another comment, the unique identifier of the parent comment | [optional] | +| **context** | [**ScoreCommentContext**](ScoreCommentContext.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCommentCreation.new( + revision: null, + comment: null, + raw_comment: null, + mentions: null, + reply_to: null, + context: null +) +``` + diff --git a/docs/reference/ScoreCommentModeration.md b/docs/reference/ScoreCommentModeration.md new file mode 100644 index 0000000..54fcc65 --- /dev/null +++ b/docs/reference/ScoreCommentModeration.md @@ -0,0 +1,20 @@ +# FlatApi::ScoreCommentModeration + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **hidden** | **Boolean** | If true, this comment will be hidden from other users | [optional] | +| **reason** | **String** | If the comment is hidden, the reason why this one has been moderated | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCommentModeration.new( + hidden: null, + reason: null +) +``` + diff --git a/docs/reference/ScoreCommentUpdate.md b/docs/reference/ScoreCommentUpdate.md new file mode 100644 index 0000000..7a33380 --- /dev/null +++ b/docs/reference/ScoreCommentUpdate.md @@ -0,0 +1,24 @@ +# FlatApi::ScoreCommentUpdate + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **revision** | **String** | 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** | **String** | The comment text that can includes mentions using the following format: `@[id:username]`. | [optional] | +| **raw_comment** | **String** | 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] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCommentUpdate.new( + revision: null, + comment: null, + raw_comment: null, + context: null +) +``` + diff --git a/docs/reference/ScoreCommentsCounts.md b/docs/reference/ScoreCommentsCounts.md new file mode 100644 index 0000000..9b44c44 --- /dev/null +++ b/docs/reference/ScoreCommentsCounts.md @@ -0,0 +1,26 @@ +# FlatApi::ScoreCommentsCounts + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **total** | **Float** | The total number of comments added to the score | [optional] | +| **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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCommentsCounts.new( + total: null, + unique: null, + weekly: null, + monthly: null, + yearly: null +) +``` + diff --git a/docs/reference/ScoreCreation.md b/docs/reference/ScoreCreation.md new file mode 100644 index 0000000..6267ff7 --- /dev/null +++ b/docs/reference/ScoreCreation.md @@ -0,0 +1,51 @@ +# FlatApi::ScoreCreation + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::ScoreCreation.openapi_one_of +# => +# [ +# :'ScoreCreationBuilderData', +# :'ScoreCreationFileImport', +# :'ScoreCreationGoogleDriveImport' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'flat_api' + +FlatApi::ScoreCreation.build(data) +# => # + +FlatApi::ScoreCreation.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `ScoreCreationBuilderData` +- `ScoreCreationFileImport` +- `ScoreCreationGoogleDriveImport` +- `nil` (if no type matches) + diff --git a/docs/reference/ScoreCreationBuilderData.md b/docs/reference/ScoreCreationBuilderData.md new file mode 100644 index 0000000..52a303d --- /dev/null +++ b/docs/reference/ScoreCreationBuilderData.md @@ -0,0 +1,26 @@ +# FlatApi::ScoreCreationBuilderData + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | 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 'private'] | +| **collection** | **String** | 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** | **String** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCreationBuilderData.new( + title: null, + privacy: null, + collection: null, + google_drive_folder: null, + builder_data: null +) +``` + diff --git a/docs/reference/ScoreCreationBuilderDataAllOfBuilderData.md b/docs/reference/ScoreCreationBuilderDataAllOfBuilderData.md new file mode 100644 index 0000000..b00d870 --- /dev/null +++ b/docs/reference/ScoreCreationBuilderDataAllOfBuilderData.md @@ -0,0 +1,20 @@ +# FlatApi::ScoreCreationBuilderDataAllOfBuilderData + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **score_data** | [**ScoreCreationBuilderDataAllOfBuilderDataScoreData**](ScoreCreationBuilderDataAllOfBuilderDataScoreData.md) | | | +| **layout_data** | [**ScoreCreationBuilderDataAllOfBuilderDataLayoutData**](ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCreationBuilderDataAllOfBuilderData.new( + score_data: null, + layout_data: null +) +``` + diff --git a/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md new file mode 100644 index 0000000..4997d35 --- /dev/null +++ b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md @@ -0,0 +1,32 @@ +# FlatApi::ScoreCreationBuilderDataAllOfBuilderDataLayoutData + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **notes_spacing_coeff** | **Float** | A float value >= 1 that controls the spacing between notes. | [optional] | +| **length_unit** | **String** | The unit to use for layout customizations | [optional][default to 'cm'] | +| **page_height** | **Float** | The height of the page in chosen unit (`lengthUnit`). | [optional] | +| **page_width** | **Float** | The width of the page in chosen unit (`lengthUnit`). | [optional] | +| **page_margin_top** | **Float** | The top margin of the page in chosen unit (`lengthUnit`). | [optional] | +| **page_margin_bottom** | **Float** | The bottom margin of the page in chosen unit (`lengthUnit`). | [optional] | +| **page_margin_left** | **Float** | The left margin of the page in chosen unit (`lengthUnit`). | [optional] | +| **page_margin_right** | **Float** | The right margin of the page in chosen unit (`lengthUnit`). | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCreationBuilderDataAllOfBuilderDataLayoutData.new( + notes_spacing_coeff: null, + length_unit: null, + page_height: null, + page_width: null, + page_margin_top: null, + page_margin_bottom: null, + page_margin_left: null, + page_margin_right: null +) +``` + diff --git a/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreData.md b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreData.md new file mode 100644 index 0000000..60ea6f5 --- /dev/null +++ b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreData.md @@ -0,0 +1,28 @@ +# FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **use_tab_staff** | **Boolean** | true if the TAB staff is displayed with fretted instruments | [optional] | +| **use_chord_grid** | **Boolean** | 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** | [**Array<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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData.new( + use_tab_staff: null, + use_chord_grid: null, + fifths: null, + nb_beats: null, + beat_type: null, + instruments: null +) +``` + diff --git a/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md new file mode 100644 index 0000000..425abb1 --- /dev/null +++ b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md @@ -0,0 +1,26 @@ +# FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **group** | **String** | The of the instrument group (e.g. `keyboards`, `brass`) | | +| **instrument** | **String** | The identifier of the instrument (e.g. `piano`, `trumpet`) | | +| **long_name** | **String** | The full name of the instrument | [optional] | +| **short_name** | **String** | The abbreviation of the name of the instrument | [optional] | +| **has_quarter_tone** | **Boolean** | True if the part can use quarter tone (prevent the part to have a TAB/chord grid) | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.new( + group: null, + instrument: null, + long_name: null, + short_name: null, + has_quarter_tone: null +) +``` + diff --git a/docs/reference/ScoreCreationCommon.md b/docs/reference/ScoreCreationCommon.md new file mode 100644 index 0000000..71ecf9c --- /dev/null +++ b/docs/reference/ScoreCreationCommon.md @@ -0,0 +1,24 @@ +# FlatApi::ScoreCreationCommon + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | 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 'private'] | +| **collection** | **String** | 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** | **String** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCreationCommon.new( + title: null, + privacy: null, + collection: null, + google_drive_folder: null +) +``` + diff --git a/docs/reference/ScoreCreationFileImport.md b/docs/reference/ScoreCreationFileImport.md new file mode 100644 index 0000000..7ed3f47 --- /dev/null +++ b/docs/reference/ScoreCreationFileImport.md @@ -0,0 +1,32 @@ +# FlatApi::ScoreCreationFileImport + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | 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 'private'] | +| **collection** | **String** | 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** | **String** | 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** | **String** | If this is an imported file, its filename | [optional] | +| **data** | **String** | 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** | **String** | The optional encoding of the score data. This property must match the encoding used for the `data` property. | [optional] | +| **supports_tasks** | **Boolean** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCreationFileImport.new( + title: null, + privacy: null, + collection: null, + google_drive_folder: null, + filename: null, + data: null, + data_encoding: null, + supports_tasks: null +) +``` + diff --git a/docs/reference/ScoreCreationGoogleDriveImport.md b/docs/reference/ScoreCreationGoogleDriveImport.md new file mode 100644 index 0000000..fbd8225 --- /dev/null +++ b/docs/reference/ScoreCreationGoogleDriveImport.md @@ -0,0 +1,26 @@ +# FlatApi::ScoreCreationGoogleDriveImport + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | 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 'private'] | +| **collection** | **String** | 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** | **String** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCreationGoogleDriveImport.new( + title: null, + privacy: null, + collection: null, + google_drive_folder: null, + source: null +) +``` + diff --git a/docs/reference/ScoreCreationType.md b/docs/reference/ScoreCreationType.md new file mode 100644 index 0000000..d65ac18 --- /dev/null +++ b/docs/reference/ScoreCreationType.md @@ -0,0 +1,15 @@ +# FlatApi::ScoreCreationType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreCreationType.new() +``` + diff --git a/docs/reference/ScoreDetails.md b/docs/reference/ScoreDetails.md new file mode 100644 index 0000000..4f02d17 --- /dev/null +++ b/docs/reference/ScoreDetails.md @@ -0,0 +1,94 @@ +# FlatApi::ScoreDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the score | | +| **sharing_key** | **String** | The private sharing key of the score (available when the `privacy` mode is set to `privateLink`) | [optional] | +| **title** | **String** | The title of the score | | +| **privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [default to 'private'] | +| **user** | [**UserPublic**](UserPublic.md) | | | +| **html_url** | **String** | The url where the score can be viewed in a web browser | | +| **edit_html_url** | **String** | The url where the score can be edited in a web browser | | +| **subtitle** | **String** | Subtitle of the score | [optional] | +| **lyricist** | **String** | Lyricist of the score | [optional] | +| **arranger** | **String** | Arranger of the score | [optional] | +| **composer** | **String** | Composer of the score | [optional] | +| **description** | **String** | Description of the creation | [optional] | +| **tags** | **Array<String>** | Tags describing the score | [optional] | +| **creation_type** | [**ScoreCreationType**](ScoreCreationType.md) | | [optional] | +| **license** | [**ScoreLicense**](ScoreLicense.md) | | [optional] | +| **license_text** | **String** | Additional license text written on the exported/printed score | [optional] | +| **duration_time** | **Float** | In seconds, an approximative duration of the score | [optional] | +| **number_measures** | **Integer** | The number of measures in the score | [optional] | +| **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** | [**Array<ResourceCollaborator>**](ResourceCollaborator.md) | The list of the collaborators of the score | | +| **creation_date** | **Time** | The date when the score was created | | +| **modification_date** | **Time** | The date of the last revision of the score | [optional] | +| **publication_date** | **Time** | The date when the score was published on Flat | [optional] | +| **scheduled_deletion_date** | **Time** | 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** | **Time** | The date when the score was highlighted (featured) on our community | [optional] | +| **organization** | **String** | 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** | **String** | If the score has been forked, the unique identifier of the parent score. | [optional] | +| **instruments** | **Array<String>** | 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** | **Array<String>** | 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** | **Array<String>** | 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** | **String** | 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** | **Array<String>** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreDetails.new( + id: null, + sharing_key: null, + title: null, + privacy: null, + user: null, + html_url: null, + edit_html_url: null, + subtitle: null, + lyricist: null, + arranger: null, + composer: null, + description: null, + tags: null, + creation_type: null, + license: null, + license_text: null, + duration_time: null, + number_measures: null, + main_tempo_qpm: null, + main_key_signature: null, + rights: null, + collaborators: null, + creation_date: null, + modification_date: null, + publication_date: null, + scheduled_deletion_date: null, + highlighted_date: null, + organization: null, + parent_score: null, + instruments: null, + instruments_names: null, + samples: null, + google_drive_file_id: null, + likes: null, + comments: null, + views: null, + plays: null, + collections: null, + me: null +) +``` + diff --git a/docs/reference/ScoreDetailsAllOfMe.md b/docs/reference/ScoreDetailsAllOfMe.md new file mode 100644 index 0000000..ee63812 --- /dev/null +++ b/docs/reference/ScoreDetailsAllOfMe.md @@ -0,0 +1,20 @@ +# FlatApi::ScoreDetailsAllOfMe + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **is_liked** | **Boolean** | True if the current user likes this score | | +| **is_in_library** | **Boolean** | True if the score is stored in one of the user's collections | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreDetailsAllOfMe.new( + is_liked: null, + is_in_library: null +) +``` + diff --git a/docs/reference/ScoreFork.md b/docs/reference/ScoreFork.md new file mode 100644 index 0000000..91dcd83 --- /dev/null +++ b/docs/reference/ScoreFork.md @@ -0,0 +1,22 @@ +# FlatApi::ScoreFork + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **collection** | **String** | 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** | **Boolean** | If set to `true`, the API won't create the score on Google Drive | [optional][default to false] | +| **keep_original_title** | **Boolean** | 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] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreFork.new( + collection: null, + google_drive_disabled: null, + keep_original_title: null +) +``` + diff --git a/docs/reference/ScoreLicense.md b/docs/reference/ScoreLicense.md new file mode 100644 index 0000000..2653fc9 --- /dev/null +++ b/docs/reference/ScoreLicense.md @@ -0,0 +1,15 @@ +# FlatApi::ScoreLicense + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreLicense.new() +``` + diff --git a/docs/reference/ScoreLikesCounts.md b/docs/reference/ScoreLikesCounts.md new file mode 100644 index 0000000..e62bf69 --- /dev/null +++ b/docs/reference/ScoreLikesCounts.md @@ -0,0 +1,24 @@ +# FlatApi::ScoreLikesCounts + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreLikesCounts.new( + total: null, + weekly: null, + monthly: null, + yearly: null +) +``` + diff --git a/docs/reference/ScoreModification.md b/docs/reference/ScoreModification.md new file mode 100644 index 0000000..8802f54 --- /dev/null +++ b/docs/reference/ScoreModification.md @@ -0,0 +1,40 @@ +# FlatApi::ScoreModification + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | The title of the score | [optional] | +| **subtitle** | **String** | The subtitle of the score | [optional] | +| **composer** | **String** | The composer of the score | [optional] | +| **lyricist** | **String** | The lyricist of the score | [optional] | +| **arranger** | **String** | The arranger of the score | [optional] | +| **privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional][default to 'private'] | +| **sharing_key** | **String** | 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** | **String** | Description of the creation | [optional] | +| **tags** | **Array<String>** | Tags describing the score | [optional] | +| **creation_type** | [**ScoreCreationType**](ScoreCreationType.md) | | [optional] | +| **license** | [**ScoreLicense**](ScoreLicense.md) | | [optional] | +| **license_text** | **String** | The rights info written on the score | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreModification.new( + title: null, + subtitle: null, + composer: null, + lyricist: null, + arranger: null, + privacy: null, + sharing_key: null, + description: null, + tags: null, + creation_type: null, + license: null, + license_text: null +) +``` + diff --git a/docs/reference/ScorePlaysCounts.md b/docs/reference/ScorePlaysCounts.md new file mode 100644 index 0000000..d392648 --- /dev/null +++ b/docs/reference/ScorePlaysCounts.md @@ -0,0 +1,24 @@ +# FlatApi::ScorePlaysCounts + +## Properties + +| 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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScorePlaysCounts.new( + total: null, + weekly: null, + monthly: null, + yearly: null +) +``` + diff --git a/docs/reference/ScorePrivacy.md b/docs/reference/ScorePrivacy.md new file mode 100644 index 0000000..bcc4bf1 --- /dev/null +++ b/docs/reference/ScorePrivacy.md @@ -0,0 +1,15 @@ +# FlatApi::ScorePrivacy + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScorePrivacy.new() +``` + diff --git a/docs/reference/ScoreRevision.md b/docs/reference/ScoreRevision.md new file mode 100644 index 0000000..784b890 --- /dev/null +++ b/docs/reference/ScoreRevision.md @@ -0,0 +1,34 @@ +# FlatApi::ScoreRevision + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the revision. | | +| **user** | **String** | The user identifier who created the revision | [optional] | +| **score** | **String** | The score identifier | | +| **collaborators** | **Array<String>** | | [optional] | +| **date** | **Time** | The date when this revision was created | | +| **event** | **String** | The last event (action id) of the revision | [optional] | +| **description** | **String** | A description associated to the revision | [optional] | +| **autosave** | **Boolean** | True if this revision was automatically generated by Flat and not on purpose by the user. | [optional] | +| **statistics** | [**ScoreRevisionStatistics**](ScoreRevisionStatistics.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreRevision.new( + id: null, + user: null, + score: null, + collaborators: null, + date: null, + event: null, + description: null, + autosave: null, + statistics: null +) +``` + diff --git a/docs/reference/ScoreRevisionCreation.md b/docs/reference/ScoreRevisionCreation.md new file mode 100644 index 0000000..9d30ac9 --- /dev/null +++ b/docs/reference/ScoreRevisionCreation.md @@ -0,0 +1,24 @@ +# FlatApi::ScoreRevisionCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **data** | **String** | 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** | **String** | The optional encoding of the score data. This property must match the encoding used for the `data` property. | [optional] | +| **autosave** | **Boolean** | Must be set to `true` if the revision was created automatically. | [optional] | +| **description** | **String** | A description associated to the revision | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreRevisionCreation.new( + data: <score-partwise version="3.0"></score-partwise>, + data_encoding: null, + autosave: null, + description: null +) +``` + diff --git a/docs/reference/ScoreRevisionStatistics.md b/docs/reference/ScoreRevisionStatistics.md new file mode 100644 index 0000000..cb21656 --- /dev/null +++ b/docs/reference/ScoreRevisionStatistics.md @@ -0,0 +1,24 @@ +# FlatApi::ScoreRevisionStatistics + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **additions** | **Float** | The number of additions operations in the last revision | [optional] | +| **deletions** | **Float** | The number of deletions operations in the last revision | [optional] | +| **start_date** | **Time** | The date of the first action included in this revision | [optional] | +| **end_date** | **Time** | The date of the latest action included in this revision | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreRevisionStatistics.new( + additions: null, + deletions: null, + start_date: null, + end_date: null +) +``` + diff --git a/docs/reference/ScoreSource.md b/docs/reference/ScoreSource.md new file mode 100644 index 0000000..a7a2271 --- /dev/null +++ b/docs/reference/ScoreSource.md @@ -0,0 +1,18 @@ +# FlatApi::ScoreSource + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **google_drive** | **String** | 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. | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreSource.new( + google_drive: null +) +``` + diff --git a/docs/reference/ScoreSummary.md b/docs/reference/ScoreSummary.md new file mode 100644 index 0000000..98c38a2 --- /dev/null +++ b/docs/reference/ScoreSummary.md @@ -0,0 +1,28 @@ +# FlatApi::ScoreSummary + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the score | | +| **sharing_key** | **String** | The private sharing key of the score (available when the `privacy` mode is set to `privateLink`) | [optional] | +| **title** | **String** | The title of the score | | +| **privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [default to 'private'] | +| **user** | [**UserPublic**](UserPublic.md) | | | +| **html_url** | **String** | The url where the score can be viewed in a web browser | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreSummary.new( + id: null, + sharing_key: null, + title: null, + privacy: null, + user: null, + html_url: null +) +``` + diff --git a/docs/reference/ScoreTrack.md b/docs/reference/ScoreTrack.md new file mode 100644 index 0000000..c4edff8 --- /dev/null +++ b/docs/reference/ScoreTrack.md @@ -0,0 +1,42 @@ +# FlatApi::ScoreTrack + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the score track | | +| **title** | **String** | Title of the track | [optional] | +| **score** | **String** | The unique identifier of the score. Absent for Free Record performance submissions, which are recorded without an attached score. | [optional] | +| **creator** | **String** | The unique identifier of the track creator | | +| **creation_date** | **Time** | The creation date of the track | | +| **modification_date** | **Time** | The modification date of the track | | +| **default** | **Boolean** | True if the track should be used as default audio source | | +| **state** | [**ScoreTrackState**](ScoreTrackState.md) | | [default to 'draft'] | +| **type** | [**ScoreTrackType**](ScoreTrackType.md) | | | +| **purpose** | [**ScoreTrackPurpose**](ScoreTrackPurpose.md) | | [default to 'common'] | +| **url** | **String** | The URL of the track | [optional] | +| **media_id** | **String** | 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** | [**Array<ScoreTrackPoint>**](ScoreTrackPoint.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreTrack.new( + id: null, + title: null, + score: null, + creator: null, + creation_date: null, + modification_date: null, + default: null, + state: null, + type: null, + purpose: null, + url: null, + media_id: null, + synchronization_points: null +) +``` + diff --git a/docs/reference/ScoreTrackCreation.md b/docs/reference/ScoreTrackCreation.md new file mode 100644 index 0000000..c85b2ec --- /dev/null +++ b/docs/reference/ScoreTrackCreation.md @@ -0,0 +1,28 @@ +# FlatApi::ScoreTrackCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | Title of the track | [optional] | +| **default** | **Boolean** | True if the track should be used as default audio source | [optional] | +| **state** | [**ScoreTrackState**](ScoreTrackState.md) | | [optional][default to 'draft'] | +| **purpose** | [**ScoreTrackPurpose**](ScoreTrackPurpose.md) | | [optional][default to 'common'] | +| **url** | **String** | The URL of the track | [optional] | +| **synchronization_points** | [**Array<ScoreTrackPoint>**](ScoreTrackPoint.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreTrackCreation.new( + title: null, + default: null, + state: null, + purpose: null, + url: null, + synchronization_points: null +) +``` + diff --git a/docs/reference/ScoreTrackCreationResponse.md b/docs/reference/ScoreTrackCreationResponse.md new file mode 100644 index 0000000..f7777cd --- /dev/null +++ b/docs/reference/ScoreTrackCreationResponse.md @@ -0,0 +1,18 @@ +# FlatApi::ScoreTrackCreationResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **track** | [**ScoreTrack**](ScoreTrack.md) | | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreTrackCreationResponse.new( + track: null +) +``` + diff --git a/docs/reference/ScoreTrackPoint.md b/docs/reference/ScoreTrackPoint.md new file mode 100644 index 0000000..eb1d046 --- /dev/null +++ b/docs/reference/ScoreTrackPoint.md @@ -0,0 +1,22 @@ +# FlatApi::ScoreTrackPoint + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | The type of the synchronization point. If the type is `measure`, the measure uuid must be present in `measureUuid` | | +| **measure_uuid** | **String** | The measure unique identifier | [optional] | +| **time** | **Float** | The corresponding time in seconds | | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreTrackPoint.new( + type: null, + measure_uuid: null, + time: null +) +``` + diff --git a/docs/reference/ScoreTrackPurpose.md b/docs/reference/ScoreTrackPurpose.md new file mode 100644 index 0000000..a92fab2 --- /dev/null +++ b/docs/reference/ScoreTrackPurpose.md @@ -0,0 +1,15 @@ +# FlatApi::ScoreTrackPurpose + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreTrackPurpose.new() +``` + diff --git a/docs/reference/ScoreTrackState.md b/docs/reference/ScoreTrackState.md new file mode 100644 index 0000000..3614d33 --- /dev/null +++ b/docs/reference/ScoreTrackState.md @@ -0,0 +1,15 @@ +# FlatApi::ScoreTrackState + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreTrackState.new() +``` + diff --git a/docs/reference/ScoreTrackType.md b/docs/reference/ScoreTrackType.md new file mode 100644 index 0000000..1617599 --- /dev/null +++ b/docs/reference/ScoreTrackType.md @@ -0,0 +1,15 @@ +# FlatApi::ScoreTrackType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreTrackType.new() +``` + diff --git a/docs/reference/ScoreTrackUpdate.md b/docs/reference/ScoreTrackUpdate.md new file mode 100644 index 0000000..b4bcf9a --- /dev/null +++ b/docs/reference/ScoreTrackUpdate.md @@ -0,0 +1,26 @@ +# FlatApi::ScoreTrackUpdate + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **title** | **String** | Title of the track | [optional] | +| **default** | **Boolean** | True if the track should be used as default audio source | [optional] | +| **state** | [**ScoreTrackState**](ScoreTrackState.md) | | [optional][default to 'draft'] | +| **purpose** | [**ScoreTrackPurpose**](ScoreTrackPurpose.md) | | [optional][default to 'common'] | +| **synchronization_points** | [**Array<ScoreTrackPoint>**](ScoreTrackPoint.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreTrackUpdate.new( + title: null, + default: null, + state: null, + purpose: null, + synchronization_points: null +) +``` + diff --git a/docs/reference/ScoreViewsCounts.md b/docs/reference/ScoreViewsCounts.md new file mode 100644 index 0000000..73720be --- /dev/null +++ b/docs/reference/ScoreViewsCounts.md @@ -0,0 +1,24 @@ +# FlatApi::ScoreViewsCounts + +## Properties + +| 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 + +```ruby +require 'flat_api' + +instance = FlatApi::ScoreViewsCounts.new( + total: null, + weekly: null, + monthly: null, + yearly: null +) +``` + diff --git a/docs/reference/Task.md b/docs/reference/Task.md new file mode 100644 index 0000000..a4490b7 --- /dev/null +++ b/docs/reference/Task.md @@ -0,0 +1,44 @@ +# FlatApi::Task + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Unique identifier of the task | | +| **type** | **String** | 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** | **String** | State of the Task | | +| **format** | **String** | For files processing, the file format (e.g. `mp3`, `wav`) | [optional] | +| **score** | **String** | The score unique identifier for tasks related to scores | [optional] | +| **revision** | **String** | The score revision identifier for tasks related to scores | [optional] | +| **progress** | [**TaskProgress**](TaskProgress.md) | | [optional] | +| **creation_date** | **Time** | The creation date of the task | [optional] | +| **modification_date** | **Time** | The last modification date of the task | [optional] | +| **done_date** | **Time** | The date when the task has been completed | [optional] | +| **result** | [**TaskResult**](TaskResult.md) | | [optional] | +| **error_history** | **Array<String>** | If any errors happened when processing this task, the list of errors identifiers | [optional] | +| **is_cancellable** | **Boolean** | 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** | [**Array<Task>**](Task.md) | Child tasks for hierarchical task structures (e.g., conversion subtasks) | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::Task.new( + id: null, + type: null, + state: null, + format: null, + score: null, + revision: null, + progress: null, + creation_date: null, + modification_date: null, + done_date: null, + result: null, + error_history: null, + is_cancellable: null, + children: null +) +``` + diff --git a/docs/reference/TaskApi.md b/docs/reference/TaskApi.md new file mode 100644 index 0000000..bb771b8 --- /dev/null +++ b/docs/reference/TaskApi.md @@ -0,0 +1,77 @@ +# FlatApi::TaskApi + +All URIs are relative to *https://api.flat.io/v2* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_task**](TaskApi.md#get_task) | **GET** /tasks/{task} | Get a task details | + + +## get_task + +> get_task(task) + +Get a task details + +This method can be used to follow a task progression, for example while a score is being exported. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::TaskApi.new +task = 'task_example' # String | Unique identifier for the task + +begin + # Get a task details + result = api_instance.get_task(task) + p result +rescue FlatApi::ApiError => e + puts "Error when calling TaskApi->get_task: #{e}" +end +``` + +#### Using the get_task_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_task_with_http_info(task) + +```ruby +begin + # Get a task details + data, status_code, headers = api_instance.get_task_with_http_info(task) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling TaskApi->get_task_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **task** | **String** | Unique identifier for the task | | + +### Return type + +[**Task**](Task.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/reference/TaskExportOptions.md b/docs/reference/TaskExportOptions.md new file mode 100644 index 0000000..2e4a5a2 --- /dev/null +++ b/docs/reference/TaskExportOptions.md @@ -0,0 +1,18 @@ +# FlatApi::TaskExportOptions + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **parts** | **Array<String>** | A list of parts to specifically export | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::TaskExportOptions.new( + parts: null +) +``` + diff --git a/docs/reference/TaskProgress.md b/docs/reference/TaskProgress.md new file mode 100644 index 0000000..1f0b186 --- /dev/null +++ b/docs/reference/TaskProgress.md @@ -0,0 +1,20 @@ +# FlatApi::TaskProgress + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **percent** | **Float** | Percent of the task progression | [optional] | +| **text** | **String** | Text details of the task progress | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::TaskProgress.new( + percent: null, + text: null +) +``` + diff --git a/docs/reference/TaskResult.md b/docs/reference/TaskResult.md new file mode 100644 index 0000000..0dc7191 --- /dev/null +++ b/docs/reference/TaskResult.md @@ -0,0 +1,20 @@ +# FlatApi::TaskResult + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **url** | **String** | URL returned by the task worker | [optional] | +| **error** | **String** | Error returned by task worker | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::TaskResult.new( + url: null, + error: null +) +``` + diff --git a/docs/reference/TeachingTheme.md b/docs/reference/TeachingTheme.md new file mode 100644 index 0000000..aaf972c --- /dev/null +++ b/docs/reference/TeachingTheme.md @@ -0,0 +1,15 @@ +# FlatApi::TeachingTheme + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::TeachingTheme.new() +``` + diff --git a/docs/reference/TutteoProduct.md b/docs/reference/TutteoProduct.md new file mode 100644 index 0000000..6e1ab84 --- /dev/null +++ b/docs/reference/TutteoProduct.md @@ -0,0 +1,15 @@ +# FlatApi::TutteoProduct + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::TutteoProduct.new() +``` + diff --git a/docs/reference/UserAdminUpdate.md b/docs/reference/UserAdminUpdate.md new file mode 100644 index 0000000..f64a7fa --- /dev/null +++ b/docs/reference/UserAdminUpdate.md @@ -0,0 +1,28 @@ +# FlatApi::UserAdminUpdate + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **password** | **String** | Password of the account | [optional] | +| **organization_role** | [**OrganizationRoles**](OrganizationRoles.md) | | [optional] | +| **username** | **String** | Username of the account | [optional] | +| **firstname** | **String** | First name of the user | [optional] | +| **lastname** | **String** | Last name of the user | [optional] | +| **email** | **String** | Email of the account | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserAdminUpdate.new( + password: null, + organization_role: null, + username: null, + firstname: null, + lastname: null, + email: null +) +``` + diff --git a/docs/reference/UserApi.md b/docs/reference/UserApi.md new file mode 100644 index 0000000..07dc298 --- /dev/null +++ b/docs/reference/UserApi.md @@ -0,0 +1,239 @@ +# FlatApi::UserApi + +All URIs are relative to *https://api.flat.io/v2* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_user**](UserApi.md#get_user) | **GET** /users/{user} | Get a public user profile | +| [**get_user_likes**](UserApi.md#get_user_likes) | **GET** /users/{user}/likes | List liked scores | +| [**get_user_scores**](UserApi.md#get_user_scores) | **GET** /users/{user}/scores | List user's scores | + + +## get_user + +> get_user(user) + +Get a public user profile + +Get a profile of a Flat or Flat for Education User. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::UserApi.new +user = 'user_example' # String | 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. + +begin + # Get a public user profile + result = api_instance.get_user(user) + p result +rescue FlatApi::ApiError => e + puts "Error when calling UserApi->get_user: #{e}" +end +``` + +#### Using the get_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_user_with_http_info(user) + +```ruby +begin + # Get a public user profile + data, status_code, headers = api_instance.get_user_with_http_info(user) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue FlatApi::ApiError => e + puts "Error when calling UserApi->get_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | 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. | | + +### Return type + +[**UserPublic**](UserPublic.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_user_likes + +> > get_user_likes(user, opts) + +List liked scores + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::UserApi.new +user = 'user_example' # String | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. +opts = { + _next: '_next_example', # String | 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. + previous: 'previous_example', # String | 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. + limit: 56, # Integer | This is the maximum number of objects that may be returned + ids: true # Boolean | Return only the identifiers of the scores +} + +begin + # List liked scores + result = api_instance.get_user_likes(user, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling UserApi->get_user_likes: #{e}" +end +``` + +#### Using the get_user_likes_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_user_likes_with_http_info(user, opts) + +```ruby +begin + # List liked scores + data, status_code, headers = api_instance.get_user_likes_with_http_info(user, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling UserApi->get_user_likes_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. | | +| **_next** | **String** | 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** | **String** | 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] | +| **limit** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 25] | +| **ids** | **Boolean** | Return only the identifiers of the scores | [optional] | + +### Return type + +[**Array<ScoreDetails>**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_user_scores + +> > get_user_scores(user, opts) + +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. + +### Examples + +```ruby +require 'time' +require 'flat_api' +# setup authorization +FlatApi.configure do |config| + # Configure OAuth2 access token for authorization: OAuth2 + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = FlatApi::UserApi.new +user = 'user_example' # String | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. +opts = { + paginate: true, # Boolean | 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. + sort: 'creationDate', # String | Sort + direction: 'asc', # String | Sort direction + limit: 56, # Integer | This is the maximum number of objects that may be returned + _next: '_next_example', # String | 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. + previous: 'previous_example' # String | 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. +} + +begin + # List user's scores + result = api_instance.get_user_scores(user, opts) + p result +rescue FlatApi::ApiError => e + puts "Error when calling UserApi->get_user_scores: #{e}" +end +``` + +#### Using the get_user_scores_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_user_scores_with_http_info(user, opts) + +```ruby +begin + # List user's scores + data, status_code, headers = api_instance.get_user_scores_with_http_info(user, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue FlatApi::ApiError => e + puts "Error when calling UserApi->get_user_scores_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user** | **String** | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. | | +| **paginate** | **Boolean** | 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** | **String** | Sort | [optional] | +| **direction** | **String** | Sort direction | [optional] | +| **limit** | **Integer** | This is the maximum number of objects that may be returned | [optional][default to 25] | +| **_next** | **String** | 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** | **String** | 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 + +[**Array<ScoreDetails>**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/reference/UserAzureDetails.md b/docs/reference/UserAzureDetails.md new file mode 100644 index 0000000..6be40ab --- /dev/null +++ b/docs/reference/UserAzureDetails.md @@ -0,0 +1,22 @@ +# FlatApi::UserAzureDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **oid** | **String** | User object identifier on Azure AD | [optional] | +| **hd** | **String** | User tenant (domain name) | [optional] | +| **preferred_username** | **String** | User Preferred Username (UPN), i.e. the main email of the user | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserAzureDetails.new( + oid: null, + hd: null, + preferred_username: null +) +``` + diff --git a/docs/reference/UserBasics.md b/docs/reference/UserBasics.md new file mode 100644 index 0000000..64920ac --- /dev/null +++ b/docs/reference/UserBasics.md @@ -0,0 +1,36 @@ +# FlatApi::UserBasics + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The user unique identifier | | +| **type** | **String** | The type of user account | | +| **product** | [**TutteoProduct**](TutteoProduct.md) | | [default to 'flat'] | +| **username** | **String** | The user name (unique for the organization) | | +| **printable_name** | **String** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] | +| **firstname** | **String** | Firstname of the user (for education users) | [optional] | +| **lastname** | **String** | Lastname of the user (for education users) | [optional] | +| **name** | **String** | A displayable name for the user (for consumer users) | [optional] | +| **picture** | **String** | The URL of the picture to display | | +| **badges** | **Array<String>** | List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserBasics.new( + id: null, + type: null, + product: null, + username: null, + printable_name: null, + firstname: null, + lastname: null, + name: null, + picture: null, + badges: null +) +``` + diff --git a/docs/reference/UserCommunityProfileLinks.md b/docs/reference/UserCommunityProfileLinks.md new file mode 100644 index 0000000..7384af5 --- /dev/null +++ b/docs/reference/UserCommunityProfileLinks.md @@ -0,0 +1,28 @@ +# FlatApi::UserCommunityProfileLinks + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **spotify_url** | **String** | Spotify Profile URL | [optional] | +| **youtube_url** | **String** | YouTube channel URL | [optional] | +| **soundcloud_url** | **String** | SoundCloud Profile URL | [optional] | +| **tiktok_url** | **String** | TikTok profile URL. For updates, also accepts TikTok usernames | [optional] | +| **instagram_url** | **String** | Instagram profile URL. For updates, also accepts Instagram usernames | [optional] | +| **website_url** | **String** | Personnal website URL | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserCommunityProfileLinks.new( + spotify_url: null, + youtube_url: null, + soundcloud_url: null, + tiktok_url: null, + instagram_url: null, + website_url: null +) +``` + diff --git a/docs/reference/UserCreation.md b/docs/reference/UserCreation.md new file mode 100644 index 0000000..01e5aa1 --- /dev/null +++ b/docs/reference/UserCreation.md @@ -0,0 +1,30 @@ +# FlatApi::UserCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **username** | **String** | Username of the new account | | +| **firstname** | **String** | First name of the user | [optional] | +| **lastname** | **String** | Last name of the user | [optional] | +| **email** | **String** | Email of the new account | [optional] | +| **password** | **String** | Password of the new account | | +| **locale** | **String** | User language. Input values will be automatically normalized to a supported locale code. | [optional][default to 'en'] | +| **role** | **String** | Role of the new account | [optional][default to 'user'] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserCreation.new( + username: null, + firstname: null, + lastname: null, + email: null, + password: null, + locale: null, + role: null +) +``` + diff --git a/docs/reference/UserDetails.md b/docs/reference/UserDetails.md new file mode 100644 index 0000000..96de91f --- /dev/null +++ b/docs/reference/UserDetails.md @@ -0,0 +1,82 @@ +# FlatApi::UserDetails + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The user unique identifier | | +| **type** | **String** | The type of user account | | +| **product** | [**TutteoProduct**](TutteoProduct.md) | | [default to 'flat'] | +| **username** | **String** | The user name (unique for the organization) | | +| **printable_name** | **String** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] | +| **firstname** | **String** | Firstname of the user (for education users) | [optional] | +| **lastname** | **String** | Lastname of the user (for education users) | [optional] | +| **name** | **String** | A displayable name for the user (for consumer users) | [optional] | +| **picture** | **String** | The URL of the picture to display | | +| **badges** | **Array<String>** | List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` | [optional] | +| **organization** | **String** | Organization ID (for Edu users only) | [optional] | +| **organization_role** | [**OrganizationRoles**](OrganizationRoles.md) | | [optional] | +| **class_role** | [**ClassRoles**](ClassRoles.md) | | [optional] | +| **html_url** | **String** | Link to user profile (for Indiv. users only) | [optional] | +| **bio** | **String** | User's biography | [optional] | +| **registration_date** | **Time** | Date the user signed up | [optional] | +| **liked_scores_count** | **Integer** | Number of the scores liked by the user | [optional] | +| **followers_count** | **Integer** | Number of followers the user have | [optional] | +| **following_count** | **Integer** | Number of people the user follow | [optional] | +| **owned_public_scores_count** | **Integer** | Number of public scores the user have | [optional] | +| **all_public_scores_count** | **Integer** | Total number of public scores the user participates in (owned + joined) | [optional] | +| **likes_count** | **Integer** | Number of likes on the user published scores | [optional] | +| **plays_count** | **Integer** | Number of plays on the user published scores | [optional] | +| **cover_picture** | **String** | Cover picture (backgroud) for the profile | [optional] | +| **profile_theme** | **String** | Theme (background) for the profile | [optional] | +| **links** | [**UserCommunityProfileLinks**](UserCommunityProfileLinks.md) | | [optional] | +| **is_email_verified** | **Boolean** | Whether the user's email address has been verified | [optional] | +| **azure_details** | [**UserAzureDetails**](UserAzureDetails.md) | | [optional] | +| **private_profile** | **Boolean** | Tell either this user profile is private or not (individual accounts only) | [optional] | +| **locale** | **String** | 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** | **Array<String>** | For Flat for Education accounts, list of Group identifiers the user is part of. | [optional] | +| **picture_file** | **String** | The ID of the user profile picture | [optional] | +| **cover_picture_file** | **String** | The ID of the user profile cover picture | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserDetails.new( + id: null, + type: null, + product: null, + username: null, + printable_name: null, + firstname: null, + lastname: null, + name: null, + picture: null, + badges: null, + organization: null, + organization_role: null, + class_role: null, + html_url: null, + bio: null, + registration_date: null, + liked_scores_count: null, + followers_count: null, + following_count: null, + owned_public_scores_count: null, + all_public_scores_count: null, + likes_count: null, + plays_count: null, + cover_picture: null, + profile_theme: null, + links: null, + is_email_verified: null, + azure_details: null, + private_profile: null, + locale: null, + groups: null, + picture_file: null, + cover_picture_file: null +) +``` + diff --git a/docs/reference/UserDetailsAdmin.md b/docs/reference/UserDetailsAdmin.md new file mode 100644 index 0000000..838ba11 --- /dev/null +++ b/docs/reference/UserDetailsAdmin.md @@ -0,0 +1,54 @@ +# FlatApi::UserDetailsAdmin + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The user unique identifier | | +| **type** | **String** | The type of user account | | +| **product** | [**TutteoProduct**](TutteoProduct.md) | | [default to 'flat'] | +| **username** | **String** | The user name (unique for the organization) | | +| **printable_name** | **String** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] | +| **firstname** | **String** | Firstname of the user (for education users) | [optional] | +| **lastname** | **String** | Lastname of the user (for education users) | [optional] | +| **name** | **String** | A displayable name for the user (for consumer users) | [optional] | +| **picture** | **String** | The URL of the picture to display | | +| **badges** | **Array<String>** | List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` | [optional] | +| **organization** | **String** | Organization ID (for Edu users only) | [optional] | +| **organization_role** | [**OrganizationRoles**](OrganizationRoles.md) | | [optional] | +| **class_role** | [**ClassRoles**](ClassRoles.md) | | [optional] | +| **html_url** | **String** | Link to user profile (for Indiv. users only) | [optional] | +| **email** | **String** | Email of the user | [optional] | +| **last_activity_date** | **Time** | Date of the last user activity | [optional] | +| **license** | [**UserDetailsAdminAllOfLicense**](UserDetailsAdminAllOfLicense.md) | | [optional] | +| **groups** | **Array<String>** | For Flat for Education accounts, list of Group identifiers the user is part of. | [optional] | +| **is_edu_testing_student** | **Boolean** | 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 + +```ruby +require 'flat_api' + +instance = FlatApi::UserDetailsAdmin.new( + id: null, + type: null, + product: null, + username: null, + printable_name: null, + firstname: null, + lastname: null, + name: null, + picture: null, + badges: null, + organization: null, + organization_role: null, + class_role: null, + html_url: null, + email: null, + last_activity_date: null, + license: null, + groups: null, + is_edu_testing_student: null +) +``` + diff --git a/docs/reference/UserDetailsAdminAllOfLicense.md b/docs/reference/UserDetailsAdminAllOfLicense.md new file mode 100644 index 0000000..8ae9d74 --- /dev/null +++ b/docs/reference/UserDetailsAdminAllOfLicense.md @@ -0,0 +1,26 @@ +# FlatApi::UserDetailsAdminAllOfLicense + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | ID of the current license | [optional] | +| **expiration_date** | **Time** | Date when the license expires | [optional] | +| **source** | [**LicenseSources**](LicenseSources.md) | | [optional][default to 'order'] | +| **mode** | [**LicenseMode**](LicenseMode.md) | | [optional] | +| **active** | **Boolean** | ID of the current license | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserDetailsAdminAllOfLicense.new( + id: null, + expiration_date: null, + source: null, + mode: null, + active: null +) +``` + diff --git a/docs/reference/UserPublic.md b/docs/reference/UserPublic.md new file mode 100644 index 0000000..04f22ba --- /dev/null +++ b/docs/reference/UserPublic.md @@ -0,0 +1,68 @@ +# FlatApi::UserPublic + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The user unique identifier | | +| **type** | **String** | The type of user account | | +| **product** | [**TutteoProduct**](TutteoProduct.md) | | [default to 'flat'] | +| **username** | **String** | The user name (unique for the organization) | | +| **printable_name** | **String** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] | +| **firstname** | **String** | Firstname of the user (for education users) | [optional] | +| **lastname** | **String** | Lastname of the user (for education users) | [optional] | +| **name** | **String** | A displayable name for the user (for consumer users) | [optional] | +| **picture** | **String** | The URL of the picture to display | | +| **badges** | **Array<String>** | List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` | [optional] | +| **organization** | **String** | Organization ID (for Edu users only) | [optional] | +| **organization_role** | [**OrganizationRoles**](OrganizationRoles.md) | | [optional] | +| **class_role** | [**ClassRoles**](ClassRoles.md) | | [optional] | +| **html_url** | **String** | Link to user profile (for Indiv. users only) | [optional] | +| **bio** | **String** | User's biography | [optional] | +| **registration_date** | **Time** | Date the user signed up | [optional] | +| **liked_scores_count** | **Integer** | Number of the scores liked by the user | [optional] | +| **followers_count** | **Integer** | Number of followers the user have | [optional] | +| **following_count** | **Integer** | Number of people the user follow | [optional] | +| **owned_public_scores_count** | **Integer** | Number of public scores the user have | [optional] | +| **all_public_scores_count** | **Integer** | Total number of public scores the user participates in (owned + joined) | [optional] | +| **likes_count** | **Integer** | Number of likes on the user published scores | [optional] | +| **plays_count** | **Integer** | Number of plays on the user published scores | [optional] | +| **cover_picture** | **String** | Cover picture (backgroud) for the profile | [optional] | +| **profile_theme** | **String** | Theme (background) for the profile | [optional] | +| **links** | [**UserCommunityProfileLinks**](UserCommunityProfileLinks.md) | | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserPublic.new( + id: null, + type: null, + product: null, + username: null, + printable_name: null, + firstname: null, + lastname: null, + name: null, + picture: null, + badges: null, + organization: null, + organization_role: null, + class_role: null, + html_url: null, + bio: null, + registration_date: null, + liked_scores_count: null, + followers_count: null, + following_count: null, + owned_public_scores_count: null, + all_public_scores_count: null, + likes_count: null, + plays_count: null, + cover_picture: null, + profile_theme: null, + links: null +) +``` + diff --git a/docs/reference/UserPublicSummary.md b/docs/reference/UserPublicSummary.md new file mode 100644 index 0000000..bbd55f9 --- /dev/null +++ b/docs/reference/UserPublicSummary.md @@ -0,0 +1,44 @@ +# FlatApi::UserPublicSummary + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The user unique identifier | | +| **type** | **String** | The type of user account | | +| **product** | [**TutteoProduct**](TutteoProduct.md) | | [default to 'flat'] | +| **username** | **String** | The user name (unique for the organization) | | +| **printable_name** | **String** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] | +| **firstname** | **String** | Firstname of the user (for education users) | [optional] | +| **lastname** | **String** | Lastname of the user (for education users) | [optional] | +| **name** | **String** | A displayable name for the user (for consumer users) | [optional] | +| **picture** | **String** | The URL of the picture to display | | +| **badges** | **Array<String>** | List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` | [optional] | +| **organization** | **String** | Organization ID (for Edu users only) | [optional] | +| **organization_role** | [**OrganizationRoles**](OrganizationRoles.md) | | [optional] | +| **class_role** | [**ClassRoles**](ClassRoles.md) | | [optional] | +| **html_url** | **String** | Link to user profile (for Indiv. users only) | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserPublicSummary.new( + id: null, + type: null, + product: null, + username: null, + printable_name: null, + firstname: null, + lastname: null, + name: null, + picture: null, + badges: null, + organization: null, + organization_role: null, + class_role: null, + html_url: null +) +``` + diff --git a/docs/reference/UserSigninLink.md b/docs/reference/UserSigninLink.md new file mode 100644 index 0000000..8a28ed0 --- /dev/null +++ b/docs/reference/UserSigninLink.md @@ -0,0 +1,22 @@ +# FlatApi::UserSigninLink + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **url** | **String** | URL to use to sign in to this account | [optional] | +| **token** | **String** | Raw sign-in token, can be used to build custom URLs (e.g. deep links) | [optional] | +| **expiration_date** | **Time** | Date when the link expires | [optional] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserSigninLink.new( + url: null, + token: null, + expiration_date: null +) +``` + diff --git a/docs/reference/UserSigninLinkCreation.md b/docs/reference/UserSigninLinkCreation.md new file mode 100644 index 0000000..2b8e898 --- /dev/null +++ b/docs/reference/UserSigninLinkCreation.md @@ -0,0 +1,18 @@ +# FlatApi::UserSigninLinkCreation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **destination_path** | **String** | Path to redirect to after signin | [optional][default to '/'] | + +## Example + +```ruby +require 'flat_api' + +instance = FlatApi::UserSigninLinkCreation.new( + destination_path: null +) +``` + diff --git a/flat_api.gemspec b/flat_api.gemspec index 51cafcb..bff4952 100644 --- a/flat_api.gemspec +++ b/flat_api.gemspec @@ -25,18 +25,26 @@ Gem::Specification.new do |s| s.summary = "Ruby Client for Flat REST API (https://flat.io)" s.description = "The Flat API allows you to easily extend the abilities of 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." +- Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) +- Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments." s.license = "Apache-2.0" - s.required_ruby_version = ">= 3.0" + # Matches the runtime_matrix in .sdkgen.yaml. Claiming 3.0 advertised support for a version + # that end of life passed and that CI never builds. + s.required_ruby_version = ">= 3.3" s.metadata = {} - s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' + # tools/openapi-config.json selects the faraday library, so these are what the generated client + # actually requires. It declared typhoeus, the generator's other option, which meant `gem install + # flat_api` followed by `require 'flat_api'` raised LoadError on faraday. + s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0' + s.add_runtime_dependency 'faraday-multipart', '~> 1.0' + s.add_runtime_dependency 'marcel', '~> 1.0' - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.files = Dir.glob("lib/**/*").sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") + # LICENSE has to be in the gem, not only in the repository: the gem declares Apache-2.0 above and + # shipping the declaration without the text is what the licence itself asks you not to do. + s.files = Dir.glob("lib/**/*").sort.select { |f| !f.empty? } + + %w[LICENSE README.md CHANGELOG.md] s.executables = [] s.require_paths = ["lib"] end diff --git a/git_push.sh b/git_push.sh deleted file mode 100644 index 23da9e8..0000000 --- a/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="FlatIO" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="api-client-ruby" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/lib/flat_api.rb b/lib/flat_api.rb index c4aa8ad..04ba8b7 100644 --- a/lib/flat_api.rb +++ b/lib/flat_api.rb @@ -1,22 +1,33 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end # Common files +# BEGIN generated by tools/patches/95_requires.py +# The ergonomic surface the patches add. errors comes first: api_client raises from it. +require 'flat_api/errors' +require 'flat_api/retry' +require 'flat_api/pagination' +require 'flat_api/oauth' +require 'flat_api/client' +# END generated by tools/patches/95_requires.py require 'flat_api/api_client' require 'flat_api/api_error' +require 'flat_api/api_model_base' require 'flat_api/version' require 'flat_api/configuration' # Models +require 'flat_api/models/add_group_user200_response' +require 'flat_api/models/add_group_user_request' require 'flat_api/models/api_access_token' require 'flat_api/models/app_scopes' require 'flat_api/models/assignment' @@ -26,6 +37,7 @@ require 'flat_api/models/assignment_copy_response' require 'flat_api/models/assignment_copy_to_class' require 'flat_api/models/assignment_copy_to_resource_library' +require 'flat_api/models/assignment_group' require 'flat_api/models/assignment_submission' require 'flat_api/models/assignment_submission_comment' require 'flat_api/models/assignment_submission_comment_creation' @@ -34,8 +46,9 @@ require 'flat_api/models/assignment_submission_history_attachment' require 'flat_api/models/assignment_submission_history_state' require 'flat_api/models/assignment_submission_lti' -require 'flat_api/models/assignment_submission_playback_inner' +require 'flat_api/models/assignment_submission_playback' require 'flat_api/models/assignment_submission_state' +require 'flat_api/models/assignment_submission_students_mode' require 'flat_api/models/assignment_submission_update' require 'flat_api/models/assignment_type' require 'flat_api/models/assignment_update' @@ -65,12 +78,15 @@ require 'flat_api/models/collection' require 'flat_api/models/collection_app' require 'flat_api/models/collection_capabilities' +require 'flat_api/models/collection_contents' require 'flat_api/models/collection_creation' require 'flat_api/models/collection_modification' require 'flat_api/models/collection_privacy' require 'flat_api/models/collection_type' +require 'flat_api/models/credit_transaction' require 'flat_api/models/edu_library' require 'flat_api/models/edu_resource' +require 'flat_api/models/edu_resource_assignment_creation' require 'flat_api/models/edu_resource_capabilities' require 'flat_api/models/edu_resource_copy' require 'flat_api/models/edu_resource_creation' @@ -83,25 +99,70 @@ require 'flat_api/models/edu_resource_update' require 'flat_api/models/edu_resource_use_in_class' require 'flat_api/models/flat_error_response' -require 'flat_api/models/flat_locales' require 'flat_api/models/google_classroom_coursework' require 'flat_api/models/google_classroom_submission' +require 'flat_api/models/grade' require 'flat_api/models/group' +require 'flat_api/models/group_creation' require 'flat_api/models/group_details' require 'flat_api/models/group_type' require 'flat_api/models/license_mode' require 'flat_api/models/license_sources' require 'flat_api/models/lms_name' +require 'flat_api/models/lti_configuration' +require 'flat_api/models/lti_configuration1p1' +require 'flat_api/models/lti_configuration1p1_all_of_tool' +require 'flat_api/models/lti_configuration1p3' +require 'flat_api/models/lti_configuration1p3_base' +require 'flat_api/models/lti_configuration1p3_base_supported_services' +require 'flat_api/models/lti_configuration1p3_base_supported_services_ags' +require 'flat_api/models/lti_configuration1p3_base_supported_services_deep_linking' +require 'flat_api/models/lti_configuration1p3_base_supported_services_nrps' +require 'flat_api/models/lti_configuration1p3_base_tool' +require 'flat_api/models/lti_configuration1p3_deployment' +require 'flat_api/models/lti_configuration1p3_dynamic' +require 'flat_api/models/lti_configuration1p3_manual' +require 'flat_api/models/lti_configuration_base' +require 'flat_api/models/lti_configuration_create' +require 'flat_api/models/lti_configuration_create1p1' +require 'flat_api/models/lti_configuration_create1p3_deployment' +require 'flat_api/models/lti_configuration_create1p3_dynamic' +require 'flat_api/models/lti_configuration_create1p3_dynamic_platform_info' +require 'flat_api/models/lti_configuration_create1p3_manual' +require 'flat_api/models/lti_configuration_update' +require 'flat_api/models/lti_configuration_update_deployment' +require 'flat_api/models/lti_configuration_update_standalone' require 'flat_api/models/lti_credentials' require 'flat_api/models/lti_credentials_creation' require 'flat_api/models/media_attachment' require 'flat_api/models/media_score_sharing_mode' require 'flat_api/models/microsoft_graph_assignment' require 'flat_api/models/microsoft_graph_submission' +require 'flat_api/models/omr_capabilities' +require 'flat_api/models/omr_details_step_data' +require 'flat_api/models/omr_details_submission' +require 'flat_api/models/omr_detected_instrument' +require 'flat_api/models/omr_imported_metadata' +require 'flat_api/models/omr_instrument_override' +require 'flat_api/models/omr_job' +require 'flat_api/models/omr_job_creation' +require 'flat_api/models/omr_job_file_metadata' +require 'flat_api/models/omr_job_file_upload' +require 'flat_api/models/omr_job_file_upload_result' +require 'flat_api/models/omr_job_input_file' +require 'flat_api/models/omr_job_output' +require 'flat_api/models/omr_job_progress' +require 'flat_api/models/omr_job_result' +require 'flat_api/models/omr_job_retention' +require 'flat_api/models/omr_job_status' +require 'flat_api/models/omr_locale_details' +require 'flat_api/models/omr_pending_step' +require 'flat_api/models/omr_step_name' require 'flat_api/models/organization_invitation' require 'flat_api/models/organization_invitation_creation' require 'flat_api/models/organization_roles' require 'flat_api/models/organization_user_access_token_creation' +require 'flat_api/models/rename_group_request' require 'flat_api/models/resource_collaborator' require 'flat_api/models/resource_collaborator_creation' require 'flat_api/models/resource_rights' @@ -122,6 +183,7 @@ require 'flat_api/models/score_creation_google_drive_import' require 'flat_api/models/score_creation_type' require 'flat_api/models/score_details' +require 'flat_api/models/score_details_all_of_me' require 'flat_api/models/score_fork' require 'flat_api/models/score_license' require 'flat_api/models/score_likes_counts' @@ -135,6 +197,7 @@ require 'flat_api/models/score_summary' require 'flat_api/models/score_track' require 'flat_api/models/score_track_creation' +require 'flat_api/models/score_track_creation_response' require 'flat_api/models/score_track_point' require 'flat_api/models/score_track_purpose' require 'flat_api/models/score_track_state' @@ -145,6 +208,7 @@ require 'flat_api/models/task_export_options' require 'flat_api/models/task_progress' require 'flat_api/models/task_result' +require 'flat_api/models/teaching_theme' require 'flat_api/models/tutteo_product' require 'flat_api/models/user_admin_update' require 'flat_api/models/user_azure_details' @@ -165,6 +229,7 @@ require 'flat_api/api/collection_api' require 'flat_api/api/edu_resources_api' require 'flat_api/api/group_api' +require 'flat_api/api/omr_api' require 'flat_api/api/organization_api' require 'flat_api/api/score_api' require 'flat_api/api/task_api' diff --git a/lib/flat_api/api/account_api.rb b/lib/flat_api/api/account_api.rb index 6049130..2ae650d 100644 --- a/lib/flat_api/api/account_api.rb +++ b/lib/flat_api/api/account_api.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -48,7 +48,7 @@ def get_authenticated_user_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/lib/flat_api/api/class_api.rb b/lib/flat_api/api/class_api.rb index e7f0c53..5139a68 100644 --- a/lib/flat_api/api/class_api.rb +++ b/lib/flat_api/api/class_api.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -43,7 +43,7 @@ def activate_class_with_http_info(_class, opts = {}) fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.activate_class" end # resource path - local_var_path = '/classes/{class}/activate'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)) + local_var_path = '/classes/{class}/activate'.sub('{class}', CGI.escape(_class.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -51,7 +51,7 @@ def activate_class_with_http_info(_class, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -112,7 +112,7 @@ def add_class_user_with_http_info(_class, user, opts = {}) fail ArgumentError, "Missing the required parameter 'user' when calling ClassApi.add_class_user" end # resource path - local_var_path = '/classes/{class}/users/{user}'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/classes/{class}/users/{user}'.sub('{class}', CGI.escape(_class.to_s)).sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -120,7 +120,7 @@ def add_class_user_with_http_info(_class, user, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -181,7 +181,7 @@ def archive_assignment_with_http_info(_class, assignment, opts = {}) fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.archive_assignment" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/archive'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/archive'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -189,7 +189,7 @@ def archive_assignment_with_http_info(_class, assignment, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -244,7 +244,7 @@ def archive_class_with_http_info(_class, opts = {}) fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.archive_class" end # resource path - local_var_path = '/classes/{class}/archive'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)) + local_var_path = '/classes/{class}/archive'.sub('{class}', CGI.escape(_class.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -252,7 +252,7 @@ def archive_class_with_http_info(_class, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -319,7 +319,7 @@ def copy_assignment_with_http_info(_class, assignment, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.copy_assignment" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/copy'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/copy'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -327,7 +327,7 @@ def copy_assignment_with_http_info(_class, assignment, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -395,7 +395,7 @@ def create_class_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -461,7 +461,7 @@ def create_class_assignment_with_http_info(_class, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.create_class_assignment" end # resource path - local_var_path = '/classes/{class}/assignments'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)) + local_var_path = '/classes/{class}/assignments'.sub('{class}', CGI.escape(_class.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -469,7 +469,7 @@ def create_class_assignment_with_http_info(_class, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -541,7 +541,7 @@ def create_submission_with_http_info(_class, assignment, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.create_submission" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -549,7 +549,7 @@ def create_submission_with_http_info(_class, assignment, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -611,7 +611,7 @@ def create_test_student_account_with_http_info(_class, opts = {}) fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.create_test_student_account" end # resource path - local_var_path = '/classes/{class}/testStudent'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)) + local_var_path = '/classes/{class}/testStudent'.sub('{class}', CGI.escape(_class.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -620,7 +620,7 @@ def create_test_student_account_with_http_info(_class, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -651,8 +651,77 @@ def create_test_student_account_with_http_info(_class, opts = {}) return data, status_code, headers end + # 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 _class [String] Unique identifier of the class + # @param assignment [String] Unique identifier of the assignment + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_assignment(_class, assignment, opts = {}) + delete_assignment_with_http_info(_class, assignment, opts) + nil + end + + # 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 _class [String] Unique identifier of the class + # @param assignment [String] Unique identifier of the assignment + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_assignment_with_http_info(_class, assignment, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ClassApi.delete_assignment ...' + end + # verify the required parameter '_class' is set + if @api_client.config.client_side_validation && _class.nil? + fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.delete_assignment" + end + # verify the required parameter 'assignment' is set + if @api_client.config.client_side_validation && assignment.nil? + fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.delete_assignment" + end + # resource path + local_var_path = '/classes/{class}/assignments/{assignment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"ClassApi.delete_assignment", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ClassApi#delete_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # 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 of the class to remove another user from it. Removing your own account is not allowed. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. # @param _class [String] Unique identifier of the class # @param user [String] Unique identifier of the user # @param [Hash] opts the optional parameters @@ -663,7 +732,7 @@ def delete_class_user(_class, user, opts = {}) end # 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 of the class to remove another user from it. Removing your own account is not allowed. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. # @param _class [String] Unique identifier of the class # @param user [String] Unique identifier of the user # @param [Hash] opts the optional parameters @@ -681,7 +750,7 @@ def delete_class_user_with_http_info(_class, user, opts = {}) fail ArgumentError, "Missing the required parameter 'user' when calling ClassApi.delete_class_user" end # resource path - local_var_path = '/classes/{class}/users/{user}'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/classes/{class}/users/{user}'.sub('{class}', CGI.escape(_class.to_s)).sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -689,7 +758,7 @@ def delete_class_user_with_http_info(_class, user, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -756,7 +825,7 @@ def delete_submission_with_http_info(_class, assignment, submission, opts = {}) fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.delete_submission" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)).sub('{' + 'submission' + '}', CGI.escape(submission.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -764,7 +833,7 @@ def delete_submission_with_http_info(_class, assignment, submission, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -835,7 +904,7 @@ def delete_submission_comment_with_http_info(_class, assignment, submission, com fail ArgumentError, "Missing the required parameter 'comment' when calling ClassApi.delete_submission_comment" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)).sub('{' + 'submission' + '}', CGI.escape(submission.to_s)).sub('{' + 'comment' + '}', CGI.escape(comment.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)).sub('{comment}', CGI.escape(comment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -843,7 +912,7 @@ def delete_submission_comment_with_http_info(_class, assignment, submission, com # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -916,7 +985,7 @@ def edit_submission_with_http_info(_class, assignment, submission, body, opts = fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.edit_submission" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)).sub('{' + 'submission' + '}', CGI.escape(submission.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -924,7 +993,7 @@ def edit_submission_with_http_info(_class, assignment, submission, body, opts = # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -984,7 +1053,7 @@ def enroll_class_with_http_info(enrollment_code, opts = {}) fail ArgumentError, "Missing the required parameter 'enrollment_code' when calling ClassApi.enroll_class" end # resource path - local_var_path = '/classes/enroll/{enrollmentCode}'.sub('{' + 'enrollmentCode' + '}', CGI.escape(enrollment_code.to_s)) + local_var_path = '/classes/enroll/{enrollmentCode}'.sub('{enrollmentCode}', CGI.escape(enrollment_code.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -992,7 +1061,7 @@ def enroll_class_with_http_info(enrollment_code, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1053,7 +1122,7 @@ def export_submissions_reviews_as_csv_with_http_info(_class, assignment, opts = fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.export_submissions_reviews_as_csv" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/csv'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/csv'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1061,7 +1130,7 @@ def export_submissions_reviews_as_csv_with_http_info(_class, assignment, opts = # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['text/csv']) + header_params['Accept'] = @api_client.select_header_accept(['text/csv']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1122,7 +1191,7 @@ def export_submissions_reviews_as_excel_with_http_info(_class, assignment, opts fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.export_submissions_reviews_as_excel" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/excel'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/excel'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1130,7 +1199,7 @@ def export_submissions_reviews_as_excel_with_http_info(_class, assignment, opts # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']) + header_params['Accept'] = @api_client.select_header_accept(['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1161,6 +1230,75 @@ def export_submissions_reviews_as_excel_with_http_info(_class, assignment, opts return data, status_code, headers end + # 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 _class [String] Unique identifier of the class + # @param assignment [String] Unique identifier of the assignment + # @param [Hash] opts the optional parameters + # @return [Assignment] + def get_assignment(_class, assignment, opts = {}) + data, _status_code, _headers = get_assignment_with_http_info(_class, assignment, opts) + data + end + + # 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 _class [String] Unique identifier of the class + # @param assignment [String] Unique identifier of the assignment + # @param [Hash] opts the optional parameters + # @return [Array<(Assignment, Integer, Hash)>] Assignment data, response status code and response headers + def get_assignment_with_http_info(_class, assignment, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ClassApi.get_assignment ...' + end + # verify the required parameter '_class' is set + if @api_client.config.client_side_validation && _class.nil? + fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_assignment" + end + # verify the required parameter 'assignment' is set + if @api_client.config.client_side_validation && assignment.nil? + fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.get_assignment" + end + # resource path + local_var_path = '/classes/{class}/assignments/{assignment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Assignment' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"ClassApi.get_assignment", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ClassApi#get_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get the details of a single class # @param _class [String] Unique identifier of the class # @param [Hash] opts the optional parameters @@ -1183,7 +1321,7 @@ def get_class_with_http_info(_class, opts = {}) fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_class" end # resource path - local_var_path = '/classes/{class}'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)) + local_var_path = '/classes/{class}'.sub('{class}', CGI.escape(_class.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1191,7 +1329,7 @@ def get_class_with_http_info(_class, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1246,7 +1384,7 @@ def get_score_submissions_with_http_info(score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling ClassApi.get_score_submissions" end # resource path - local_var_path = '/scores/{score}/submissions'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/submissions'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1254,7 +1392,7 @@ def get_score_submissions_with_http_info(score, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1319,7 +1457,7 @@ def get_submission_with_http_info(_class, assignment, submission, opts = {}) fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.get_submission" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)).sub('{' + 'submission' + '}', CGI.escape(submission.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1327,7 +1465,7 @@ def get_submission_with_http_info(_class, assignment, submission, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1392,7 +1530,7 @@ def get_submission_comments_with_http_info(_class, assignment, submission, opts fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.get_submission_comments" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)).sub('{' + 'submission' + '}', CGI.escape(submission.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1400,7 +1538,7 @@ def get_submission_comments_with_http_info(_class, assignment, submission, opts # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1467,7 +1605,7 @@ def get_submission_history_with_http_info(_class, assignment, submission, opts = fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.get_submission_history" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/history'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)).sub('{' + 'submission' + '}', CGI.escape(submission.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/history'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1475,7 +1613,7 @@ def get_submission_history_with_http_info(_class, assignment, submission, opts = # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1534,7 +1672,7 @@ def get_submissions_with_http_info(_class, assignment, opts = {}) fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.get_submissions" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1542,7 +1680,7 @@ def get_submissions_with_http_info(_class, assignment, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1595,7 +1733,7 @@ def list_assignments_with_http_info(_class, opts = {}) fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.list_assignments" end # resource path - local_var_path = '/classes/{class}/assignments'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)) + local_var_path = '/classes/{class}/assignments'.sub('{class}', CGI.escape(_class.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1603,7 +1741,7 @@ def list_assignments_with_http_info(_class, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1664,7 +1802,7 @@ def list_class_student_submissions_with_http_info(_class, user, opts = {}) fail ArgumentError, "Missing the required parameter 'user' when calling ClassApi.list_class_student_submissions" end # resource path - local_var_path = '/classes/{class}/students/{user}/submissions'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/classes/{class}/students/{user}/submissions'.sub('{class}', CGI.escape(_class.to_s)).sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1672,7 +1810,7 @@ def list_class_student_submissions_with_http_info(_class, user, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1734,7 +1872,7 @@ def list_classes_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1805,7 +1943,7 @@ def post_submission_comment_with_http_info(_class, assignment, submission, assig fail ArgumentError, "Missing the required parameter 'assignment_submission_comment_creation' when calling ClassApi.post_submission_comment" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)).sub('{' + 'submission' + '}', CGI.escape(submission.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1813,7 +1951,7 @@ def post_submission_comment_with_http_info(_class, assignment, submission, assig # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -1879,7 +2017,7 @@ def unarchive_assignment_with_http_info(_class, assignment, opts = {}) fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.unarchive_assignment" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/archive'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/archive'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1887,7 +2025,7 @@ def unarchive_assignment_with_http_info(_class, assignment, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1942,7 +2080,7 @@ def unarchive_class_with_http_info(_class, opts = {}) fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.unarchive_class" end # resource path - local_var_path = '/classes/{class}/archive'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)) + local_var_path = '/classes/{class}/archive'.sub('{class}', CGI.escape(_class.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1950,7 +2088,7 @@ def unarchive_class_with_http_info(_class, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -2011,7 +2149,7 @@ def update_class_with_http_info(_class, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.update_class" end # resource path - local_var_path = '/classes/{class}'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)) + local_var_path = '/classes/{class}'.sub('{class}', CGI.escape(_class.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -2019,7 +2157,7 @@ def update_class_with_http_info(_class, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -2055,6 +2193,86 @@ def update_class_with_http_info(_class, body, opts = {}) return data, status_code, headers end + # 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 _class [String] Unique identifier of the class + # @param assignment [String] Unique identifier of the assignment + # @param body [ClassAssignmentUpdate] + # @param [Hash] opts the optional parameters + # @return [Assignment] + def update_class_assignment(_class, assignment, body, opts = {}) + data, _status_code, _headers = update_class_assignment_with_http_info(_class, assignment, body, opts) + data + end + + # 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 _class [String] Unique identifier of the class + # @param assignment [String] Unique identifier of the assignment + # @param body [ClassAssignmentUpdate] + # @param [Hash] opts the optional parameters + # @return [Array<(Assignment, Integer, Hash)>] Assignment data, response status code and response headers + def update_class_assignment_with_http_info(_class, assignment, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ClassApi.update_class_assignment ...' + end + # verify the required parameter '_class' is set + if @api_client.config.client_side_validation && _class.nil? + fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.update_class_assignment" + end + # verify the required parameter 'assignment' is set + if @api_client.config.client_side_validation && assignment.nil? + fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.update_class_assignment" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.update_class_assignment" + end + # resource path + local_var_path = '/classes/{class}/assignments/{assignment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'Assignment' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"ClassApi.update_class_assignment", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ClassApi#update_class_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a feedback comment to a submission # @param _class [String] Unique identifier of the class # @param assignment [String] Unique identifier of the assignment @@ -2101,7 +2319,7 @@ def update_submission_comment_with_http_info(_class, assignment, submission, com fail ArgumentError, "Missing the required parameter 'assignment_submission_comment_creation' when calling ClassApi.update_submission_comment" end # resource path - local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}'.sub('{' + 'class' + '}', CGI.escape(_class.to_s)).sub('{' + 'assignment' + '}', CGI.escape(assignment.to_s)).sub('{' + 'submission' + '}', CGI.escape(submission.to_s)).sub('{' + 'comment' + '}', CGI.escape(comment.to_s)) + local_var_path = '/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}'.sub('{class}', CGI.escape(_class.to_s)).sub('{assignment}', CGI.escape(assignment.to_s)).sub('{submission}', CGI.escape(submission.to_s)).sub('{comment}', CGI.escape(comment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -2109,7 +2327,7 @@ def update_submission_comment_with_http_info(_class, assignment, submission, com # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/lib/flat_api/api/collection_api.rb b/lib/flat_api/api/collection_api.rb index 2d0b478..27201eb 100644 --- a/lib/flat_api/api/collection_api.rb +++ b/lib/flat_api/api/collection_api.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -21,7 +21,7 @@ def initialize(api_client = ApiClient.default) end # 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 [String] 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 + # @param collection [String] 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 # @param score [String] 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`). # @param [Hash] opts the optional parameters # @option opts [String] :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. @@ -33,7 +33,7 @@ def add_score_to_collection(collection, score, opts = {}) # 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 [String] 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 + # @param collection [String] 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 # @param score [String] 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`). # @param [Hash] opts the optional parameters # @option opts [String] :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. @@ -51,7 +51,7 @@ def add_score_to_collection_with_http_info(collection, score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling CollectionApi.add_score_to_collection" end # resource path - local_var_path = '/collections/{collection}/scores/{score}'.sub('{' + 'collection' + '}', CGI.escape(collection.to_s)).sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/collections/{collection}/scores/{score}'.sub('{collection}', CGI.escape(collection.to_s)).sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -60,7 +60,12 @@ def add_score_to_collection_with_http_info(collection, score, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -92,7 +97,7 @@ def add_score_to_collection_with_http_info(collection, score, opts = {}) end # 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 [CollectionCreation] # @param [Hash] opts the optional parameters # @return [Collection] @@ -102,7 +107,7 @@ def create_collection(body, opts = {}) end # 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 [CollectionCreation] # @param [Hash] opts the optional parameters # @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers @@ -123,7 +128,7 @@ def create_collection_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -161,7 +166,7 @@ def create_collection_with_http_info(body, opts = {}) # Delete the collection # This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. - # @param collection [String] 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 + # @param collection [String] 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 # @param [Hash] opts the optional parameters # @return [nil] def delete_collection(collection, opts = {}) @@ -171,7 +176,7 @@ def delete_collection(collection, opts = {}) # Delete the collection # This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. - # @param collection [String] 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 + # @param collection [String] 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 # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_collection_with_http_info(collection, opts = {}) @@ -183,7 +188,7 @@ def delete_collection_with_http_info(collection, opts = {}) fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.delete_collection" end # resource path - local_var_path = '/collections/{collection}'.sub('{' + 'collection' + '}', CGI.escape(collection.to_s)) + local_var_path = '/collections/{collection}'.sub('{collection}', CGI.escape(collection.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -191,7 +196,7 @@ def delete_collection_with_http_info(collection, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -224,9 +229,10 @@ def delete_collection_with_http_info(collection, opts = {}) # 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 [String] 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 + # @param collection [String] 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 # @param score [String] 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`). # @param [Hash] opts the optional parameters + # @option opts [String] :event_properties Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` # @option opts [String] :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. # @return [nil] def delete_score_from_collection(collection, score, opts = {}) @@ -236,9 +242,10 @@ def delete_score_from_collection(collection, score, opts = {}) # 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 [String] 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 + # @param collection [String] 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 # @param score [String] 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`). # @param [Hash] opts the optional parameters + # @option opts [String] :event_properties Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` # @option opts [String] :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. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_score_from_collection_with_http_info(collection, score, opts = {}) @@ -254,16 +261,22 @@ def delete_score_from_collection_with_http_info(collection, score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling CollectionApi.delete_score_from_collection" end # resource path - local_var_path = '/collections/{collection}/scores/{score}'.sub('{' + 'collection' + '}', CGI.escape(collection.to_s)).sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/collections/{collection}/scores/{score}'.sub('{collection}', CGI.escape(collection.to_s)).sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'eventProperties'] = opts[:'event_properties'] if !opts[:'event_properties'].nil? query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -295,7 +308,7 @@ def delete_score_from_collection_with_http_info(collection, score, opts = {}) end # Update a collection's metadata - # @param collection [String] 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 + # @param collection [String] 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 # @param body [CollectionModification] # @param [Hash] opts the optional parameters # @return [Collection] @@ -305,7 +318,7 @@ def edit_collection(collection, body, opts = {}) end # Update a collection's metadata - # @param collection [String] 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 + # @param collection [String] 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 # @param body [CollectionModification] # @param [Hash] opts the optional parameters # @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers @@ -322,7 +335,7 @@ def edit_collection_with_http_info(collection, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling CollectionApi.edit_collection" end # resource path - local_var_path = '/collections/{collection}'.sub('{' + 'collection' + '}', CGI.escape(collection.to_s)) + local_var_path = '/collections/{collection}'.sub('{collection}', CGI.escape(collection.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -330,7 +343,7 @@ def edit_collection_with_http_info(collection, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -367,7 +380,7 @@ def edit_collection_with_http_info(collection, body, opts = {}) end # Get collection details - # @param collection [String] 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 + # @param collection [String] 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 # @param [Hash] opts the optional parameters # @option opts [String] :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. # @return [Collection] @@ -377,7 +390,7 @@ def get_collection(collection, opts = {}) end # Get collection details - # @param collection [String] 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 + # @param collection [String] 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 # @param [Hash] opts the optional parameters # @option opts [String] :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. # @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers @@ -390,7 +403,7 @@ def get_collection_with_http_info(collection, opts = {}) fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.get_collection" end # resource path - local_var_path = '/collections/{collection}'.sub('{' + 'collection' + '}', CGI.escape(collection.to_s)) + local_var_path = '/collections/{collection}'.sub('{collection}', CGI.escape(collection.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -399,7 +412,7 @@ def get_collection_with_http_info(collection, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -432,14 +445,14 @@ def get_collection_with_http_info(collection, opts = {}) # 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 [String] 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 + # @param collection [String] 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 # @param [Hash] opts the optional parameters - # @option opts [String] :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. # @option opts [String] :sort Sort # @option opts [String] :direction Sort direction # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) # @option opts [String] :_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. # @option opts [String] :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. + # @option opts [String] :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. # @return [Array] def list_collection_scores(collection, opts = {}) data, _status_code, _headers = list_collection_scores_with_http_info(collection, opts) @@ -448,14 +461,14 @@ def list_collection_scores(collection, opts = {}) # 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 [String] 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 + # @param collection [String] 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 # @param [Hash] opts the optional parameters - # @option opts [String] :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. # @option opts [String] :sort Sort # @option opts [String] :direction Sort direction # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) # @option opts [String] :_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. # @option opts [String] :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. + # @option opts [String] :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. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_collection_scores_with_http_info(collection, opts = {}) if @api_client.config.debugging @@ -482,21 +495,21 @@ def list_collection_scores_with_http_info(collection, opts = {}) end # resource path - local_var_path = '/collections/{collection}/scores'.sub('{' + 'collection' + '}', CGI.escape(collection.to_s)) + local_var_path = '/collections/{collection}/scores'.sub('{collection}', CGI.escape(collection.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? + query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -528,9 +541,9 @@ def list_collection_scores_with_http_info(collection, opts = {}) end # 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 [Hash] opts the optional parameters - # @option opts [String] :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`. (default to 'root') + # @option opts [String] :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`. (default to 'user') # @option opts [String] :sort Sort # @option opts [String] :direction Sort direction # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) @@ -543,9 +556,9 @@ def list_collections(opts = {}) end # 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 [Hash] opts the optional parameters - # @option opts [String] :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`. (default to 'root') + # @option opts [String] :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`. (default to 'user') # @option opts [String] :sort Sort # @option opts [String] :direction Sort direction # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) @@ -556,7 +569,7 @@ def list_collections_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CollectionApi.list_collections ...' end - allowable_values = ["creationDate", "title"] + allowable_values = ["creationDate", "modificationDate", "title"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end @@ -587,7 +600,7 @@ def list_collections_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -619,20 +632,20 @@ def list_collections_with_http_info(opts = {}) end # Untrash a collection - # This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. - # @param collection [String] 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 + # **DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + # @param collection [String] Unique identifier of the collection. # @param [Hash] opts the optional parameters - # @return [nil] + # @return [FlatErrorResponse] def untrash_collection(collection, opts = {}) - untrash_collection_with_http_info(collection, opts) - nil + data, _status_code, _headers = untrash_collection_with_http_info(collection, opts) + data end # Untrash a collection - # This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. - # @param collection [String] 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 + # **DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + # @param collection [String] Unique identifier of the collection. # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + # @return [Array<(FlatErrorResponse, Integer, Hash)>] FlatErrorResponse data, response status code and response headers def untrash_collection_with_http_info(collection, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CollectionApi.untrash_collection ...' @@ -642,7 +655,7 @@ def untrash_collection_with_http_info(collection, opts = {}) fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.untrash_collection" end # resource path - local_var_path = '/collections/{collection}/untrash'.sub('{' + 'collection' + '}', CGI.escape(collection.to_s)) + local_var_path = '/collections/{collection}/untrash'.sub('{collection}', CGI.escape(collection.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -650,7 +663,7 @@ def untrash_collection_with_http_info(collection, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -659,7 +672,7 @@ def untrash_collection_with_http_info(collection, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'FlatErrorResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] diff --git a/lib/flat_api/api/edu_resources_api.rb b/lib/flat_api/api/edu_resources_api.rb index 4551315..b6164ea 100644 --- a/lib/flat_api/api/edu_resources_api.rb +++ b/lib/flat_api/api/edu_resources_api.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -47,7 +47,7 @@ def copy_edu_resource_with_http_info(resource, edu_resource_copy, opts = {}) fail ArgumentError, "Missing the required parameter 'edu_resource_copy' when calling EduResourcesApi.copy_edu_resource" end # resource path - local_var_path = '/eduResources/{resource}/copy'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) + local_var_path = '/eduResources/{resource}/copy'.sub('{resource}', CGI.escape(resource.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -55,7 +55,7 @@ def copy_edu_resource_with_http_info(resource, edu_resource_copy, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -115,7 +115,7 @@ def copy_edu_resource_to_demo_class_with_http_info(resource, opts = {}) fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.copy_edu_resource_to_demo_class" end # resource path - local_var_path = '/eduResources/{resource}/copyToDemoClass'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) + local_var_path = '/eduResources/{resource}/copyToDemoClass'.sub('{resource}', CGI.escape(resource.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -123,7 +123,7 @@ def copy_edu_resource_to_demo_class_with_http_info(resource, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -184,7 +184,7 @@ def create_edu_resource_with_http_info(edu_resource_creation, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -244,7 +244,7 @@ def create_edu_resource_lti_link_with_http_info(resource, opts = {}) fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.create_edu_resource_lti_link" end # resource path - local_var_path = '/eduResources/{resource}/createLtiLink'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) + local_var_path = '/eduResources/{resource}/createLtiLink'.sub('{resource}', CGI.escape(resource.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -252,7 +252,7 @@ def create_edu_resource_lti_link_with_http_info(resource, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -305,7 +305,7 @@ def delete_edu_resource_with_http_info(resource, opts = {}) fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.delete_edu_resource" end # resource path - local_var_path = '/eduResources/{resource}'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) + local_var_path = '/eduResources/{resource}'.sub('{resource}', CGI.escape(resource.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -313,7 +313,7 @@ def delete_edu_resource_with_http_info(resource, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -366,7 +366,7 @@ def get_edu_resource_with_http_info(resource, opts = {}) fail ArgumentError, "Missing the required parameter 'resource' when calling EduResourcesApi.get_edu_resource" end # resource path - local_var_path = '/eduResources/{resource}'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) + local_var_path = '/eduResources/{resource}'.sub('{resource}', CGI.escape(resource.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -374,7 +374,7 @@ def get_edu_resource_with_http_info(resource, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -429,7 +429,7 @@ def list_edu_libraries_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -462,8 +462,12 @@ def list_edu_libraries_with_http_info(opts = {}) # List education resources in a library or folder # @param [Hash] opts the optional parameters - # @option opts [String] :parent List the resources contained in this `parent` library or folder (default to 'root') + # @option opts [String] :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 (default to 'root') + # @option opts [Boolean] :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. # @option opts [String] :type Filter the returned resources by type + # @option opts [Array] :subjects Filter the returned resources by subjects + # @option opts [Array] :assignment_types Filter the returned resources by assignment types + # @option opts [Array] :grades Filter the returned resources by grades # @option opts [String] :sort Sort (default to 'creationDate') # @option opts [String] :direction Sort direction # @option opts [Integer] :limit This is the maximum number of resources that may be returned (default to 25) @@ -477,8 +481,12 @@ def list_edu_resources(opts = {}) # List education resources in a library or folder # @param [Hash] opts the optional parameters - # @option opts [String] :parent List the resources contained in this `parent` library or folder (default to 'root') + # @option opts [String] :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 (default to 'root') + # @option opts [Boolean] :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. # @option opts [String] :type Filter the returned resources by type + # @option opts [Array] :subjects Filter the returned resources by subjects + # @option opts [Array] :assignment_types Filter the returned resources by assignment types + # @option opts [Array] :grades Filter the returned resources by grades # @option opts [String] :sort Sort (default to 'creationDate') # @option opts [String] :direction Sort direction # @option opts [Integer] :limit This is the maximum number of resources that may be returned (default to 25) @@ -515,7 +523,11 @@ def list_edu_resources_with_http_info(opts = {}) # query parameters query_params = opts[:query_params] || {} query_params[:'parent'] = opts[:'parent'] if !opts[:'parent'].nil? + query_params[:'withoutSubfoldersResources'] = opts[:'without_subfolders_resources'] if !opts[:'without_subfolders_resources'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? + query_params[:'subjects'] = @api_client.build_collection_param(opts[:'subjects'], :multi) if !opts[:'subjects'].nil? + query_params[:'assignmentTypes'] = @api_client.build_collection_param(opts[:'assignment_types'], :multi) if !opts[:'assignment_types'].nil? + query_params[:'grades'] = @api_client.build_collection_param(opts[:'grades'], :multi) if !opts[:'grades'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? @@ -525,7 +537,7 @@ def list_edu_resources_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -584,7 +596,7 @@ def move_edu_resource_with_http_info(resource, edu_resource_move, opts = {}) fail ArgumentError, "Missing the required parameter 'edu_resource_move' when calling EduResourcesApi.move_edu_resource" end # resource path - local_var_path = '/eduResources/{resource}/move'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) + local_var_path = '/eduResources/{resource}/move'.sub('{resource}', CGI.escape(resource.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -592,7 +604,7 @@ def move_edu_resource_with_http_info(resource, edu_resource_move, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -658,7 +670,7 @@ def update_edu_resource_with_http_info(resource, edu_resource_update, opts = {}) fail ArgumentError, "Missing the required parameter 'edu_resource_update' when calling EduResourcesApi.update_edu_resource" end # resource path - local_var_path = '/eduResources/{resource}'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) + local_var_path = '/eduResources/{resource}'.sub('{resource}', CGI.escape(resource.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -666,7 +678,7 @@ def update_edu_resource_with_http_info(resource, edu_resource_update, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -730,7 +742,7 @@ def update_edu_resource_assignment_with_http_info(resource, assignment_update, o fail ArgumentError, "Missing the required parameter 'assignment_update' when calling EduResourcesApi.update_edu_resource_assignment" end # resource path - local_var_path = '/eduResources/{resource}/assignment'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) + local_var_path = '/eduResources/{resource}/assignment'.sub('{resource}', CGI.escape(resource.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -738,7 +750,7 @@ def update_edu_resource_assignment_with_http_info(resource, assignment_update, o # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -804,7 +816,7 @@ def use_edu_resource_in_class_with_http_info(resource, edu_resource_use_in_class fail ArgumentError, "Missing the required parameter 'edu_resource_use_in_class' when calling EduResourcesApi.use_edu_resource_in_class" end # resource path - local_var_path = '/eduResources/{resource}/useInClass'.sub('{' + 'resource' + '}', CGI.escape(resource.to_s)) + local_var_path = '/eduResources/{resource}/useInClass'.sub('{resource}', CGI.escape(resource.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -812,7 +824,7 @@ def use_edu_resource_in_class_with_http_info(resource, edu_resource_use_in_class # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/lib/flat_api/api/group_api.rb b/lib/flat_api/api/group_api.rb index 2bc14c5..29bf45c 100644 --- a/lib/flat_api/api/group_api.rb +++ b/lib/flat_api/api/group_api.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -19,6 +19,211 @@ class GroupApi def initialize(api_client = ApiClient.default) @api_client = api_client end + # Add a student to a group + # Add a student to the specified group (must be in the same class) + # @param group [String] Unique identifier of a Flat group + # @param add_group_user_request [AddGroupUserRequest] + # @param [Hash] opts the optional parameters + # @return [AddGroupUser200Response] + def add_group_user(group, add_group_user_request, opts = {}) + data, _status_code, _headers = add_group_user_with_http_info(group, add_group_user_request, opts) + data + end + + # Add a student to a group + # Add a student to the specified group (must be in the same class) + # @param group [String] Unique identifier of a Flat group + # @param add_group_user_request [AddGroupUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(AddGroupUser200Response, Integer, Hash)>] AddGroupUser200Response data, response status code and response headers + def add_group_user_with_http_info(group, add_group_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GroupApi.add_group_user ...' + end + # verify the required parameter 'group' is set + if @api_client.config.client_side_validation && group.nil? + fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.add_group_user" + end + # verify the required parameter 'add_group_user_request' is set + if @api_client.config.client_side_validation && add_group_user_request.nil? + fail ArgumentError, "Missing the required parameter 'add_group_user_request' when calling GroupApi.add_group_user" + end + # resource path + local_var_path = '/groups/{group}/users'.sub('{group}', CGI.escape(group.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(add_group_user_request) + + # return_type + return_type = opts[:debug_return_type] || 'AddGroupUser200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"GroupApi.add_group_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GroupApi#add_group_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a new group + # Create a group of the given type, tied to a classroom, optionally with initial members. + # @param group_creation [GroupCreation] + # @param [Hash] opts the optional parameters + # @return [GroupDetails] + def create_group(group_creation, opts = {}) + data, _status_code, _headers = create_group_with_http_info(group_creation, opts) + data + end + + # Create a new group + # Create a group of the given type, tied to a classroom, optionally with initial members. + # @param group_creation [GroupCreation] + # @param [Hash] opts the optional parameters + # @return [Array<(GroupDetails, Integer, Hash)>] GroupDetails data, response status code and response headers + def create_group_with_http_info(group_creation, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GroupApi.create_group ...' + end + # verify the required parameter 'group_creation' is set + if @api_client.config.client_side_validation && group_creation.nil? + fail ArgumentError, "Missing the required parameter 'group_creation' when calling GroupApi.create_group" + end + # resource path + local_var_path = '/groups' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(group_creation) + + # return_type + return_type = opts[:debug_return_type] || 'GroupDetails' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"GroupApi.create_group", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GroupApi#create_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a group + # Delete a group. Only available to teachers of the classroom. + # @param group [String] Unique identifier of a Flat group + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_group(group, opts = {}) + delete_group_with_http_info(group, opts) + nil + end + + # Delete a group + # Delete a group. Only available to teachers of the classroom. + # @param group [String] Unique identifier of a Flat group + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_group_with_http_info(group, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GroupApi.delete_group ...' + end + # verify the required parameter 'group' is set + if @api_client.config.client_side_validation && group.nil? + fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.delete_group" + end + # resource path + local_var_path = '/groups/{group}'.sub('{group}', CGI.escape(group.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"GroupApi.delete_group", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GroupApi#delete_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get group information # @param group [String] Unique identifier of a Flat group # @param [Hash] opts the optional parameters @@ -41,7 +246,7 @@ def get_group_details_with_http_info(group, opts = {}) fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.get_group_details" end # resource path - local_var_path = '/groups/{group}'.sub('{' + 'group' + '}', CGI.escape(group.to_s)) + local_var_path = '/groups/{group}'.sub('{group}', CGI.escape(group.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -49,7 +254,7 @@ def get_group_details_with_http_info(group, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -106,7 +311,7 @@ def get_group_scores_with_http_info(group, opts = {}) fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.get_group_scores" end # resource path - local_var_path = '/groups/{group}/scores'.sub('{' + 'group' + '}', CGI.escape(group.to_s)) + local_var_path = '/groups/{group}/scores'.sub('{group}', CGI.escape(group.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -115,7 +320,7 @@ def get_group_scores_with_http_info(group, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -174,7 +379,7 @@ def list_group_users_with_http_info(group, opts = {}) fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}" end # resource path - local_var_path = '/groups/{group}/users'.sub('{' + 'group' + '}', CGI.escape(group.to_s)) + local_var_path = '/groups/{group}/users'.sub('{group}', CGI.escape(group.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -183,7 +388,7 @@ def list_group_users_with_http_info(group, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -213,5 +418,223 @@ def list_group_users_with_http_info(group, opts = {}) end return data, status_code, headers end + + # List groups + # List all groups of a given type, filtered by either a classroom or an assignment. + # @param type [String] + # @param [Hash] opts the optional parameters + # @option opts [String] :classroom Classroom ID to filter by + # @option opts [String] :assignment Assignment ID to filter by + # @return [Array] + def list_groups(type, opts = {}) + data, _status_code, _headers = list_groups_with_http_info(type, opts) + data + end + + # List groups + # List all groups of a given type, filtered by either a classroom or an assignment. + # @param type [String] + # @param [Hash] opts the optional parameters + # @option opts [String] :classroom Classroom ID to filter by + # @option opts [String] :assignment Assignment ID to filter by + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_groups_with_http_info(type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GroupApi.list_groups ...' + end + # verify the required parameter 'type' is set + if @api_client.config.client_side_validation && type.nil? + fail ArgumentError, "Missing the required parameter 'type' when calling GroupApi.list_groups" + end + # verify enum value + allowable_values = ["classStudentsSubGroup", "assignmentStudentsSubGroup"] + if @api_client.config.client_side_validation && !allowable_values.include?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/groups' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'type'] = type + query_params[:'classroom'] = opts[:'classroom'] if !opts[:'classroom'].nil? + query_params[:'assignment'] = opts[:'assignment'] if !opts[:'assignment'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"GroupApi.list_groups", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GroupApi#list_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Remove a student from a class group + # Remove a student from a class group + # @param group [String] Unique identifier of a Flat group + # @param user [String] User ID + # @param [Hash] opts the optional parameters + # @return [nil] + def remove_group_user(group, user, opts = {}) + remove_group_user_with_http_info(group, user, opts) + nil + end + + # Remove a student from a class group + # Remove a student from a class group + # @param group [String] Unique identifier of a Flat group + # @param user [String] User ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_group_user_with_http_info(group, user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GroupApi.remove_group_user ...' + end + # verify the required parameter 'group' is set + if @api_client.config.client_side_validation && group.nil? + fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.remove_group_user" + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling GroupApi.remove_group_user" + end + # resource path + local_var_path = '/groups/{group}/users/{user}'.sub('{group}', CGI.escape(group.to_s)).sub('{user}', CGI.escape(user.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"GroupApi.remove_group_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GroupApi#remove_group_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Rename a group + # Rename a sub-group. Only available for class student groups. + # @param group [String] Unique identifier of a Flat group + # @param rename_group_request [RenameGroupRequest] + # @param [Hash] opts the optional parameters + # @return [GroupDetails] + def rename_group(group, rename_group_request, opts = {}) + data, _status_code, _headers = rename_group_with_http_info(group, rename_group_request, opts) + data + end + + # Rename a group + # Rename a sub-group. Only available for class student groups. + # @param group [String] Unique identifier of a Flat group + # @param rename_group_request [RenameGroupRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(GroupDetails, Integer, Hash)>] GroupDetails data, response status code and response headers + def rename_group_with_http_info(group, rename_group_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: GroupApi.rename_group ...' + end + # verify the required parameter 'group' is set + if @api_client.config.client_side_validation && group.nil? + fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.rename_group" + end + # verify the required parameter 'rename_group_request' is set + if @api_client.config.client_side_validation && rename_group_request.nil? + fail ArgumentError, "Missing the required parameter 'rename_group_request' when calling GroupApi.rename_group" + end + # resource path + local_var_path = '/groups/{group}'.sub('{group}', CGI.escape(group.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(rename_group_request) + + # return_type + return_type = opts[:debug_return_type] || 'GroupDetails' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"GroupApi.rename_group", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: GroupApi#rename_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/flat_api/api/omr_api.rb b/lib/flat_api/api/omr_api.rb new file mode 100644 index 0000000..ef1912e --- /dev/null +++ b/lib/flat_api/api/omr_api.rb @@ -0,0 +1,894 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'cgi' + +module FlatApi + class OMRApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # 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 [String] Unique identifier of the OMR job + # @param omr_job_file_upload [OmrJobFileUpload] + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [OmrJobFileUploadResult] + def add_omr_job_file(job, omr_job_file_upload, opts = {}) + data, _status_code, _headers = add_omr_job_file_with_http_info(job, omr_job_file_upload, opts) + data + end + + # 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 [String] Unique identifier of the OMR job + # @param omr_job_file_upload [OmrJobFileUpload] + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [Array<(OmrJobFileUploadResult, Integer, Hash)>] OmrJobFileUploadResult data, response status code and response headers + def add_omr_job_file_with_http_info(job, omr_job_file_upload, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.add_omr_job_file ...' + end + # verify the required parameter 'job' is set + if @api_client.config.client_side_validation && job.nil? + fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.add_omr_job_file" + end + # verify the required parameter 'omr_job_file_upload' is set + if @api_client.config.client_side_validation && omr_job_file_upload.nil? + fail ArgumentError, "Missing the required parameter 'omr_job_file_upload' when calling OMRApi.add_omr_job_file" + end + # resource path + local_var_path = '/omr/jobs/{job}/files'.sub('{job}', CGI.escape(job.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(omr_job_file_upload) + + # return_type + return_type = opts[:debug_return_type] || 'OmrJobFileUploadResult' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.add_omr_job_file", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#add_omr_job_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Cancel an OMR job + # Cancel a draft or in-flight job. Any charged credits are reversed. + # @param job [String] Unique identifier of the OMR job + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [OmrJob] + def cancel_omr_job(job, opts = {}) + data, _status_code, _headers = cancel_omr_job_with_http_info(job, opts) + data + end + + # Cancel an OMR job + # Cancel a draft or in-flight job. Any charged credits are reversed. + # @param job [String] Unique identifier of the OMR job + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [Array<(OmrJob, Integer, Hash)>] OmrJob data, response status code and response headers + def cancel_omr_job_with_http_info(job, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.cancel_omr_job ...' + end + # verify the required parameter 'job' is set + if @api_client.config.client_side_validation && job.nil? + fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.cancel_omr_job" + end + # resource path + local_var_path = '/omr/jobs/{job}/cancel'.sub('{job}', CGI.escape(job.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OmrJob' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.cancel_omr_job", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#cancel_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # 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 [OmrJobCreation] + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [OmrJob] + def create_omr_job(omr_job_creation, opts = {}) + data, _status_code, _headers = create_omr_job_with_http_info(omr_job_creation, opts) + data + end + + # 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 [OmrJobCreation] + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [Array<(OmrJob, Integer, Hash)>] OmrJob data, response status code and response headers + def create_omr_job_with_http_info(omr_job_creation, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.create_omr_job ...' + end + # verify the required parameter 'omr_job_creation' is set + if @api_client.config.client_side_validation && omr_job_creation.nil? + fail ArgumentError, "Missing the required parameter 'omr_job_creation' when calling OMRApi.create_omr_job" + end + # resource path + local_var_path = '/omr/jobs' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(omr_job_creation) + + # return_type + return_type = opts[:debug_return_type] || 'OmrJob' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.create_omr_job", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#create_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # 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 [String] Unique identifier of the OMR job + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [OmrJob] + def delete_omr_job(job, opts = {}) + data, _status_code, _headers = delete_omr_job_with_http_info(job, opts) + data + end + + # 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 [String] Unique identifier of the OMR job + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [Array<(OmrJob, Integer, Hash)>] OmrJob data, response status code and response headers + def delete_omr_job_with_http_info(job, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.delete_omr_job ...' + end + # verify the required parameter 'job' is set + if @api_client.config.client_side_validation && job.nil? + fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.delete_omr_job" + end + # resource path + local_var_path = '/omr/jobs/{job}'.sub('{job}', CGI.escape(job.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OmrJob' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.delete_omr_job", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#delete_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # 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 [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [OmrCapabilities] + def get_omr_capabilities(opts = {}) + data, _status_code, _headers = get_omr_capabilities_with_http_info(opts) + data + end + + # 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 [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [Array<(OmrCapabilities, Integer, Hash)>] OmrCapabilities data, response status code and response headers + def get_omr_capabilities_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.get_omr_capabilities ...' + end + # resource path + local_var_path = '/omr/capabilities' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OmrCapabilities' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.get_omr_capabilities", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#get_omr_capabilities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # 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 [String] Unique identifier of the OMR job + # @param [Hash] opts the optional parameters + # @option opts [Integer] :wait Long-poll up to this many seconds for a state change before returning. + # @option opts [String] :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`. + # @return [OmrJob] + def get_omr_job(job, opts = {}) + data, _status_code, _headers = get_omr_job_with_http_info(job, opts) + data + end + + # 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 [String] Unique identifier of the OMR job + # @param [Hash] opts the optional parameters + # @option opts [Integer] :wait Long-poll up to this many seconds for a state change before returning. + # @option opts [String] :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`. + # @return [Array<(OmrJob, Integer, Hash)>] OmrJob data, response status code and response headers + def get_omr_job_with_http_info(job, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.get_omr_job ...' + end + # verify the required parameter 'job' is set + if @api_client.config.client_side_validation && job.nil? + fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.get_omr_job" + end + if @api_client.config.client_side_validation && !opts[:'wait'].nil? && opts[:'wait'] > 25 + fail ArgumentError, 'invalid value for "opts[:"wait"]" when calling OMRApi.get_omr_job, must be smaller than or equal to 25.' + end + + if @api_client.config.client_side_validation && !opts[:'wait'].nil? && opts[:'wait'] < 0 + fail ArgumentError, 'invalid value for "opts[:"wait"]" when calling OMRApi.get_omr_job, must be greater than or equal to 0.' + end + + # resource path + local_var_path = '/omr/jobs/{job}'.sub('{job}', CGI.escape(job.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'wait'] = opts[:'wait'] if !opts[:'wait'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OmrJob' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.get_omr_job", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#get_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # 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 [String] Unique identifier of the OMR job + # @param format [String] 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`). + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [File] + def get_omr_job_export(job, format, opts = {}) + data, _status_code, _headers = get_omr_job_export_with_http_info(job, format, opts) + data + end + + # 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 [String] Unique identifier of the OMR job + # @param format [String] 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`). + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_omr_job_export_with_http_info(job, format, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.get_omr_job_export ...' + end + # verify the required parameter 'job' is set + if @api_client.config.client_side_validation && job.nil? + fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.get_omr_job_export" + end + # verify the required parameter 'format' is set + if @api_client.config.client_side_validation && format.nil? + fail ArgumentError, "Missing the required parameter 'format' when calling OMRApi.get_omr_job_export" + end + # verify enum value + allowable_values = ["musicxml", "mxl", "midi", "thumbnail.png"] + if @api_client.config.client_side_validation && !allowable_values.include?(format) + fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/omr/jobs/{job}/exports/{format}'.sub('{job}', CGI.escape(job.to_s)).sub('{format}', CGI.escape(format.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) unless header_params['Accept'] + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'File' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.get_omr_job_export", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#get_omr_job_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # 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 [String] Unique identifier of the OMR job + # @param index [Integer] 0-based index of the input file (page) to fetch. + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [File] + def get_omr_job_file(job, index, opts = {}) + data, _status_code, _headers = get_omr_job_file_with_http_info(job, index, opts) + data + end + + # 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 [String] Unique identifier of the OMR job + # @param index [Integer] 0-based index of the input file (page) to fetch. + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_omr_job_file_with_http_info(job, index, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.get_omr_job_file ...' + end + # verify the required parameter 'job' is set + if @api_client.config.client_side_validation && job.nil? + fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.get_omr_job_file" + end + # verify the required parameter 'index' is set + if @api_client.config.client_side_validation && index.nil? + fail ArgumentError, "Missing the required parameter 'index' when calling OMRApi.get_omr_job_file" + end + # resource path + local_var_path = '/omr/jobs/{job}/files/{index}'.sub('{job}', CGI.escape(job.to_s)).sub('{index}', CGI.escape(index.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['image/jpeg', 'application/json']) unless header_params['Accept'] + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'File' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.get_omr_job_file", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#get_omr_job_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # 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 [Hash] opts the optional parameters + # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 50) + # @option opts [String] :_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. + # @option opts [String] :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. + # @return [Array] + def list_billing_credits_history(opts = {}) + data, _status_code, _headers = list_billing_credits_history_with_http_info(opts) + data + end + + # 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 [Hash] opts the optional parameters + # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 50) + # @option opts [String] :_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. + # @option opts [String] :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. + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_billing_credits_history_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.list_billing_credits_history ...' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OMRApi.list_billing_credits_history, must be smaller than or equal to 1000.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OMRApi.list_billing_credits_history, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/billing/credits/history' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? + query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.list_billing_credits_history", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#list_billing_credits_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List OMR jobs + # List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + # @param [Hash] opts the optional parameters + # @option opts [OmrJobStatus] :status Filter jobs by status + # @option opts [Boolean] :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. + # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 50) + # @option opts [String] :_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. + # @option opts [String] :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. + # @option opts [String] :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`. + # @return [Array] + def list_omr_jobs(opts = {}) + data, _status_code, _headers = list_omr_jobs_with_http_info(opts) + data + end + + # List OMR jobs + # List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + # @param [Hash] opts the optional parameters + # @option opts [OmrJobStatus] :status Filter jobs by status + # @option opts [Boolean] :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. + # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 50) + # @option opts [String] :_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. + # @option opts [String] :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. + # @option opts [String] :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`. + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_omr_jobs_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.list_omr_jobs ...' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OMRApi.list_omr_jobs, must be smaller than or equal to 1000.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OMRApi.list_omr_jobs, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/omr/jobs' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? + query_params[:'expired'] = opts[:'expired'] if !opts[:'expired'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? + query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.list_omr_jobs", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#list_omr_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Start an OMR job + # Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + # @param job [String] Unique identifier of the OMR job + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [OmrJob] + def start_omr_job(job, opts = {}) + data, _status_code, _headers = start_omr_job_with_http_info(job, opts) + data + end + + # Start an OMR job + # Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + # @param job [String] Unique identifier of the OMR job + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [Array<(OmrJob, Integer, Hash)>] OmrJob data, response status code and response headers + def start_omr_job_with_http_info(job, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.start_omr_job ...' + end + # verify the required parameter 'job' is set + if @api_client.config.client_side_validation && job.nil? + fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.start_omr_job" + end + # resource path + local_var_path = '/omr/jobs/{job}/start'.sub('{job}', CGI.escape(job.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OmrJob' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.start_omr_job", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#start_omr_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # 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 [String] Unique identifier of the OMR job + # @param step [OmrStepName] The pending step being submitted + # @param body [OmrDetailsSubmission] + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [OmrJob] + def submit_omr_job_step(job, step, body, opts = {}) + data, _status_code, _headers = submit_omr_job_step_with_http_info(job, step, body, opts) + data + end + + # 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 [String] Unique identifier of the OMR job + # @param step [OmrStepName] The pending step being submitted + # @param body [OmrDetailsSubmission] + # @param [Hash] opts the optional parameters + # @option opts [String] :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`. + # @return [Array<(OmrJob, Integer, Hash)>] OmrJob data, response status code and response headers + def submit_omr_job_step_with_http_info(job, step, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OMRApi.submit_omr_job_step ...' + end + # verify the required parameter 'job' is set + if @api_client.config.client_side_validation && job.nil? + fail ArgumentError, "Missing the required parameter 'job' when calling OMRApi.submit_omr_job_step" + end + # verify the required parameter 'step' is set + if @api_client.config.client_side_validation && step.nil? + fail ArgumentError, "Missing the required parameter 'step' when calling OMRApi.submit_omr_job_step" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OMRApi.submit_omr_job_step" + end + # resource path + local_var_path = '/omr/jobs/{job}/steps/{step}'.sub('{job}', CGI.escape(job.to_s)).sub('{step}', CGI.escape(step.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + header_params[:'X-Flat-Locale'] = opts[:'x_flat_locale'] if !opts[:'x_flat_locale'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OmrJob' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OMRApi.submit_omr_job_step", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OMRApi#submit_omr_job_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/flat_api/api/organization_api.rb b/lib/flat_api/api/organization_api.rb index 052828f..a669b60 100644 --- a/lib/flat_api/api/organization_api.rb +++ b/lib/flat_api/api/organization_api.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -25,7 +25,8 @@ def initialize(api_client = ApiClient.default) # @option opts [String] :q The query to search # @option opts [Array] :group Filter users by group # @option opts [Boolean] :no_active_license Filter users who don't have an active license - # @return [Array] + # @option opts [String] :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. + # @return [Integer] def count_orga_users(opts = {}) data, _status_code, _headers = count_orga_users_with_http_info(opts) data @@ -37,15 +38,20 @@ def count_orga_users(opts = {}) # @option opts [String] :q The query to search # @option opts [Array] :group Filter users by group # @option opts [Boolean] :no_active_license Filter users who don't have an active license - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + # @option opts [String] :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. + # @return [Array<(Integer, Integer, Hash)>] Integer data, response status code and response headers def count_orga_users_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OrganizationApi.count_orga_users ...' end - allowable_values = ["user", "teacher", "admin"] + allowable_values = ["user", "teacher", "admin", "accountAdmin"] if @api_client.config.client_side_validation && opts[:'role'] && !opts[:'role'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"role\", must include one of #{allowable_values}" end + allowable_values = ["exclude", "only"] + if @api_client.config.client_side_validation && opts[:'test_accounts'] && !allowable_values.include?(opts[:'test_accounts']) + fail ArgumentError, "invalid value for \"test_accounts\", must be one of #{allowable_values}" + end # resource path local_var_path = '/organizations/users/count' @@ -55,11 +61,12 @@ def count_orga_users_with_http_info(opts = {}) query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? query_params[:'group'] = @api_client.build_collection_param(opts[:'group'], :multi) if !opts[:'group'].nil? query_params[:'noActiveLicense'] = opts[:'no_active_license'] if !opts[:'no_active_license'].nil? + query_params[:'testAccounts'] = opts[:'test_accounts'] if !opts[:'test_accounts'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -68,7 +75,7 @@ def count_orga_users_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Array' + return_type = opts[:debug_return_type] || 'Integer' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] @@ -90,8 +97,74 @@ def count_orga_users_with_http_info(opts = {}) return data, status_code, headers end + # Create a new LTI configuration (1.1 or 1.3) + # @param lti_configuration_create [LtiConfigurationCreate] + # @param [Hash] opts the optional parameters + # @return [LtiConfiguration] + def create_lti_configuration(lti_configuration_create, opts = {}) + data, _status_code, _headers = create_lti_configuration_with_http_info(lti_configuration_create, opts) + data + end + + # Create a new LTI configuration (1.1 or 1.3) + # @param lti_configuration_create [LtiConfigurationCreate] + # @param [Hash] opts the optional parameters + # @return [Array<(LtiConfiguration, Integer, Hash)>] LtiConfiguration data, response status code and response headers + def create_lti_configuration_with_http_info(lti_configuration_create, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationApi.create_lti_configuration ...' + end + # verify the required parameter 'lti_configuration_create' is set + if @api_client.config.client_side_validation && lti_configuration_create.nil? + fail ArgumentError, "Missing the required parameter 'lti_configuration_create' when calling OrganizationApi.create_lti_configuration" + end + # resource path + local_var_path = '/organizations/lti/configurations' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(lti_configuration_create) + + # return_type + return_type = opts[:debug_return_type] || 'LtiConfiguration' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OrganizationApi.create_lti_configuration", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrganizationApi#create_lti_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # 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 [LtiCredentialsCreation] # @param [Hash] opts the optional parameters # @return [LtiCredentials] @@ -101,7 +174,7 @@ def create_lti_credentials(body, opts = {}) end # 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 [LtiCredentialsCreation] # @param [Hash] opts the optional parameters # @return [Array<(LtiCredentials, Integer, Hash)>] LtiCredentials data, response status code and response headers @@ -122,7 +195,7 @@ def create_lti_credentials_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -190,7 +263,7 @@ def create_organization_invitation_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -256,7 +329,7 @@ def create_organization_user_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -322,7 +395,7 @@ def create_organization_user_access_token_with_http_info(user, organization_user fail ArgumentError, "Missing the required parameter 'organization_user_access_token_creation' when calling OrganizationApi.create_organization_user_access_token" end # resource path - local_var_path = '/organizations/users/{user}/accessToken'.sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/organizations/users/{user}/accessToken'.sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -330,7 +403,7 @@ def create_organization_user_access_token_with_http_info(user, organization_user # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -394,7 +467,7 @@ def create_organization_user_signin_link_with_http_info(user, user_signin_link_c fail ArgumentError, "Missing the required parameter 'user_signin_link_creation' when calling OrganizationApi.create_organization_user_signin_link" end # resource path - local_var_path = '/organizations/users/{user}/signinLink'.sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/organizations/users/{user}/signinLink'.sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -402,7 +475,7 @@ def create_organization_user_signin_link_with_http_info(user, user_signin_link_c # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -438,7 +511,124 @@ def create_organization_user_signin_link_with_http_info(user, user_signin_link_c return data, status_code, headers end + # Delete an LTI configuration + # @param configuration [String] Configuration unique identifier + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_lti_configuration(configuration, opts = {}) + delete_lti_configuration_with_http_info(configuration, opts) + nil + end + + # Delete an LTI configuration + # @param configuration [String] Configuration unique identifier + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_lti_configuration_with_http_info(configuration, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationApi.delete_lti_configuration ...' + end + # verify the required parameter 'configuration' is set + if @api_client.config.client_side_validation && configuration.nil? + fail ArgumentError, "Missing the required parameter 'configuration' when calling OrganizationApi.delete_lti_configuration" + end + # resource path + local_var_path = '/organizations/lti/configurations/{configuration}'.sub('{configuration}', CGI.escape(configuration.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OrganizationApi.delete_lti_configuration", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrganizationApi#delete_lti_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List LTI configurations (1.1 and 1.3) + # @param [Hash] opts the optional parameters + # @return [Array] + def list_lti_configurations(opts = {}) + data, _status_code, _headers = list_lti_configurations_with_http_info(opts) + data + end + + # List LTI configurations (1.1 and 1.3) + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_lti_configurations_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationApi.list_lti_configurations ...' + end + # resource path + local_var_path = '/organizations/lti/configurations' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OrganizationApi.list_lti_configurations", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrganizationApi#list_lti_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # 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 [Hash] opts the optional parameters # @return [Array] def list_lti_credentials(opts = {}) @@ -447,6 +637,7 @@ def list_lti_credentials(opts = {}) end # 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 [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def list_lti_credentials_with_http_info(opts = {}) @@ -462,7 +653,7 @@ def list_lti_credentials_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -541,7 +732,7 @@ def list_organization_invitations_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -574,7 +765,7 @@ def list_organization_invitations_with_http_info(opts = {}) # List the organization users # @param [Hash] opts the optional parameters - # @option opts [Array] :sort The order to sort the user list + # @option opts [String] :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. # @option opts [String] :direction Sort direction # @option opts [String] :_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. # @option opts [String] :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. @@ -582,6 +773,7 @@ def list_organization_invitations_with_http_info(opts = {}) # @option opts [String] :q The query to search # @option opts [Array] :group Filter users by group # @option opts [Boolean] :no_active_license Filter users who don't have an active license + # @option opts [String] :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. # @option opts [Array] :license_expiration_date Filter users by license expiration date or `active` / `notActive` # @option opts [Boolean] :only_ids Return only user ids # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) @@ -593,7 +785,7 @@ def list_organization_users(opts = {}) # List the organization users # @param [Hash] opts the optional parameters - # @option opts [Array] :sort The order to sort the user list + # @option opts [String] :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. # @option opts [String] :direction Sort direction # @option opts [String] :_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. # @option opts [String] :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. @@ -601,6 +793,7 @@ def list_organization_users(opts = {}) # @option opts [String] :q The query to search # @option opts [Array] :group Filter users by group # @option opts [Boolean] :no_active_license Filter users who don't have an active license + # @option opts [String] :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. # @option opts [Array] :license_expiration_date Filter users by license expiration date or `active` / `notActive` # @option opts [Boolean] :only_ids Return only user ids # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) @@ -609,18 +802,22 @@ def list_organization_users_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OrganizationApi.list_organization_users ...' end - allowable_values = ["firstname", "lastname", "lastActivityDate", "licenseExpirationDate"] - if @api_client.config.client_side_validation && opts[:'sort'] && !opts[:'sort'].all? { |item| allowable_values.include?(item) } - fail ArgumentError, "invalid value for \"sort\", must include one of #{allowable_values}" + allowable_values = ["creationDate", "firstname", "lastname", "username", "lastActivityDate", "licenseExpirationDate"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end allowable_values = ["asc", "desc"] if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction']) fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}" end - allowable_values = ["user", "teacher", "admin"] + allowable_values = ["user", "teacher", "admin", "accountAdmin"] if @api_client.config.client_side_validation && opts[:'role'] && !opts[:'role'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"role\", must include one of #{allowable_values}" end + allowable_values = ["exclude", "only"] + if @api_client.config.client_side_validation && opts[:'test_accounts'] && !allowable_values.include?(opts[:'test_accounts']) + fail ArgumentError, "invalid value for \"test_accounts\", must be one of #{allowable_values}" + end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrganizationApi.list_organization_users, must be smaller than or equal to 1000.' end @@ -634,7 +831,7 @@ def list_organization_users_with_http_info(opts = {}) # query parameters query_params = opts[:query_params] || {} - query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil? query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? @@ -642,6 +839,7 @@ def list_organization_users_with_http_info(opts = {}) query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? query_params[:'group'] = @api_client.build_collection_param(opts[:'group'], :multi) if !opts[:'group'].nil? query_params[:'noActiveLicense'] = opts[:'no_active_license'] if !opts[:'no_active_license'].nil? + query_params[:'testAccounts'] = opts[:'test_accounts'] if !opts[:'test_accounts'].nil? query_params[:'licenseExpirationDate'] = @api_client.build_collection_param(opts[:'license_expiration_date'], :multi) if !opts[:'license_expiration_date'].nil? query_params[:'onlyIds'] = opts[:'only_ids'] if !opts[:'only_ids'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? @@ -649,7 +847,7 @@ def list_organization_users_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -702,7 +900,7 @@ def remove_organization_invitation_with_http_info(invitation, opts = {}) fail ArgumentError, "Missing the required parameter 'invitation' when calling OrganizationApi.remove_organization_invitation" end # resource path - local_var_path = '/organizations/invitations/{invitation}'.sub('{' + 'invitation' + '}', CGI.escape(invitation.to_s)) + local_var_path = '/organizations/invitations/{invitation}'.sub('{invitation}', CGI.escape(invitation.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -710,7 +908,7 @@ def remove_organization_invitation_with_http_info(invitation, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -767,7 +965,7 @@ def remove_organization_user_with_http_info(user, opts = {}) fail ArgumentError, "Missing the required parameter 'user' when calling OrganizationApi.remove_organization_user" end # resource path - local_var_path = '/organizations/users/{user}'.sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/organizations/users/{user}'.sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -776,7 +974,7 @@ def remove_organization_user_with_http_info(user, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -808,6 +1006,7 @@ def remove_organization_user_with_http_info(user, opts = {}) end # 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 [String] Credentials unique identifier # @param [Hash] opts the optional parameters # @return [nil] @@ -817,6 +1016,7 @@ def revoke_lti_credentials(credentials, opts = {}) end # 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 [String] Credentials unique identifier # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -829,7 +1029,7 @@ def revoke_lti_credentials_with_http_info(credentials, opts = {}) fail ArgumentError, "Missing the required parameter 'credentials' when calling OrganizationApi.revoke_lti_credentials" end # resource path - local_var_path = '/organizations/lti/credentials/{credentials}'.sub('{' + 'credentials' + '}', CGI.escape(credentials.to_s)) + local_var_path = '/organizations/lti/credentials/{credentials}'.sub('{credentials}', CGI.escape(credentials.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -837,7 +1037,7 @@ def revoke_lti_credentials_with_http_info(credentials, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -868,6 +1068,78 @@ def revoke_lti_credentials_with_http_info(credentials, opts = {}) return data, status_code, headers end + # Update an existing LTI configuration (edit 1.3; 1.1 not editable) + # @param configuration [String] Configuration unique identifier + # @param lti_configuration_update [LtiConfigurationUpdate] + # @param [Hash] opts the optional parameters + # @return [LtiConfiguration] + def update_lti_configuration(configuration, lti_configuration_update, opts = {}) + data, _status_code, _headers = update_lti_configuration_with_http_info(configuration, lti_configuration_update, opts) + data + end + + # Update an existing LTI configuration (edit 1.3; 1.1 not editable) + # @param configuration [String] Configuration unique identifier + # @param lti_configuration_update [LtiConfigurationUpdate] + # @param [Hash] opts the optional parameters + # @return [Array<(LtiConfiguration, Integer, Hash)>] LtiConfiguration data, response status code and response headers + def update_lti_configuration_with_http_info(configuration, lti_configuration_update, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationApi.update_lti_configuration ...' + end + # verify the required parameter 'configuration' is set + if @api_client.config.client_side_validation && configuration.nil? + fail ArgumentError, "Missing the required parameter 'configuration' when calling OrganizationApi.update_lti_configuration" + end + # verify the required parameter 'lti_configuration_update' is set + if @api_client.config.client_side_validation && lti_configuration_update.nil? + fail ArgumentError, "Missing the required parameter 'lti_configuration_update' when calling OrganizationApi.update_lti_configuration" + end + # resource path + local_var_path = '/organizations/lti/configurations/{configuration}'.sub('{configuration}', CGI.escape(configuration.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(lti_configuration_update) + + # return_type + return_type = opts[:debug_return_type] || 'LtiConfiguration' + + # auth_names + auth_names = opts[:debug_auth_names] || ['OAuth2'] + + new_options = opts.merge( + :operation => :"OrganizationApi.update_lti_configuration", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrganizationApi#update_lti_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update account information # @param user [String] Unique identifier of the Flat account # @param body [UserAdminUpdate] @@ -896,7 +1168,7 @@ def update_organization_user_with_http_info(user, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling OrganizationApi.update_organization_user" end # resource path - local_var_path = '/organizations/users/{user}'.sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/organizations/users/{user}'.sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -904,7 +1176,7 @@ def update_organization_user_with_http_info(user, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/lib/flat_api/api/score_api.rb b/lib/flat_api/api/score_api.rb index d864ecc..6d45d53 100644 --- a/lib/flat_api/api/score_api.rb +++ b/lib/flat_api/api/score_api.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -49,7 +49,7 @@ def add_score_collaborator_with_http_info(score, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.add_score_collaborator" end # resource path - local_var_path = '/scores/{score}/collaborators'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/collaborators'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -57,7 +57,7 @@ def add_score_collaborator_with_http_info(score, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -98,7 +98,7 @@ def add_score_collaborator_with_http_info(score, body, opts = {}) # @param score [String] 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`). # @param body [ScoreTrackCreation] # @param [Hash] opts the optional parameters - # @return [ScoreTrack] + # @return [ScoreTrackCreationResponse] def add_score_track(score, body, opts = {}) data, _status_code, _headers = add_score_track_with_http_info(score, body, opts) data @@ -109,7 +109,7 @@ def add_score_track(score, body, opts = {}) # @param score [String] 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`). # @param body [ScoreTrackCreation] # @param [Hash] opts the optional parameters - # @return [Array<(ScoreTrack, Integer, Hash)>] ScoreTrack data, response status code and response headers + # @return [Array<(ScoreTrackCreationResponse, Integer, Hash)>] ScoreTrackCreationResponse data, response status code and response headers def add_score_track_with_http_info(score, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ScoreApi.add_score_track ...' @@ -123,7 +123,7 @@ def add_score_track_with_http_info(score, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.add_score_track" end # resource path - local_var_path = '/scores/{score}/tracks'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/tracks'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -131,7 +131,7 @@ def add_score_track_with_http_info(score, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -145,7 +145,7 @@ def add_score_track_with_http_info(score, body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'ScoreTrack' + return_type = opts[:debug_return_type] || 'ScoreTrackCreationResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2'] @@ -212,7 +212,7 @@ def create_export_task_with_http_info(score, revision, format, opts = {}) fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}" end # resource path - local_var_path = '/scores/{score}/revisions/{revision}/{format}/task'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'revision' + '}', CGI.escape(revision.to_s)).sub('{' + 'format' + '}', CGI.escape(format.to_s)) + local_var_path = '/scores/{score}/revisions/{revision}/{format}/task'.sub('{score}', CGI.escape(score.to_s)).sub('{revision}', CGI.escape(revision.to_s)).sub('{format}', CGI.escape(format.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -221,7 +221,7 @@ def create_export_task_with_http_info(score, revision, format, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -258,7 +258,7 @@ def create_export_task_with_http_info(score, revision, format, opts = {}) end # 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 [ScoreCreation] # @param [Hash] opts the optional parameters # @return [ScoreDetails] @@ -268,7 +268,7 @@ def create_score(body, opts = {}) end # 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 [ScoreCreation] # @param [Hash] opts the optional parameters # @return [Array<(ScoreDetails, Integer, Hash)>] ScoreDetails data, response status code and response headers @@ -289,7 +289,7 @@ def create_score_with_http_info(body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -355,7 +355,7 @@ def create_score_revision_with_http_info(score, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.create_score_revision" end # resource path - local_var_path = '/scores/{score}/revisions'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/revisions'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -363,7 +363,7 @@ def create_score_revision_with_http_info(score, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -400,7 +400,7 @@ def create_score_revision_with_http_info(score, body, opts = {}) end # 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 [String] 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`). # @param [Hash] opts the optional parameters # @option opts [Boolean] :now If `true`, the score deletion will be scheduled to be done ASAP (default to false) @@ -411,7 +411,7 @@ def delete_score(score, opts = {}) end # 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 [String] 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`). # @param [Hash] opts the optional parameters # @option opts [Boolean] :now If `true`, the score deletion will be scheduled to be done ASAP (default to false) @@ -425,7 +425,7 @@ def delete_score_with_http_info(score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.delete_score" end # resource path - local_var_path = '/scores/{score}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -434,7 +434,7 @@ def delete_score_with_http_info(score, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -469,6 +469,7 @@ def delete_score_with_http_info(score, opts = {}) # @param score [String] 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`). # @param comment [String] Unique identifier of a sheet music comment # @param [Hash] opts the optional parameters + # @option opts [String] :event_properties Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` # @option opts [String] :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. # @return [nil] def delete_score_comment(score, comment, opts = {}) @@ -480,6 +481,7 @@ def delete_score_comment(score, comment, opts = {}) # @param score [String] 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`). # @param comment [String] Unique identifier of a sheet music comment # @param [Hash] opts the optional parameters + # @option opts [String] :event_properties Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` # @option opts [String] :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. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_score_comment_with_http_info(score, comment, opts = {}) @@ -495,16 +497,22 @@ def delete_score_comment_with_http_info(score, comment, opts = {}) fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.delete_score_comment" end # resource path - local_var_path = '/scores/{score}/comments/{comment}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'comment' + '}', CGI.escape(comment.to_s)) + local_var_path = '/scores/{score}/comments/{comment}'.sub('{score}', CGI.escape(score.to_s)).sub('{comment}', CGI.escape(comment.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'eventProperties'] = opts[:'event_properties'] if !opts[:'event_properties'].nil? query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -563,7 +571,7 @@ def delete_score_track_with_http_info(score, track, opts = {}) fail ArgumentError, "Missing the required parameter 'track' when calling ScoreApi.delete_score_track" end # resource path - local_var_path = '/scores/{score}/tracks/{track}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'track' + '}', CGI.escape(track.to_s)) + local_var_path = '/scores/{score}/tracks/{track}'.sub('{score}', CGI.escape(score.to_s)).sub('{track}', CGI.escape(track.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -571,7 +579,7 @@ def delete_score_track_with_http_info(score, track, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -632,7 +640,7 @@ def edit_score_with_http_info(score, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.edit_score" end # resource path - local_var_path = '/scores/{score}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -640,7 +648,7 @@ def edit_score_with_http_info(score, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -708,7 +716,7 @@ def fork_score_with_http_info(score, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.fork_score" end # resource path - local_var_path = '/scores/{score}/fork'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/fork'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -717,7 +725,7 @@ def fork_score_with_http_info(score, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -779,7 +787,7 @@ def get_group_scores_with_http_info(group, opts = {}) fail ArgumentError, "Missing the required parameter 'group' when calling ScoreApi.get_group_scores" end # resource path - local_var_path = '/groups/{group}/scores'.sub('{' + 'group' + '}', CGI.escape(group.to_s)) + local_var_path = '/groups/{group}/scores'.sub('{group}', CGI.escape(group.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -788,7 +796,7 @@ def get_group_scores_with_http_info(group, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -845,7 +853,7 @@ def get_score_with_http_info(score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score" end # resource path - local_var_path = '/scores/{score}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -854,7 +862,7 @@ def get_score_with_http_info(score, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -917,7 +925,7 @@ def get_score_collaborator_with_http_info(score, collaborator, opts = {}) fail ArgumentError, "Missing the required parameter 'collaborator' when calling ScoreApi.get_score_collaborator" end # resource path - local_var_path = '/scores/{score}/collaborators/{collaborator}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'collaborator' + '}', CGI.escape(collaborator.to_s)) + local_var_path = '/scores/{score}/collaborators/{collaborator}'.sub('{score}', CGI.escape(score.to_s)).sub('{collaborator}', CGI.escape(collaborator.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -926,7 +934,7 @@ def get_score_collaborator_with_http_info(score, collaborator, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -983,7 +991,7 @@ def get_score_collaborators_with_http_info(score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_collaborators" end # resource path - local_var_path = '/scores/{score}/collaborators'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/collaborators'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -992,7 +1000,7 @@ def get_score_collaborators_with_http_info(score, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1027,10 +1035,10 @@ def get_score_collaborators_with_http_info(score, opts = {}) # This method lists the different comments added on a music score (documents and inline) sorted by their post dates. # @param score [String] 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`). # @param [Hash] opts the optional parameters - # @option opts [String] :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. # @option opts [String] :type Filter the comments by type # @option opts [String] :sort Sort # @option opts [String] :direction Sort direction + # @option opts [String] :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. # @return [Array] def get_score_comments(score, opts = {}) data, _status_code, _headers = get_score_comments_with_http_info(score, opts) @@ -1041,10 +1049,10 @@ def get_score_comments(score, opts = {}) # This method lists the different comments added on a music score (documents and inline) sorted by their post dates. # @param score [String] 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`). # @param [Hash] opts the optional parameters - # @option opts [String] :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. # @option opts [String] :type Filter the comments by type # @option opts [String] :sort Sort # @option opts [String] :direction Sort direction + # @option opts [String] :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. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_score_comments_with_http_info(score, opts = {}) if @api_client.config.debugging @@ -1067,19 +1075,19 @@ def get_score_comments_with_http_info(score, opts = {}) fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}" end # resource path - local_var_path = '/scores/{score}/comments'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/comments'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil? + query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1142,7 +1150,7 @@ def get_score_revision_with_http_info(score, revision, opts = {}) fail ArgumentError, "Missing the required parameter 'revision' when calling ScoreApi.get_score_revision" end # resource path - local_var_path = '/scores/{score}/revisions/{revision}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'revision' + '}', CGI.escape(revision.to_s)) + local_var_path = '/scores/{score}/revisions/{revision}'.sub('{score}', CGI.escape(score.to_s)).sub('{revision}', CGI.escape(revision.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1151,7 +1159,7 @@ def get_score_revision_with_http_info(score, revision, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1183,7 +1191,7 @@ def get_score_revision_with_http_info(score, revision, opts = {}) end # 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 [String] 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`). # @param revision [String] Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. # @param format [String] The format of the file you will retrieve @@ -1199,7 +1207,7 @@ def get_score_revision_data(score, revision, format, opts = {}) end # 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 [String] 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`). # @param revision [String] Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. # @param format [String] The format of the file you will retrieve @@ -1226,12 +1234,12 @@ def get_score_revision_data_with_http_info(score, revision, format, opts = {}) fail ArgumentError, "Missing the required parameter 'format' when calling ScoreApi.get_score_revision_data" end # verify enum value - allowable_values = ["json", "mxl", "xml", "mp3", "wav", "midi", "thumbnail.png", "synchronizationPoints"] + allowable_values = ["json", "mxl", "xml", "abc", "mp3", "wav", "midi", "flat", "thumbnail.png", "synchronizationPoints"] if @api_client.config.client_side_validation && !allowable_values.include?(format) fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}" end # resource path - local_var_path = '/scores/{score}/revisions/{revision}/{format}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'revision' + '}', CGI.escape(revision.to_s)).sub('{' + 'format' + '}', CGI.escape(format.to_s)) + local_var_path = '/scores/{score}/revisions/{revision}/{format}'.sub('{score}', CGI.escape(score.to_s)).sub('{revision}', CGI.escape(revision.to_s)).sub('{format}', CGI.escape(format.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1243,7 +1251,7 @@ def get_score_revision_data_with_http_info(score, revision, format, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/vnd.recordare.musicxml+xml', 'application/vnd.recordare.musicxml', 'audio/mp3', 'audio/wav', 'audio/midi', 'image/png']) + header_params['Accept'] = @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']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1300,7 +1308,7 @@ def get_score_revisions_with_http_info(score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_revisions" end # resource path - local_var_path = '/scores/{score}/revisions'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/revisions'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1309,7 +1317,7 @@ def get_score_revisions_with_http_info(score, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1364,7 +1372,7 @@ def get_score_submissions_with_http_info(score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_submissions" end # resource path - local_var_path = '/scores/{score}/submissions'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/submissions'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1372,7 +1380,7 @@ def get_score_submissions_with_http_info(score, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1433,7 +1441,7 @@ def get_score_track_with_http_info(score, track, opts = {}) fail ArgumentError, "Missing the required parameter 'track' when calling ScoreApi.get_score_track" end # resource path - local_var_path = '/scores/{score}/tracks/{track}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'track' + '}', CGI.escape(track.to_s)) + local_var_path = '/scores/{score}/tracks/{track}'.sub('{score}', CGI.escape(score.to_s)).sub('{track}', CGI.escape(track.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1442,7 +1450,7 @@ def get_score_track_with_http_info(score, track, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1511,7 +1519,7 @@ def get_user_likes_with_http_info(user, opts = {}) end # resource path - local_var_path = '/users/{user}/likes'.sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/users/{user}/likes'.sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1523,7 +1531,7 @@ def get_user_likes_with_http_info(user, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1555,10 +1563,15 @@ def get_user_likes_with_http_info(user, opts = {}) end # 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 [String] Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. # @param [Hash] opts the optional parameters - # @option opts [String] :parent Filter the score forked from the score id `parent` + # @option opts [Boolean] :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. (default to false) + # @option opts [String] :sort Sort + # @option opts [String] :direction Sort direction + # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) + # @option opts [String] :_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. + # @option opts [String] :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. # @return [Array] def get_user_scores(user, opts = {}) data, _status_code, _headers = get_user_scores_with_http_info(user, opts) @@ -1566,10 +1579,15 @@ def get_user_scores(user, opts = {}) end # 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 [String] Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. # @param [Hash] opts the optional parameters - # @option opts [String] :parent Filter the score forked from the score id `parent` + # @option opts [Boolean] :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. (default to false) + # @option opts [String] :sort Sort + # @option opts [String] :direction Sort direction + # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) + # @option opts [String] :_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. + # @option opts [String] :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. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_user_scores_with_http_info(user, opts = {}) if @api_client.config.debugging @@ -1579,17 +1597,38 @@ def get_user_scores_with_http_info(user, opts = {}) if @api_client.config.client_side_validation && user.nil? fail ArgumentError, "Missing the required parameter 'user' when calling ScoreApi.get_user_scores" end + allowable_values = ["creationDate", "modificationDate", "title"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction']) + fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ScoreApi.get_user_scores, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ScoreApi.get_user_scores, must be greater than or equal to 1.' + end + # resource path - local_var_path = '/users/{user}/scores'.sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/users/{user}/scores'.sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'parent'] = opts[:'parent'] if !opts[:'parent'].nil? + query_params[:'paginate'] = opts[:'paginate'] if !opts[:'paginate'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? + query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1621,6 +1660,7 @@ def get_user_scores_with_http_info(user, opts = {}) end # 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 [String] 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`). # @param [Hash] opts the optional parameters # @option opts [String] :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. @@ -1633,6 +1673,7 @@ def list_score_tracks(score, opts = {}) end # 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 [String] 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`). # @param [Hash] opts the optional parameters # @option opts [String] :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. @@ -1648,7 +1689,7 @@ def list_score_tracks_with_http_info(score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.list_score_tracks" end # resource path - local_var_path = '/scores/{score}/tracks'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/tracks'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1659,7 +1700,7 @@ def list_score_tracks_with_http_info(score, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1720,7 +1761,7 @@ def mark_score_comment_resolved_with_http_info(score, comment, opts = {}) fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.mark_score_comment_resolved" end # resource path - local_var_path = '/scores/{score}/comments/{comment}/resolved'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'comment' + '}', CGI.escape(comment.to_s)) + local_var_path = '/scores/{score}/comments/{comment}/resolved'.sub('{score}', CGI.escape(score.to_s)).sub('{comment}', CGI.escape(comment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1729,7 +1770,7 @@ def mark_score_comment_resolved_with_http_info(score, comment, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1790,7 +1831,7 @@ def mark_score_comment_unresolved_with_http_info(score, comment, opts = {}) fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.mark_score_comment_unresolved" end # resource path - local_var_path = '/scores/{score}/comments/{comment}/resolved'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'comment' + '}', CGI.escape(comment.to_s)) + local_var_path = '/scores/{score}/comments/{comment}/resolved'.sub('{score}', CGI.escape(score.to_s)).sub('{comment}', CGI.escape(comment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1799,7 +1840,7 @@ def mark_score_comment_unresolved_with_http_info(score, comment, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -1862,7 +1903,7 @@ def post_score_comment_with_http_info(score, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.post_score_comment" end # resource path - local_var_path = '/scores/{score}/comments'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/comments'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -1871,7 +1912,7 @@ def post_score_comment_with_http_info(score, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -1912,6 +1953,7 @@ def post_score_comment_with_http_info(score, body, opts = {}) # @param score [String] 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`). # @param collaborator [String] Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** # @param [Hash] opts the optional parameters + # @option opts [String] :event_properties Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` # @return [nil] def remove_score_collaborator(score, collaborator, opts = {}) remove_score_collaborator_with_http_info(score, collaborator, opts) @@ -1923,6 +1965,7 @@ def remove_score_collaborator(score, collaborator, opts = {}) # @param score [String] 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`). # @param collaborator [String] Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** # @param [Hash] opts the optional parameters + # @option opts [String] :event_properties Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def remove_score_collaborator_with_http_info(score, collaborator, opts = {}) if @api_client.config.debugging @@ -1937,15 +1980,21 @@ def remove_score_collaborator_with_http_info(score, collaborator, opts = {}) fail ArgumentError, "Missing the required parameter 'collaborator' when calling ScoreApi.remove_score_collaborator" end # resource path - local_var_path = '/scores/{score}/collaborators/{collaborator}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'collaborator' + '}', CGI.escape(collaborator.to_s)) + local_var_path = '/scores/{score}/collaborators/{collaborator}'.sub('{score}', CGI.escape(score.to_s)).sub('{collaborator}', CGI.escape(collaborator.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'eventProperties'] = opts[:'event_properties'] if !opts[:'event_properties'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -2000,7 +2049,7 @@ def untrash_score_with_http_info(score, opts = {}) fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.untrash_score" end # resource path - local_var_path = '/scores/{score}/untrash'.sub('{' + 'score' + '}', CGI.escape(score.to_s)) + local_var_path = '/scores/{score}/untrash'.sub('{score}', CGI.escape(score.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -2008,7 +2057,7 @@ def untrash_score_with_http_info(score, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -2075,7 +2124,7 @@ def update_score_comment_with_http_info(score, comment, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.update_score_comment" end # resource path - local_var_path = '/scores/{score}/comments/{comment}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'comment' + '}', CGI.escape(comment.to_s)) + local_var_path = '/scores/{score}/comments/{comment}'.sub('{score}', CGI.escape(score.to_s)).sub('{comment}', CGI.escape(comment.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -2084,7 +2133,7 @@ def update_score_comment_with_http_info(score, comment, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? @@ -2154,7 +2203,7 @@ def update_score_track_with_http_info(score, track, body, opts = {}) fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.update_score_track" end # resource path - local_var_path = '/scores/{score}/tracks/{track}'.sub('{' + 'score' + '}', CGI.escape(score.to_s)).sub('{' + 'track' + '}', CGI.escape(track.to_s)) + local_var_path = '/scores/{score}/tracks/{track}'.sub('{score}', CGI.escape(score.to_s)).sub('{track}', CGI.escape(track.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -2162,7 +2211,7 @@ def update_score_track_with_http_info(score, track, body, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? diff --git a/lib/flat_api/api/task_api.rb b/lib/flat_api/api/task_api.rb index 243799d..04884c0 100644 --- a/lib/flat_api/api/task_api.rb +++ b/lib/flat_api/api/task_api.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -43,7 +43,7 @@ def get_task_with_http_info(task, opts = {}) fail ArgumentError, "Missing the required parameter 'task' when calling TaskApi.get_task" end # resource path - local_var_path = '/tasks/{task}'.sub('{' + 'task' + '}', CGI.escape(task.to_s)) + local_var_path = '/tasks/{task}'.sub('{task}', CGI.escape(task.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -51,7 +51,7 @@ def get_task_with_http_info(task, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/lib/flat_api/api/user_api.rb b/lib/flat_api/api/user_api.rb index 6c59bf1..b5f8597 100644 --- a/lib/flat_api/api/user_api.rb +++ b/lib/flat_api/api/user_api.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -43,7 +43,7 @@ def get_user_with_http_info(user, opts = {}) fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.get_user" end # resource path - local_var_path = '/users/{user}'.sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/users/{user}'.sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -51,7 +51,7 @@ def get_user_with_http_info(user, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -120,7 +120,7 @@ def get_user_likes_with_http_info(user, opts = {}) end # resource path - local_var_path = '/users/{user}/likes'.sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/users/{user}/likes'.sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -132,7 +132,7 @@ def get_user_likes_with_http_info(user, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} @@ -164,10 +164,15 @@ def get_user_likes_with_http_info(user, opts = {}) end # 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 [String] Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. # @param [Hash] opts the optional parameters - # @option opts [String] :parent Filter the score forked from the score id `parent` + # @option opts [Boolean] :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. (default to false) + # @option opts [String] :sort Sort + # @option opts [String] :direction Sort direction + # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) + # @option opts [String] :_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. + # @option opts [String] :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. # @return [Array] def get_user_scores(user, opts = {}) data, _status_code, _headers = get_user_scores_with_http_info(user, opts) @@ -175,10 +180,15 @@ def get_user_scores(user, opts = {}) end # 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 [String] Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. # @param [Hash] opts the optional parameters - # @option opts [String] :parent Filter the score forked from the score id `parent` + # @option opts [Boolean] :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. (default to false) + # @option opts [String] :sort Sort + # @option opts [String] :direction Sort direction + # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25) + # @option opts [String] :_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. + # @option opts [String] :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. # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_user_scores_with_http_info(user, opts = {}) if @api_client.config.debugging @@ -188,17 +198,38 @@ def get_user_scores_with_http_info(user, opts = {}) if @api_client.config.client_side_validation && user.nil? fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.get_user_scores" end + allowable_values = ["creationDate", "modificationDate", "title"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction']) + fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UserApi.get_user_scores, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UserApi.get_user_scores, must be greater than or equal to 1.' + end + # resource path - local_var_path = '/users/{user}/scores'.sub('{' + 'user' + '}', CGI.escape(user.to_s)) + local_var_path = '/users/{user}/scores'.sub('{user}', CGI.escape(user.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'parent'] = opts[:'parent'] if !opts[:'parent'].nil? + query_params[:'paginate'] = opts[:'paginate'] if !opts[:'paginate'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil? + query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} diff --git a/lib/flat_api/api_client.rb b/lib/flat_api/api_client.rb index dd70f9a..ce5fd41 100644 --- a/lib/flat_api/api_client.rb +++ b/lib/flat_api/api_client.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,9 @@ require 'logger' require 'tempfile' require 'time' -require 'typhoeus' +require 'faraday' +require 'faraday/multipart' if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0') +require 'marcel' module FlatApi @@ -32,7 +34,7 @@ class ApiClient # @option config [Configuration] Configuration for initializing the object, default to Configuration.default def initialize(config = Configuration.default) @config = config - @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" + @user_agent = "Flat-SDK-Ruby/#{FlatApi::VERSION} (ruby/#{RUBY_VERSION})" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent @@ -46,39 +48,71 @@ def self.default # Call an API with given options. # # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (may be a Tempfile or nil), response status code and response headers. + # the data deserialized from response body (could be nil), response status code and response headers. + # BEGIN retry wrapper (tools/patches/20_errors.py) + # Every request goes through the retry policy, which is why it wraps call_api_once rather + # than living in each of the generated methods. The decision needs the typed error and not the + # status code: Flat returns 403 both for rate limiting and for a genuine authorization failure, + # and only the response body's +code+ separates them. See RetryPolicy. def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - tempfile = download_file(request) if opts[:return_type] == 'File' - response = request.run + policy = @config.retry_policy || RetryPolicy.disabled + attempt = 0 - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + begin + attempt += 1 + call_api_once(http_method, path, opts) + rescue StandardError => e + raise unless policy.should_retry?(e, http_method, attempt) + + sleep(policy.delay_for(e, attempt)) + retry end + end + # END retry wrapper (tools/patches/20_errors.py) - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message + def call_api_once(http_method, path, opts = {}) + stream = nil + begin + response = connection(opts).public_send(http_method.to_sym.downcase) do |req| + request = build_request(http_method, path, req, opts) + stream = download_file(request) if opts[:return_type] == 'File' || opts[:return_type] == 'Binary' + end + + if config.debugging + config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.status == 0 && response.respond_to?(:return_message) + # Errors from libcurl will be made visible here + fail ApiError.new(code: 0, + message: response.return_message) + else + fail FlatApi.error_from_response( + response.status, + (begin + JSON.parse(response.body) + rescue StandardError + response.body + end), + response.headers || {} + ) + end end + rescue Faraday::TimeoutError + fail ApiError.new('Connection timed out') + rescue Faraday::ConnectionFailed + fail ApiError.new('Connection failed') end - if opts[:return_type] == 'File' - data = tempfile + if opts[:return_type] == 'File' || opts[:return_type] == 'Binary' + data = deserialize_file(response, stream) elsif opts[:return_type] data = deserialize(response, opts[:return_type]) else data = nil end - return data, response.code, response.headers + return data, response.status, response.headers end # Builds the HTTP request @@ -89,47 +123,33 @@ def call_api(http_method, path, opts = {}) # @option opts [Hash] :query_params Query parameters # @option opts [Hash] :form_params Query parameters # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) + # @return [Faraday::Request] A Faraday Request + def build_request(http_method, path, request, opts = {}) url = build_request_url(path, opts) http_method = http_method.to_sym.downcase header_params = @default_headers.merge(opts[:header_params] || {}) query_params = opts[:query_params] || {} form_params = opts[:form_params] || {} - follow_location = opts[:follow_location] || true update_params_for_auth! header_params, query_params, opts[:auth_names] - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging, - :followlocation => follow_location - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + if config.debugging + config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" end end + request.headers = header_params + request.body = req_body + + # Overload default options only if provided + request.options.params_encoder = config.params_encoder if config.params_encoder + request.options.timeout = config.timeout if config.timeout - Typhoeus::Request.new(url, req_opts) + request.url url + request.params = query_params + request end # Builds the HTTP request body @@ -140,13 +160,16 @@ def build_request(http_method, path, opts = {}) # @return [String] HTTP body data in the form of string def build_request_body(header_params, form_params, body) # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' data = {} form_params.each do |key, value| case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters + when ::File, ::Tempfile + data[key] = Faraday::FilePart.new(value.path, Marcel::MimeType.for(Pathname.new(value.path))) + when ::Array, nil + # let Faraday handle Array and nil parameters data[key] = value else data[key] = value.to_s @@ -160,49 +183,95 @@ def build_request_body(header_params, form_params, body) data end - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - # - # @return [Tempfile] the tempfile generated def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) + stream = [] + + # handle streaming Responses + request.options.on_data = Proc.new do |chunk, overall_received_bytes| + stream << chunk end - # run the request to ensure the tempfile is created successfully before returning it - request.run - if tempfile - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" + + stream + end + + def deserialize_file(response, stream) + body = response.body + encoding = body.encoding + + # reconstruct content + content = stream.join + content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary' + content = content.force_encoding(encoding) + + # return byte stream + return content if @config.return_binary_data == true + + # return file instead of binary data + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) else - fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}") + prefix = 'download-' end + prefix = prefix + '-' unless prefix.end_with?('-') + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + tempfile.write(content) + tempfile.close + + config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" tempfile end + def connection(opts) + opts[:header_params]['Content-Type'] == 'multipart/form-data' ? connection_multipart : connection_regular + end + + def connection_multipart + @connection_multipart ||= build_connection do |conn| + conn.request :multipart + conn.request :url_encoded + end + end + + def connection_regular + @connection_regular ||= build_connection + end + + def build_connection + Faraday.new(url: config.base_url, ssl: ssl_options, proxy: config.proxy) do |conn| + basic_auth(conn) + config.configure_middleware(conn) + yield(conn) if block_given? + conn.adapter(Faraday.default_adapter) + config.configure_connection(conn) + end + end + + def ssl_options + { + ca_file: config.ssl_ca_file, + verify: config.ssl_verify, + verify_mode: config.ssl_verify_mode, + client_cert: config.ssl_client_cert, + client_key: config.ssl_client_key + } + end + + def basic_auth(conn) + if config.username && config.password + if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0') + conn.request(:authorization, :basic, config.username, config.password) + else + conn.request(:basic_auth, config.username, config.password) + end + end + end + # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -212,7 +281,7 @@ def download_file(request) # @param [String] mime MIME # @return [Boolean] True if the MIME is application/json def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil? end # Deserialize the response to the given return type. @@ -279,9 +348,13 @@ def convert_to_type(data, return_type) data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } end else - # models (e.g. Pet) or oneOf + # models (e.g. Pet) or oneOf/anyOf klass = FlatApi.const_get(return_type) - klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) + klass.build(data) + else + klass.build_from_hash(data) + end end end @@ -291,7 +364,7 @@ def convert_to_type(data, return_type) # @param [String] filename the filename to be sanitized # @return [String] the sanitized filename def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') + filename.split(/[\/\\]/).last end def build_request_url(path, opts = {}) diff --git a/lib/flat_api/api_error.rb b/lib/flat_api/api_error.rb index 664068d..c153513 100644 --- a/lib/flat_api/api_error.rb +++ b/lib/flat_api/api_error.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/api_model_base.rb b/lib/flat_api/api_model_base.rb new file mode 100644 index 0000000..505bed1 --- /dev/null +++ b/lib/flat_api/api_model_base.rb @@ -0,0 +1,88 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +module FlatApi + class ApiModelBase + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = FlatApi.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/flat_api/client.rb b/lib/flat_api/client.rb new file mode 100644 index 0000000..54d7e5b --- /dev/null +++ b/lib/flat_api/client.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module FlatApi + # One object to start from. + # + # client = FlatApi::FlatClient.new(access_token: 'YOUR_TOKEN') + # client.account.get_authenticated_user + # client.paginate(:list_collections, parent: 'user').each { |c| puts c.title } + # + # It owns one ApiClient, so every API reached through it shares a connection and a + # configuration. Constructing the generated classes directly still works and is equivalent. + class FlatClient + # Short name to generated class. The order matters: paginate resolves an operation by asking + # each API in turn, and two of them define get_user_scores, so scores wins over users. + APIS = { + account: 'AccountApi', + classes: 'ClassApi', + collections: 'CollectionApi', + edu_resources: 'EduResourcesApi', + groups: 'GroupApi', + omr: 'OMRApi', + organization: 'OrganizationApi', + scores: 'ScoreApi', + tasks: 'TaskApi', + users: 'UserApi' + }.freeze + + attr_reader :api_client, :config + + # +config+ defaults to a fresh Configuration rather than Configuration.default: a client built + # with its own token must not overwrite the token every other client is using. + def initialize(access_token: nil, config: nil, retry_policy: nil) + @config = config || Configuration.new + @config.access_token = access_token unless access_token.nil? + @config.retry_policy = retry_policy unless retry_policy.nil? + @api_client = ApiClient.new(@config) + @apis = {} + end + + APIS.each_key { |name| define_method(name) { api(name) } } + + # One generated API by short name, memoised. + def api(name) + klass = APIS[name.to_sym] + raise ArgumentError, "unknown API #{name}, expected one of: #{APIS.keys.join(', ')}" if klass.nil? + + @apis[name.to_sym] ||= FlatApi.const_get(klass).new(@api_client) + end + + # Every item across every page of a cursor-paginated operation, as a lazy Enumerator. + # Positional arguments are the operation's path parameters; keywords are its query parameters. + # + # client.paginate(:list_collections, parent: 'user').each { |c| puts c.title } + # client.paginate(:get_user_scores, 'me') { |score| puts score.title } + # + # An operation that does not paginate yields its single page, so this is always safe to use. + def paginate(operation, *args, **params, &block) + method = "#{operation}_with_http_info" + owner = APIS.keys.find { |name| api(name).respond_to?(method) } + raise ArgumentError, "no operation #{operation} on any Flat API" if owner.nil? + + target = api(owner) + enum = Pagination.paginate(**params) do |page_params| + target.public_send(method, *args, page_params) + end + block ? enum.each(&block) : enum + end + end +end diff --git a/lib/flat_api/configuration.rb b/lib/flat_api/configuration.rb index 22531d8..54a8222 100644 --- a/lib/flat_api/configuration.rb +++ b/lib/flat_api/configuration.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -79,6 +79,14 @@ class Configuration # @return [true, false] attr_accessor :debugging + # Set this to ignore operation servers for the API client. This is useful when you need to + # send requests to a different server than the one specified in the OpenAPI document. + # Will default to the base url defined in the spec but can be overridden by setting + # `scheme`, `host`, `base_path` directly. + # Default to false. + # @return [true, false] + attr_accessor :ignore_operation_servers + # Defines the logger used for debugging. # Default to `Rails.logger` (when in Rails) or logging to STDOUT. # @@ -96,6 +104,10 @@ class Configuration # Default to 0 (never times out). attr_accessor :timeout + # The retry policy applied to every request. Set RetryPolicy.disabled to turn retries off; + # errors still arrive typed and a rate-limit error still carries its reset. + attr_accessor :retry_policy + # Set this to false to skip client side validation in the operation. # Default to true. # @return [true, false] @@ -108,40 +120,39 @@ class Configuration # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. # # @return [true, false] - attr_accessor :verify_ssl + attr_accessor :ssl_verify ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. + # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) # # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. # - # @return [true, false] - attr_accessor :verify_ssl_host + attr_accessor :ssl_verify_mode ### TLS/SSL setting # Set this to customize the certificate file to verify the peer. # # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert + attr_accessor :ssl_ca_file ### TLS/SSL setting # Client certificate file (for client certificate) - attr_accessor :cert_file + attr_accessor :ssl_client_cert ### TLS/SSL setting # Client private key file (for client certificate) - attr_accessor :key_file + attr_accessor :ssl_client_key - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. + ### Proxy setting + # HTTP Proxy settings + attr_accessor :proxy + + # Set this to customize parameters encoder of array parameter. + # Default to nil. Faraday uses NestedParamsEncoder when nil. # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding + # @see The params_encoder option of Faraday. Related source code: + # https://github.com/lostisland/faraday/tree/main/lib/faraday/encoders + attr_accessor :params_encoder attr_accessor :inject_format @@ -159,13 +170,20 @@ def initialize @api_key = {} @api_key_prefix = {} @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @cert_file = nil - @key_file = nil - @timeout = 0 - @params_encoding = nil + @ssl_verify = true + @ssl_verify_mode = nil + @ssl_ca_file = nil + @ssl_client_cert = nil + @ssl_client_key = nil + @middlewares = Hash.new { |h, k| h[k] = [] } + @configure_connection_blocks = [] + @timeout = 60 + @retry_policy = RetryPolicy.new + # return data as binary instead of file + @return_binary_data = false + @params_encoder = nil @debugging = false + @ignore_operation_servers = false @inject_format = false @force_ending_format = false @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @@ -200,6 +218,7 @@ def base_path=(base_path) # Returns base URL for specified operation based on server settings def base_url(operation = nil) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers if operation_server_settings.key?(operation) then index = server_operation_index.fetch(operation, server_index) server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) @@ -293,6 +312,86 @@ def server_url(index, variables = {}, servers = nil) url end + # Configure Faraday connection directly. + # + # ``` + # c.configure_faraday_connection do |conn| + # conn.use Faraday::HttpCache, shared_cache: false, logger: logger + # conn.response :logger, nil, headers: true, bodies: true, log_level: :debug do |logger| + # logger.filter(/(Authorization: )(.*)/, '\1[REDACTED]') + # end + # end + # + # c.configure_faraday_connection do |conn| + # conn.adapter :typhoeus + # end + # ``` + # + # @param block [Proc] `#call`able object that takes one arg, the connection + def configure_faraday_connection(&block) + @configure_connection_blocks << block + end + + def configure_connection(conn) + @configure_connection_blocks.each do |block| + block.call(conn) + end + end + + # Adds middleware to the stack + def use(*middleware) + set_faraday_middleware(:use, *middleware) + end + + # Adds request middleware to the stack + def request(*middleware) + set_faraday_middleware(:request, *middleware) + end + + # Adds response middleware to the stack + def response(*middleware) + set_faraday_middleware(:response, *middleware) + end + + # Adds Faraday middleware setting information to the stack + # + # @example Use the `set_faraday_middleware` method to set middleware information + # config.set_faraday_middleware(:request, :retry, max: 3, methods: [:get, :post], retry_statuses: [503]) + # config.set_faraday_middleware(:response, :logger, nil, { bodies: true, log_level: :debug }) + # config.set_faraday_middleware(:use, Faraday::HttpCache, store: Rails.cache, shared_cache: false) + # config.set_faraday_middleware(:insert, 0, FaradayMiddleware::FollowRedirects, { standards_compliant: true, limit: 1 }) + # config.set_faraday_middleware(:swap, 0, Faraday::Response::Logger) + # config.set_faraday_middleware(:delete, Faraday::Multipart::Middleware) + # + # @see https://github.com/lostisland/faraday/blob/v2.3.0/lib/faraday/rack_builder.rb#L92-L143 + def set_faraday_middleware(operation, key, *args, &block) + unless [:request, :response, :use, :insert, :insert_before, :insert_after, :swap, :delete].include?(operation) + fail ArgumentError, "Invalid faraday middleware operation #{operation}. Must be" \ + " :request, :response, :use, :insert, :insert_before, :insert_after, :swap or :delete." + end + + @middlewares[operation] << [key, args, block] + end + ruby2_keywords(:set_faraday_middleware) if respond_to?(:ruby2_keywords, true) + + # Set up middleware on the connection + def configure_middleware(connection) + return if @middlewares.empty? + + [:request, :response, :use, :insert, :insert_before, :insert_after, :swap].each do |operation| + next unless @middlewares.key?(operation) + + @middlewares[operation].each do |key, args, block| + connection.builder.send(operation, key, *args, &block) + end + end + + if @middlewares.key?(:delete) + @middlewares[:delete].each do |key, _args, _block| + connection.builder.delete(key) + end + end + end end end diff --git a/lib/flat_api/errors.rb b/lib/flat_api/errors.rb new file mode 100644 index 0000000..f75db40 --- /dev/null +++ b/lib/flat_api/errors.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Typed errors for the Flat API. +# +# Rescue the error class, not the status code: rate limiting and authorization failures both return +# HTTP 403 and are separated only by the response body's +code+. +module FlatApi + RATE_LIMIT_CODE = 'API_RATE_LIMIT_EXCEEDED' + QUOTA_CODES = %w[QUOTA_EXCEEDED CREDITS_EXHAUSTED OMR_CREDITS_EXHAUSTED].freeze + + class FlatError < StandardError + attr_reader :status, :code, :request_id, :headers, :body + + def initialize(message, status: nil, code: nil, request_id: nil, headers: nil, body: nil) + super(message) + @status = status + @code = code + # Present only for internal and backend errors, so treat it as optional. + @request_id = request_id + @headers = headers || {} + @body = body + end + + def to_s + parts = [super] + parts << "code=#{code}" if code + parts << "status=#{status}" if status + parts << "id=#{request_id}" if request_id + parts.join(' ') + end + end + + # The token is missing, invalid or expired, or a refresh failed. Re-authorize. + class FlatAuthenticationError < FlatError; end + # Authenticated but not permitted: a missing scope or insufficient permission. + class FlatAuthorizationError < FlatError; end + # The request body or parameters failed validation. + class FlatValidationError < FlatError; end + # The resource does not exist, or is not visible to this token. + class FlatNotFoundError < FlatError; end + # A metered resource, such as OMR credits, is exhausted. + class FlatQuotaError < FlatError; end + # An internal or backend error. +request_id+ is normally set here. + class FlatServerError < FlatError; end + + # The account or IP exceeded its request quota. Returned as HTTP 403, not 429. + class FlatRateLimitError < FlatError + attr_reader :limit, :remaining, :reset + + def initialize(message, **kwargs) + super + @limit = int_header('X-RateLimit-Limit') + @remaining = int_header('X-RateLimit-Remaining') + # UTC epoch seconds at which the window resets. Flat sends no Retry-After header. + @reset = int_header('X-RateLimit-Reset') + end + + private + + def int_header(name) + pair = headers.find { |k, _| k.to_s.downcase == name.downcase } + pair && Integer(pair[1], exception: false) + end + end + + # Build the right error for a non-2xx response. + def self.error_from_response(status, body, headers = {}) + payload = body.is_a?(Hash) ? body : {} + code = payload['code'] || payload[:code] + message = payload['message'] || payload[:message] || "HTTP #{status}" + opts = { + status: status, code: code, request_id: payload['id'] || payload[:id], + headers: headers, body: body + } + + return FlatRateLimitError.new(message, **opts) if status == 403 && code == RATE_LIMIT_CODE + return FlatQuotaError.new(message, **opts) if QUOTA_CODES.include?(code) + return FlatAuthenticationError.new(message, **opts) if status == 401 + return FlatAuthorizationError.new(message, **opts) if status == 403 + return FlatNotFoundError.new(message, **opts) if status == 404 + return FlatValidationError.new(message, **opts) if [400, 422].include?(status) + return FlatServerError.new(message, **opts) if status >= 500 + + FlatError.new(message, **opts) + end +end diff --git a/lib/flat_api/models/add_group_user200_response.rb b/lib/flat_api/models/add_group_user200_response.rb new file mode 100644 index 0000000..a8f2972 --- /dev/null +++ b/lib/flat_api/models/add_group_user200_response.rb @@ -0,0 +1,148 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class AddGroupUser200Response < ApiModelBase + # User ID that was added + attr_accessor :user + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user' => :'user' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::AddGroupUser200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AddGroupUser200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user == o.user + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/add_group_user_request.rb b/lib/flat_api/models/add_group_user_request.rb new file mode 100644 index 0000000..e929e21 --- /dev/null +++ b/lib/flat_api/models/add_group_user_request.rb @@ -0,0 +1,165 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class AddGroupUserRequest < ApiModelBase + # ID of the student to add + attr_accessor :user + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user' => :'user' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'user' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::AddGroupUserRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AddGroupUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user') + self.user = attributes[:'user'] + else + self.user = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @user.nil? + invalid_properties.push('invalid value for "user", user cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @user.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] user Value to be assigned + def user=(user) + if user.nil? + fail ArgumentError, 'user cannot be nil' + end + + @user = user + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user == o.user + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/api_access_token.rb b/lib/flat_api/models/api_access_token.rb index 0067348..11c0a6f 100644 --- a/lib/flat_api/models/api_access_token.rb +++ b/lib/flat_api/models/api_access_token.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # An API access token - class ApiAccessToken + class ApiAccessToken < ApiModelBase # Unique identifier of this private token attr_accessor :id @@ -46,9 +46,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -77,9 +82,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ApiAccessToken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ApiAccessToken`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -174,61 +180,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -245,24 +196,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/app_scopes.rb b/lib/flat_api/models/app_scopes.rb index c18b6ba..ee2973d 100644 --- a/lib/flat_api/models/app_scopes.rb +++ b/lib/flat_api/models/app_scopes.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -24,6 +24,7 @@ class AppScopes COLLECTIONS_READONLY = "collections.readonly".freeze COLLECTIONS_ADD_SCORES = "collections.add_scores".freeze COLLECTIONS = "collections".freeze + NOTIFICATIONS_READONLY = "notifications.readonly".freeze EDU_RESOURCES = "edu.resources".freeze EDU_RESOURCES_READONLY = "edu.resources.readonly".freeze EDU_CLASSES = "edu.classes".freeze @@ -36,9 +37,10 @@ class AppScopes EDU_ADMIN_USERS = "edu.admin.users".freeze EDU_ADMIN_USERS_READONLY = "edu.admin.users.readonly".freeze TASKS_READONLY = "tasks.readonly".freeze + OMR = "omr".freeze def self.all_vars - @all_vars ||= [ACCOUNT_PUBLIC_PROFILE, ACCOUNT_EMAIL, ACCOUNT_EDUCATION_PROFILE, SCORES_READONLY, SCORES_SOCIAL, SCORES, COLLECTIONS_READONLY, COLLECTIONS_ADD_SCORES, COLLECTIONS, EDU_RESOURCES, EDU_RESOURCES_READONLY, EDU_CLASSES, EDU_CLASSES_READONLY, EDU_ASSIGNMENTS, EDU_ASSIGNMENTS_READONLY, EDU_ADMIN, EDU_ADMIN_LTI, EDU_ADMIN_LTI_READONLY, EDU_ADMIN_USERS, EDU_ADMIN_USERS_READONLY, TASKS_READONLY].freeze + @all_vars ||= [ACCOUNT_PUBLIC_PROFILE, ACCOUNT_EMAIL, ACCOUNT_EDUCATION_PROFILE, SCORES_READONLY, SCORES_SOCIAL, SCORES, COLLECTIONS_READONLY, COLLECTIONS_ADD_SCORES, COLLECTIONS, NOTIFICATIONS_READONLY, EDU_RESOURCES, EDU_RESOURCES_READONLY, EDU_CLASSES, EDU_CLASSES_READONLY, EDU_ASSIGNMENTS, EDU_ASSIGNMENTS_READONLY, EDU_ADMIN, EDU_ADMIN_LTI, EDU_ADMIN_LTI_READONLY, EDU_ADMIN_USERS, EDU_ADMIN_USERS_READONLY, TASKS_READONLY, OMR].freeze end # Builds the enum from string diff --git a/lib/flat_api/models/assignment.rb b/lib/flat_api/models/assignment.rb index ca8a742..ea610f2 100644 --- a/lib/flat_api/models/assignment.rb +++ b/lib/flat_api/models/assignment.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Assignment details - class Assignment + class Assignment < ApiModelBase # Unique identifier of the assignment attr_accessor :id @@ -26,15 +26,25 @@ class Assignment # Title of the assignment attr_accessor :title - # Description and content of the assignment + # Student instructions and content of the assignment (plain text) attr_accessor :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. + attr_accessor :description_html + + # 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. + attr_accessor :teacher_instructions + + # 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. + attr_accessor :teacher_instructions_html + # The URL of the cover to display attr_accessor :cover # The id of the cover to display attr_accessor :cover_file + # 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. attr_accessor :attachments # 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. @@ -55,6 +65,29 @@ class Assignment # The number of playback authorized on the scores of the assignment. attr_accessor :nb_playback_authorized + # Restrict the ability to get an audio feedback every time a student adds or selects a note. + attr_accessor :restrict_play_note + + # Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. + attr_accessor :restrict_to_audio_tracks + + attr_accessor :submission_students_mode + + # 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'. + attr_accessor :recording_type + + # For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. + attr_accessor :allow_metronome + + # For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. + attr_accessor :allow_backing_track + + # 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'. + attr_accessor :allow_speed_change + + # 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'. + attr_accessor :free_record + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -85,6 +118,9 @@ def self.attribute_map :'capabilities' => :'capabilities', :'title' => :'title', :'description' => :'description', + :'description_html' => :'descriptionHtml', + :'teacher_instructions' => :'teacherInstructions', + :'teacher_instructions_html' => :'teacherInstructionsHtml', :'cover' => :'cover', :'cover_file' => :'coverFile', :'attachments' => :'attachments', @@ -93,13 +129,26 @@ def self.attribute_map :'release_grades' => :'releaseGrades', :'shuffle_exercises' => :'shuffleExercises', :'toolset' => :'toolset', - :'nb_playback_authorized' => :'nbPlaybackAuthorized' + :'nb_playback_authorized' => :'nbPlaybackAuthorized', + :'restrict_play_note' => :'restrictPlayNote', + :'restrict_to_audio_tracks' => :'restrictToAudioTracks', + :'submission_students_mode' => :'submissionStudentsMode', + :'recording_type' => :'recordingType', + :'allow_metronome' => :'allowMetronome', + :'allow_backing_track' => :'allowBackingTrack', + :'allow_speed_change' => :'allowSpeedChange', + :'free_record' => :'freeRecord' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -110,6 +159,9 @@ def self.openapi_types :'capabilities' => :'AssignmentCapabilities', :'title' => :'String', :'description' => :'String', + :'description_html' => :'String', + :'teacher_instructions' => :'String', + :'teacher_instructions_html' => :'String', :'cover' => :'String', :'cover_file' => :'String', :'attachments' => :'Array', @@ -118,7 +170,15 @@ def self.openapi_types :'release_grades' => :'String', :'shuffle_exercises' => :'Boolean', :'toolset' => :'String', - :'nb_playback_authorized' => :'Float' + :'nb_playback_authorized' => :'Float', + :'restrict_play_note' => :'Boolean', + :'restrict_to_audio_tracks' => :'Boolean', + :'submission_students_mode' => :'AssignmentSubmissionStudentsMode', + :'recording_type' => :'String', + :'allow_metronome' => :'Boolean', + :'allow_backing_track' => :'Boolean', + :'allow_speed_change' => :'Boolean', + :'free_record' => :'Boolean' } end @@ -136,9 +196,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::Assignment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::Assignment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -171,6 +232,18 @@ def initialize(attributes = {}) self.description = attributes[:'description'] end + if attributes.key?(:'description_html') + self.description_html = attributes[:'description_html'] + end + + if attributes.key?(:'teacher_instructions') + self.teacher_instructions = attributes[:'teacher_instructions'] + end + + if attributes.key?(:'teacher_instructions_html') + self.teacher_instructions_html = attributes[:'teacher_instructions_html'] + end + if attributes.key?(:'cover') self.cover = attributes[:'cover'] end @@ -210,6 +283,38 @@ def initialize(attributes = {}) if attributes.key?(:'nb_playback_authorized') self.nb_playback_authorized = attributes[:'nb_playback_authorized'] end + + if attributes.key?(:'restrict_play_note') + self.restrict_play_note = attributes[:'restrict_play_note'] + end + + if attributes.key?(:'restrict_to_audio_tracks') + self.restrict_to_audio_tracks = attributes[:'restrict_to_audio_tracks'] + end + + if attributes.key?(:'submission_students_mode') + self.submission_students_mode = attributes[:'submission_students_mode'] + end + + if attributes.key?(:'recording_type') + self.recording_type = attributes[:'recording_type'] + end + + if attributes.key?(:'allow_metronome') + self.allow_metronome = attributes[:'allow_metronome'] + end + + if attributes.key?(:'allow_backing_track') + self.allow_backing_track = attributes[:'allow_backing_track'] + end + + if attributes.key?(:'allow_speed_change') + self.allow_speed_change = attributes[:'allow_speed_change'] + end + + if attributes.key?(:'free_record') + self.free_record = attributes[:'free_record'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -251,9 +356,61 @@ def valid? return false if @attachments.nil? release_grades_validator = EnumAttributeValidator.new('String', ["auto", "manual"]) return false unless release_grades_validator.valid?(@release_grades) + recording_type_validator = EnumAttributeValidator.new('String', ["audio", "video"]) + return false unless recording_type_validator.valid?(@recording_type) true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] capabilities Value to be assigned + def capabilities=(capabilities) + if capabilities.nil? + fail ArgumentError, 'capabilities cannot be nil' + end + + @capabilities = capabilities + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.nil? + fail ArgumentError, 'title cannot be nil' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] attachments Value to be assigned + def attachments=(attachments) + if attachments.nil? + fail ArgumentError, 'attachments cannot be nil' + end + + @attachments = attachments + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] release_grades Object to be assigned def release_grades=(release_grades) @@ -264,6 +421,16 @@ def release_grades=(release_grades) @release_grades = release_grades end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] recording_type Object to be assigned + def recording_type=(recording_type) + validator = EnumAttributeValidator.new('String', ["audio", "video"]) + unless validator.valid?(recording_type) + fail ArgumentError, "invalid value for \"recording_type\", must be one of #{validator.allowable_values}." + end + @recording_type = recording_type + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -274,6 +441,9 @@ def ==(o) capabilities == o.capabilities && title == o.title && description == o.description && + description_html == o.description_html && + teacher_instructions == o.teacher_instructions && + teacher_instructions_html == o.teacher_instructions_html && cover == o.cover && cover_file == o.cover_file && attachments == o.attachments && @@ -282,7 +452,15 @@ def ==(o) release_grades == o.release_grades && shuffle_exercises == o.shuffle_exercises && toolset == o.toolset && - nb_playback_authorized == o.nb_playback_authorized + nb_playback_authorized == o.nb_playback_authorized && + restrict_play_note == o.restrict_play_note && + restrict_to_audio_tracks == o.restrict_to_audio_tracks && + submission_students_mode == o.submission_students_mode && + recording_type == o.recording_type && + allow_metronome == o.allow_metronome && + allow_backing_track == o.allow_backing_track && + allow_speed_change == o.allow_speed_change && + free_record == o.free_record end # @see the `==` method @@ -294,7 +472,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, type, capabilities, title, description, cover, cover_file, attachments, use_dedicated_attachments, max_points, release_grades, shuffle_exercises, toolset, nb_playback_authorized].hash + [id, type, capabilities, title, description, description_html, teacher_instructions, teacher_instructions_html, cover, cover_file, attachments, use_dedicated_attachments, max_points, release_grades, shuffle_exercises, toolset, nb_playback_authorized, restrict_play_note, restrict_to_audio_tracks, submission_students_mode, recording_type, allow_metronome, allow_backing_track, allow_speed_change, free_record].hash end # Builds the object from hash @@ -320,61 +498,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -391,24 +514,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_capabilities.rb b/lib/flat_api/models/assignment_capabilities.rb index 7bb5156..43bb24b 100644 --- a/lib/flat_api/models/assignment_capabilities.rb +++ b/lib/flat_api/models/assignment_capabilities.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Capabilities the current user has on this assignment. Each capability corresponds to a fine-grained action that a user may take. - class AssignmentCapabilities + class AssignmentCapabilities < ApiModelBase # Whether the current user can edit the assignment attr_accessor :can_edit @@ -41,9 +41,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -71,9 +76,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCapabilities`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCapabilities`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -142,6 +148,46 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] can_edit Value to be assigned + def can_edit=(can_edit) + if can_edit.nil? + fail ArgumentError, 'can_edit cannot be nil' + end + + @can_edit = can_edit + end + + # Custom attribute writer method with validation + # @param [Object] can_publish_in_class Value to be assigned + def can_publish_in_class=(can_publish_in_class) + if can_publish_in_class.nil? + fail ArgumentError, 'can_publish_in_class cannot be nil' + end + + @can_publish_in_class = can_publish_in_class + end + + # Custom attribute writer method with validation + # @param [Object] can_archive Value to be assigned + def can_archive=(can_archive) + if can_archive.nil? + fail ArgumentError, 'can_archive cannot be nil' + end + + @can_archive = can_archive + end + + # Custom attribute writer method with validation + # @param [Object] can_unarchive Value to be assigned + def can_unarchive=(can_unarchive) + if can_unarchive.nil? + fail ArgumentError, 'can_unarchive cannot be nil' + end + + @can_unarchive = can_unarchive + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -189,61 +235,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -260,24 +251,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_capabilities_can_publish_in_class_error.rb b/lib/flat_api/models/assignment_capabilities_can_publish_in_class_error.rb index e44c370..cbb2af2 100644 --- a/lib/flat_api/models/assignment_capabilities_can_publish_in_class_error.rb +++ b/lib/flat_api/models/assignment_capabilities_can_publish_in_class_error.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # If `canPublishInClass` and `canEdit` are false, the issue why this assignment cannot be published in a class - class AssignmentCapabilitiesCanPublishInClassError + class AssignmentCapabilitiesCanPublishInClassError < ApiModelBase # A corresponding code for this error attr_accessor :code @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCapabilitiesCanPublishInClassError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCapabilitiesCanPublishInClassError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -102,6 +108,26 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if code.nil? + fail ArgumentError, 'code cannot be nil' + end + + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if message.nil? + fail ArgumentError, 'message cannot be nil' + end + + @message = message + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -146,61 +172,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -217,24 +188,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_copy.rb b/lib/flat_api/models/assignment_copy.rb index e7f8f64..60e5fc8 100644 --- a/lib/flat_api/models/assignment_copy.rb +++ b/lib/flat_api/models/assignment_copy.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -38,8 +38,7 @@ def build(data) openapi_one_of.each do |klass| begin next if klass == :AnyType # "nullable: true" - typed_data = find_and_cast_into_type(klass, data) - return typed_data if typed_data + return find_and_cast_into_type(klass, data) rescue # rescue all errors so we keep iterating even if the current item lookup raises end end @@ -65,7 +64,7 @@ def find_and_cast_into_type(klass, data) when 'Time' return Time.parse(data) when 'Date' - return Date.parse(data) + return Date.iso8601(data) when 'String' return data if data.instance_of?(String) when 'Object' # "type: object" diff --git a/lib/flat_api/models/assignment_copy_response.rb b/lib/flat_api/models/assignment_copy_response.rb index 1cf5e14..f261a4b 100644 --- a/lib/flat_api/models/assignment_copy_response.rb +++ b/lib/flat_api/models/assignment_copy_response.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class AssignmentCopyResponse + class AssignmentCopyResponse < ApiModelBase # Unique identifier of the assignment attr_accessor :id @@ -25,15 +25,25 @@ class AssignmentCopyResponse # Title of the assignment attr_accessor :title - # Description and content of the assignment + # Student instructions and content of the assignment (plain text) attr_accessor :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. + attr_accessor :description_html + + # 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. + attr_accessor :teacher_instructions + + # 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. + attr_accessor :teacher_instructions_html + # The URL of the cover to display attr_accessor :cover # The id of the cover to display attr_accessor :cover_file + # 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. attr_accessor :attachments # 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. @@ -54,6 +64,29 @@ class AssignmentCopyResponse # The number of playback authorized on the scores of the assignment. attr_accessor :nb_playback_authorized + # Restrict the ability to get an audio feedback every time a student adds or selects a note. + attr_accessor :restrict_play_note + + # Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. + attr_accessor :restrict_to_audio_tracks + + attr_accessor :submission_students_mode + + # 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'. + attr_accessor :recording_type + + # For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. + attr_accessor :allow_metronome + + # For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. + attr_accessor :allow_backing_track + + # 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'. + attr_accessor :allow_speed_change + + # 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'. + attr_accessor :free_record + # If this assignment is stored as a resource in the Flat for Education Resource Library, the unique identifier of the resource. attr_accessor :resource @@ -87,6 +120,9 @@ def self.attribute_map :'capabilities' => :'capabilities', :'title' => :'title', :'description' => :'description', + :'description_html' => :'descriptionHtml', + :'teacher_instructions' => :'teacherInstructions', + :'teacher_instructions_html' => :'teacherInstructionsHtml', :'cover' => :'cover', :'cover_file' => :'coverFile', :'attachments' => :'attachments', @@ -96,13 +132,26 @@ def self.attribute_map :'shuffle_exercises' => :'shuffleExercises', :'toolset' => :'toolset', :'nb_playback_authorized' => :'nbPlaybackAuthorized', + :'restrict_play_note' => :'restrictPlayNote', + :'restrict_to_audio_tracks' => :'restrictToAudioTracks', + :'submission_students_mode' => :'submissionStudentsMode', + :'recording_type' => :'recordingType', + :'allow_metronome' => :'allowMetronome', + :'allow_backing_track' => :'allowBackingTrack', + :'allow_speed_change' => :'allowSpeedChange', + :'free_record' => :'freeRecord', :'resource' => :'resource' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -113,6 +162,9 @@ def self.openapi_types :'capabilities' => :'AssignmentCapabilities', :'title' => :'String', :'description' => :'String', + :'description_html' => :'String', + :'teacher_instructions' => :'String', + :'teacher_instructions_html' => :'String', :'cover' => :'String', :'cover_file' => :'String', :'attachments' => :'Array', @@ -122,6 +174,14 @@ def self.openapi_types :'shuffle_exercises' => :'Boolean', :'toolset' => :'String', :'nb_playback_authorized' => :'Float', + :'restrict_play_note' => :'Boolean', + :'restrict_to_audio_tracks' => :'Boolean', + :'submission_students_mode' => :'AssignmentSubmissionStudentsMode', + :'recording_type' => :'String', + :'allow_metronome' => :'Boolean', + :'allow_backing_track' => :'Boolean', + :'allow_speed_change' => :'Boolean', + :'free_record' => :'Boolean', :'resource' => :'String' } end @@ -147,9 +207,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCopyResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCopyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -182,6 +243,18 @@ def initialize(attributes = {}) self.description = attributes[:'description'] end + if attributes.key?(:'description_html') + self.description_html = attributes[:'description_html'] + end + + if attributes.key?(:'teacher_instructions') + self.teacher_instructions = attributes[:'teacher_instructions'] + end + + if attributes.key?(:'teacher_instructions_html') + self.teacher_instructions_html = attributes[:'teacher_instructions_html'] + end + if attributes.key?(:'cover') self.cover = attributes[:'cover'] end @@ -222,6 +295,38 @@ def initialize(attributes = {}) self.nb_playback_authorized = attributes[:'nb_playback_authorized'] end + if attributes.key?(:'restrict_play_note') + self.restrict_play_note = attributes[:'restrict_play_note'] + end + + if attributes.key?(:'restrict_to_audio_tracks') + self.restrict_to_audio_tracks = attributes[:'restrict_to_audio_tracks'] + end + + if attributes.key?(:'submission_students_mode') + self.submission_students_mode = attributes[:'submission_students_mode'] + end + + if attributes.key?(:'recording_type') + self.recording_type = attributes[:'recording_type'] + end + + if attributes.key?(:'allow_metronome') + self.allow_metronome = attributes[:'allow_metronome'] + end + + if attributes.key?(:'allow_backing_track') + self.allow_backing_track = attributes[:'allow_backing_track'] + end + + if attributes.key?(:'allow_speed_change') + self.allow_speed_change = attributes[:'allow_speed_change'] + end + + if attributes.key?(:'free_record') + self.free_record = attributes[:'free_record'] + end + if attributes.key?(:'resource') self.resource = attributes[:'resource'] end @@ -266,9 +371,61 @@ def valid? return false if @attachments.nil? release_grades_validator = EnumAttributeValidator.new('String', ["auto", "manual"]) return false unless release_grades_validator.valid?(@release_grades) + recording_type_validator = EnumAttributeValidator.new('String', ["audio", "video"]) + return false unless recording_type_validator.valid?(@recording_type) true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] capabilities Value to be assigned + def capabilities=(capabilities) + if capabilities.nil? + fail ArgumentError, 'capabilities cannot be nil' + end + + @capabilities = capabilities + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.nil? + fail ArgumentError, 'title cannot be nil' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] attachments Value to be assigned + def attachments=(attachments) + if attachments.nil? + fail ArgumentError, 'attachments cannot be nil' + end + + @attachments = attachments + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] release_grades Object to be assigned def release_grades=(release_grades) @@ -279,6 +436,16 @@ def release_grades=(release_grades) @release_grades = release_grades end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] recording_type Object to be assigned + def recording_type=(recording_type) + validator = EnumAttributeValidator.new('String', ["audio", "video"]) + unless validator.valid?(recording_type) + fail ArgumentError, "invalid value for \"recording_type\", must be one of #{validator.allowable_values}." + end + @recording_type = recording_type + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -289,6 +456,9 @@ def ==(o) capabilities == o.capabilities && title == o.title && description == o.description && + description_html == o.description_html && + teacher_instructions == o.teacher_instructions && + teacher_instructions_html == o.teacher_instructions_html && cover == o.cover && cover_file == o.cover_file && attachments == o.attachments && @@ -298,6 +468,14 @@ def ==(o) shuffle_exercises == o.shuffle_exercises && toolset == o.toolset && nb_playback_authorized == o.nb_playback_authorized && + restrict_play_note == o.restrict_play_note && + restrict_to_audio_tracks == o.restrict_to_audio_tracks && + submission_students_mode == o.submission_students_mode && + recording_type == o.recording_type && + allow_metronome == o.allow_metronome && + allow_backing_track == o.allow_backing_track && + allow_speed_change == o.allow_speed_change && + free_record == o.free_record && resource == o.resource end @@ -310,7 +488,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, type, capabilities, title, description, cover, cover_file, attachments, use_dedicated_attachments, max_points, release_grades, shuffle_exercises, toolset, nb_playback_authorized, resource].hash + [id, type, capabilities, title, description, description_html, teacher_instructions, teacher_instructions_html, cover, cover_file, attachments, use_dedicated_attachments, max_points, release_grades, shuffle_exercises, toolset, nb_playback_authorized, restrict_play_note, restrict_to_audio_tracks, submission_students_mode, recording_type, allow_metronome, allow_backing_track, allow_speed_change, free_record, resource].hash end # Builds the object from hash @@ -336,61 +514,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -407,24 +530,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_copy_to_class.rb b/lib/flat_api/models/assignment_copy_to_class.rb index c77c77f..49e9657 100644 --- a/lib/flat_api/models/assignment_copy_to_class.rb +++ b/lib/flat_api/models/assignment_copy_to_class.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Copy the assignment to a class - class AssignmentCopyToClass + class AssignmentCopyToClass < ApiModelBase # The destination classroom where the assignment will be copied attr_accessor :classroom @@ -34,9 +34,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -62,9 +67,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCopyToClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCopyToClass`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -104,6 +110,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] classroom Value to be assigned + def classroom=(classroom) + if classroom.nil? + fail ArgumentError, 'classroom cannot be nil' + end + + @classroom = classroom + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -149,61 +165,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -220,24 +181,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_copy_to_resource_library.rb b/lib/flat_api/models/assignment_copy_to_resource_library.rb index e466de5..689b90f 100644 --- a/lib/flat_api/models/assignment_copy_to_resource_library.rb +++ b/lib/flat_api/models/assignment_copy_to_resource_library.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Copy the assignment to the EDU Resource Library - class AssignmentCopyToResourceLibrary + class AssignmentCopyToResourceLibrary < ApiModelBase # Identifier of the parent resource where the new one will created, e.g. a folder id or `root` attr_accessor :library_parent @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCopyToResourceLibrary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentCopyToResourceLibrary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -95,6 +101,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] library_parent Value to be assigned + def library_parent=(library_parent) + if library_parent.nil? + fail ArgumentError, 'library_parent cannot be nil' + end + + @library_parent = library_parent + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -139,61 +155,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -210,24 +171,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_group.rb b/lib/flat_api/models/assignment_group.rb new file mode 100644 index 0000000..84fe2ca --- /dev/null +++ b/lib/flat_api/models/assignment_group.rb @@ -0,0 +1,232 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # A group assigned to an assignment for shared writing assignments + class AssignmentGroup < ApiModelBase + # The unique identifier of the group + attr_accessor :id + + # The display name of the group + attr_accessor :name + + # 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. + attr_accessor :parent + + # Array of user IDs that are members of this group + attr_accessor :members + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'parent' => :'parent', + :'members' => :'members' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'parent' => :'String', + :'members' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::AssignmentGroup` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentGroup`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'parent') + self.parent = attributes[:'parent'] + end + + if attributes.key?(:'members') + if (value = attributes[:'members']).is_a?(Array) + self.members = value + end + else + self.members = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @members.nil? + invalid_properties.push('invalid value for "members", members cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @name.nil? + return false if @members.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] members Value to be assigned + def members=(members) + if members.nil? + fail ArgumentError, 'members cannot be nil' + end + + @members = members + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + parent == o.parent && + members == o.members + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, parent, members].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/assignment_submission.rb b/lib/flat_api/models/assignment_submission.rb index 5a33d15..f9ae1f3 100644 --- a/lib/flat_api/models/assignment_submission.rb +++ b/lib/flat_api/models/assignment_submission.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Assignment Submission - class AssignmentSubmission + class AssignmentSubmission < ApiModelBase # Unique identifier of the submission attr_accessor :id @@ -113,9 +113,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -135,7 +140,7 @@ def self.openapi_types :'draft_grade' => :'Float', :'max_points' => :'Float', :'exercises_ids' => :'Array', - :'playback' => :'Array', + :'playback' => :'Array', :'comments' => :'AssignmentSubmissionComments', :'google_classroom' => :'GoogleClassroomSubmission', :'microsoft_graph' => :'MicrosoftGraphSubmission', @@ -159,9 +164,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmission`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmission`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -327,6 +333,96 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] state Value to be assigned + def state=(state) + if state.nil? + fail ArgumentError, 'state cannot be nil' + end + + @state = state + end + + # Custom attribute writer method with validation + # @param [Object] classroom Value to be assigned + def classroom=(classroom) + if classroom.nil? + fail ArgumentError, 'classroom cannot be nil' + end + + @classroom = classroom + end + + # Custom attribute writer method with validation + # @param [Object] assignment Value to be assigned + def assignment=(assignment) + if assignment.nil? + fail ArgumentError, 'assignment cannot be nil' + end + + @assignment = assignment + end + + # Custom attribute writer method with validation + # @param [Object] creator Value to be assigned + def creator=(creator) + if creator.nil? + fail ArgumentError, 'creator cannot be nil' + end + + @creator = creator + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method with validation + # @param [Object] attachments Value to be assigned + def attachments=(attachments) + if attachments.nil? + fail ArgumentError, 'attachments cannot be nil' + end + + @attachments = attachments + end + + # Custom attribute writer method with validation + # @param [Object] playback Value to be assigned + def playback=(playback) + if playback.nil? + fail ArgumentError, 'playback cannot be nil' + end + + @playback = playback + end + + # Custom attribute writer method with validation + # @param [Object] comments Value to be assigned + def comments=(comments) + if comments.nil? + fail ArgumentError, 'comments cannot be nil' + end + + @comments = comments + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -388,61 +484,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -459,24 +500,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_submission_comment.rb b/lib/flat_api/models/assignment_submission_comment.rb index b9505c3..146a857 100644 --- a/lib/flat_api/models/assignment_submission_comment.rb +++ b/lib/flat_api/models/assignment_submission_comment.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Feedback comment added to an assignment submission - class AssignmentSubmissionComment + class AssignmentSubmissionComment < ApiModelBase # The comment unique identifier attr_accessor :id @@ -50,9 +50,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -82,9 +87,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionComment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionComment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -182,61 +188,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -253,24 +204,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_submission_comment_creation.rb b/lib/flat_api/models/assignment_submission_comment_creation.rb index 6177255..850be57 100644 --- a/lib/flat_api/models/assignment_submission_comment_creation.rb +++ b/lib/flat_api/models/assignment_submission_comment_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Creation of a assignment submission comment - class AssignmentSubmissionCommentCreation + class AssignmentSubmissionCommentCreation < ApiModelBase # The comment text attr_accessor :comment @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -52,9 +57,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionCommentCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionCommentCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -86,6 +92,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] comment Value to be assigned + def comment=(comment) + if comment.nil? + fail ArgumentError, 'comment cannot be nil' + end + + @comment = comment + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -129,61 +145,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -200,24 +161,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_submission_comments.rb b/lib/flat_api/models/assignment_submission_comments.rb index 5c15db4..b1d5500 100644 --- a/lib/flat_api/models/assignment_submission_comments.rb +++ b/lib/flat_api/models/assignment_submission_comments.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class AssignmentSubmissionComments + class AssignmentSubmissionComments < ApiModelBase # The total number of comments added to the submission attr_accessor :total @@ -29,9 +29,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -56,9 +61,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionComments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionComments`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -131,61 +137,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -202,24 +153,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_submission_history.rb b/lib/flat_api/models/assignment_submission_history.rb index 26cd7d1..be12966 100644 --- a/lib/flat_api/models/assignment_submission_history.rb +++ b/lib/flat_api/models/assignment_submission_history.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # History item of the submission - class AssignmentSubmissionHistory + class AssignmentSubmissionHistory < ApiModelBase # The date when the submission was changed attr_accessor :date @@ -94,9 +94,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -132,9 +137,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionHistory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionHistory`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -225,6 +231,26 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] date Value to be assigned + def date=(date) + if date.nil? + fail ArgumentError, 'date cannot be nil' + end + + @date = date + end + + # Custom attribute writer method with validation + # @param [Object] users Value to be assigned + def users=(users) + if users.nil? + fail ArgumentError, 'users cannot be nil' + end + + @users = users + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] source Object to be assigned def source=(source) @@ -290,61 +316,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -361,24 +332,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_submission_history_attachment.rb b/lib/flat_api/models/assignment_submission_history_attachment.rb index a85d03f..510e8b3 100644 --- a/lib/flat_api/models/assignment_submission_history_attachment.rb +++ b/lib/flat_api/models/assignment_submission_history_attachment.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class AssignmentSubmissionHistoryAttachment + class AssignmentSubmissionHistoryAttachment < ApiModelBase # The score identifier that changed attr_accessor :score @@ -33,9 +33,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -61,9 +66,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionHistoryAttachment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionHistoryAttachment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -141,61 +147,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -212,24 +163,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_submission_history_state.rb b/lib/flat_api/models/assignment_submission_history_state.rb index ee3f311..c328eaf 100644 --- a/lib/flat_api/models/assignment_submission_history_state.rb +++ b/lib/flat_api/models/assignment_submission_history_state.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/assignment_submission_lti.rb b/lib/flat_api/models/assignment_submission_lti.rb index 1af8a06..a3c0b41 100644 --- a/lib/flat_api/models/assignment_submission_lti.rb +++ b/lib/flat_api/models/assignment_submission_lti.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,25 +14,58 @@ require 'time' module FlatApi - class AssignmentSubmissionLti + # If set, this submission has a linked LTI 1.3 AGS or LTI 1.1 Outcomes + class AssignmentSubmissionLti < ApiModelBase + # 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 + attr_accessor :grade_service + # The sourcedid of the LTI submission when using LTI Outcomes attr_accessor :sourcedid + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'grade_service' => :'gradeService', :'sourcedid' => :'sourcedid' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. def self.openapi_types { + :'grade_service' => :'String', :'sourcedid' => :'String' } end @@ -51,17 +84,22 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionLti`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionLti`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } + if attributes.key?(:'grade_service') + self.grade_service = attributes[:'grade_service'] + else + self.grade_service = nil + end + if attributes.key?(:'sourcedid') self.sourcedid = attributes[:'sourcedid'] - else - self.sourcedid = nil end end @@ -70,8 +108,8 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @sourcedid.nil? - invalid_properties.push('invalid value for "sourcedid", sourcedid cannot be nil.') + if @grade_service.nil? + invalid_properties.push('invalid value for "grade_service", grade_service cannot be nil.') end invalid_properties @@ -81,15 +119,28 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @sourcedid.nil? + return false if @grade_service.nil? + grade_service_validator = EnumAttributeValidator.new('String', ["ags2p0", "outcomes1p1"]) + return false unless grade_service_validator.valid?(@grade_service) true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] grade_service Object to be assigned + def grade_service=(grade_service) + validator = EnumAttributeValidator.new('String', ["ags2p0", "outcomes1p1"]) + unless validator.valid?(grade_service) + fail ArgumentError, "invalid value for \"grade_service\", must be one of #{validator.allowable_values}." + end + @grade_service = grade_service + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && + grade_service == o.grade_service && sourcedid == o.sourcedid end @@ -102,7 +153,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [sourcedid].hash + [grade_service, sourcedid].hash end # Builds the object from hash @@ -128,61 +179,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -199,24 +195,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_submission_playback_inner.rb b/lib/flat_api/models/assignment_submission_playback.rb similarity index 53% rename from lib/flat_api/models/assignment_submission_playback_inner.rb rename to lib/flat_api/models/assignment_submission_playback.rb index ea09daa..1cac8ef 100644 --- a/lib/flat_api/models/assignment_submission_playback_inner.rb +++ b/lib/flat_api/models/assignment_submission_playback.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,12 +14,12 @@ require 'time' module FlatApi - # Playback used by student in this submission (used to limit the playback for the assignment) - class AssignmentSubmissionPlaybackInner + # Playback used by a student for an assignment submission. + class AssignmentSubmissionPlayback < ApiModelBase # The score unique identifier attr_accessor :score - # The number of playback used by the student + # Number of times the score was played attr_accessor :nb_play_attempt # Attribute mapping from ruby-style variable name to JSON key. @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -53,13 +58,14 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::AssignmentSubmissionPlaybackInner` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::AssignmentSubmissionPlayback` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionPlaybackInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionPlayback`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -102,6 +108,26 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] score Value to be assigned + def score=(score) + if score.nil? + fail ArgumentError, 'score cannot be nil' + end + + @score = score + end + + # Custom attribute writer method with validation + # @param [Object] nb_play_attempt Value to be assigned + def nb_play_attempt=(nb_play_attempt) + if nb_play_attempt.nil? + fail ArgumentError, 'nb_play_attempt cannot be nil' + end + + @nb_play_attempt = nb_play_attempt + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -146,61 +172,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -217,24 +188,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_submission_state.rb b/lib/flat_api/models/assignment_submission_state.rb index 1fd4080..f3c322b 100644 --- a/lib/flat_api/models/assignment_submission_state.rb +++ b/lib/flat_api/models/assignment_submission_state.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/assignment_submission_students_mode.rb b/lib/flat_api/models/assignment_submission_students_mode.rb new file mode 100644 index 0000000..4bbf047 --- /dev/null +++ b/lib/flat_api/models/assignment_submission_students_mode.rb @@ -0,0 +1,40 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class AssignmentSubmissionStudentsMode + SINGLE = "single".freeze + GROUP = "group".freeze + + def self.all_vars + @all_vars ||= [SINGLE, GROUP].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if AssignmentSubmissionStudentsMode.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #AssignmentSubmissionStudentsMode" + end + end +end diff --git a/lib/flat_api/models/assignment_submission_update.rb b/lib/flat_api/models/assignment_submission_update.rb index 9d47e94..f5c5c14 100644 --- a/lib/flat_api/models/assignment_submission_update.rb +++ b/lib/flat_api/models/assignment_submission_update.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,9 +15,11 @@ module FlatApi # Assignment Submission creation - class AssignmentSubmissionUpdate + class AssignmentSubmissionUpdate < ApiModelBase attr_accessor :attachments + attr_accessor :playback + # If `true`, the submission will be marked as done attr_accessor :submit @@ -37,6 +39,7 @@ class AssignmentSubmissionUpdate def self.attribute_map { :'attachments' => :'attachments', + :'playback' => :'playback', :'submit' => :'submit', :'draft_grade' => :'draftGrade', :'grade' => :'grade', @@ -45,15 +48,21 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. def self.openapi_types { :'attachments' => :'Array', + :'playback' => :'Array', :'submit' => :'Boolean', :'draft_grade' => :'Float', :'grade' => :'Float', @@ -79,9 +88,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentSubmissionUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -92,6 +102,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'playback') + if (value = attributes[:'playback']).is_a?(Array) + self.playback = value + end + end + if attributes.key?(:'submit') self.submit = attributes[:'submit'] end @@ -184,6 +200,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && attachments == o.attachments && + playback == o.playback && submit == o.submit && draft_grade == o.draft_grade && grade == o.grade && @@ -200,7 +217,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [attachments, submit, draft_grade, grade, exercises_ids, _return].hash + [attachments, playback, submit, draft_grade, grade, exercises_ids, _return].hash end # Builds the object from hash @@ -226,61 +243,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -297,24 +259,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/assignment_type.rb b/lib/flat_api/models/assignment_type.rb index 45dd8b0..845e4d7 100644 --- a/lib/flat_api/models/assignment_type.rb +++ b/lib/flat_api/models/assignment_type.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -20,10 +20,11 @@ class AssignmentType SCORE_TEMPLATE = "scoreTemplate".freeze SHARED_WRITING = "sharedWriting".freeze WORKSHEET = "worksheet".freeze + WORKSHEET_TEXT = "worksheetText".freeze PERFORMANCE = "performance".freeze def self.all_vars - @all_vars ||= [NONE, NEW_SCORE, SCORE_TEMPLATE, SHARED_WRITING, WORKSHEET, PERFORMANCE].freeze + @all_vars ||= [NONE, NEW_SCORE, SCORE_TEMPLATE, SHARED_WRITING, WORKSHEET, WORKSHEET_TEXT, PERFORMANCE].freeze end # Builds the enum from string diff --git a/lib/flat_api/models/assignment_update.rb b/lib/flat_api/models/assignment_update.rb index 92501c1..24a5f8a 100644 --- a/lib/flat_api/models/assignment_update.rb +++ b/lib/flat_api/models/assignment_update.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,20 +15,36 @@ module FlatApi # Assignment Resource Editing - class AssignmentUpdate + class AssignmentUpdate < ApiModelBase attr_accessor :type # Title of the assignment attr_accessor :title - # Description and content of the assignment + # Student instructions and content of the assignment (plain text) attr_accessor :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. + attr_accessor :description_html + + # Teacher-only instructions (plain text) + attr_accessor :teacher_instructions + + # 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. + attr_accessor :teacher_instructions_html + + # 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`. attr_accessor :attachments # The number of playback authorized on the scores of the assignment. attr_accessor :nb_playback_authorized + # Restrict the ability to get an audio feedback every time a student adds or selects a note. + attr_accessor :restrict_play_note + + # Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. + attr_accessor :restrict_to_audio_tracks + # 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. attr_accessor :toolset @@ -47,6 +63,23 @@ class AssignmentUpdate # Mixing worksheets exercises for each student attr_accessor :shuffle_exercises + attr_accessor :submission_students_mode + + # 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'. + attr_accessor :recording_type + + # For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. + attr_accessor :allow_metronome + + # For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. + attr_accessor :allow_backing_track + + # 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'. + attr_accessor :allow_speed_change + + # 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'. + attr_accessor :free_record + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -75,20 +108,36 @@ def self.attribute_map :'type' => :'type', :'title' => :'title', :'description' => :'description', + :'description_html' => :'descriptionHtml', + :'teacher_instructions' => :'teacherInstructions', + :'teacher_instructions_html' => :'teacherInstructionsHtml', :'attachments' => :'attachments', :'nb_playback_authorized' => :'nbPlaybackAuthorized', + :'restrict_play_note' => :'restrictPlayNote', + :'restrict_to_audio_tracks' => :'restrictToAudioTracks', :'toolset' => :'toolset', :'cover_file' => :'coverFile', :'cover' => :'cover', :'max_points' => :'maxPoints', :'release_grades' => :'releaseGrades', - :'shuffle_exercises' => :'shuffleExercises' + :'shuffle_exercises' => :'shuffleExercises', + :'submission_students_mode' => :'submissionStudentsMode', + :'recording_type' => :'recordingType', + :'allow_metronome' => :'allowMetronome', + :'allow_backing_track' => :'allowBackingTrack', + :'allow_speed_change' => :'allowSpeedChange', + :'free_record' => :'freeRecord' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -97,14 +146,25 @@ def self.openapi_types :'type' => :'AssignmentType', :'title' => :'String', :'description' => :'String', + :'description_html' => :'String', + :'teacher_instructions' => :'String', + :'teacher_instructions_html' => :'String', :'attachments' => :'Array', :'nb_playback_authorized' => :'Float', + :'restrict_play_note' => :'Boolean', + :'restrict_to_audio_tracks' => :'Boolean', :'toolset' => :'String', :'cover_file' => :'String', :'cover' => :'String', :'max_points' => :'Float', :'release_grades' => :'String', - :'shuffle_exercises' => :'Boolean' + :'shuffle_exercises' => :'Boolean', + :'submission_students_mode' => :'AssignmentSubmissionStudentsMode', + :'recording_type' => :'String', + :'allow_metronome' => :'Boolean', + :'allow_backing_track' => :'Boolean', + :'allow_speed_change' => :'Boolean', + :'free_record' => :'Boolean' } end @@ -127,9 +187,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::AssignmentUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -146,6 +207,18 @@ def initialize(attributes = {}) self.description = attributes[:'description'] end + if attributes.key?(:'description_html') + self.description_html = attributes[:'description_html'] + end + + if attributes.key?(:'teacher_instructions') + self.teacher_instructions = attributes[:'teacher_instructions'] + end + + if attributes.key?(:'teacher_instructions_html') + self.teacher_instructions_html = attributes[:'teacher_instructions_html'] + end + if attributes.key?(:'attachments') if (value = attributes[:'attachments']).is_a?(Array) self.attachments = value @@ -156,6 +229,14 @@ def initialize(attributes = {}) self.nb_playback_authorized = attributes[:'nb_playback_authorized'] end + if attributes.key?(:'restrict_play_note') + self.restrict_play_note = attributes[:'restrict_play_note'] + end + + if attributes.key?(:'restrict_to_audio_tracks') + self.restrict_to_audio_tracks = attributes[:'restrict_to_audio_tracks'] + end + if attributes.key?(:'toolset') self.toolset = attributes[:'toolset'] end @@ -179,6 +260,30 @@ def initialize(attributes = {}) if attributes.key?(:'shuffle_exercises') self.shuffle_exercises = attributes[:'shuffle_exercises'] end + + if attributes.key?(:'submission_students_mode') + self.submission_students_mode = attributes[:'submission_students_mode'] + end + + if attributes.key?(:'recording_type') + self.recording_type = attributes[:'recording_type'] + end + + if attributes.key?(:'allow_metronome') + self.allow_metronome = attributes[:'allow_metronome'] + end + + if attributes.key?(:'allow_backing_track') + self.allow_backing_track = attributes[:'allow_backing_track'] + end + + if attributes.key?(:'allow_speed_change') + self.allow_speed_change = attributes[:'allow_speed_change'] + end + + if attributes.key?(:'free_record') + self.free_record = attributes[:'free_record'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -191,7 +296,23 @@ def list_invalid_properties end if !@title.nil? && @title.to_s.length < 1 - invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.') + invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 1.') + end + + if !@description.nil? && @description.to_s.length > 100000 + invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 100000.') + end + + if !@description_html.nil? && @description_html.to_s.length > 20000000 + invalid_properties.push('invalid value for "description_html", the character length must be smaller than or equal to 20000000.') + end + + if !@teacher_instructions.nil? && @teacher_instructions.to_s.length > 100000 + invalid_properties.push('invalid value for "teacher_instructions", the character length must be smaller than or equal to 100000.') + end + + if !@teacher_instructions_html.nil? && @teacher_instructions_html.to_s.length > 20000000 + invalid_properties.push('invalid value for "teacher_instructions_html", the character length must be smaller than or equal to 20000000.') end if !@max_points.nil? && @max_points > 10000 @@ -211,10 +332,16 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@title.nil? && @title.to_s.length > 1000 return false if !@title.nil? && @title.to_s.length < 1 + return false if !@description.nil? && @description.to_s.length > 100000 + return false if !@description_html.nil? && @description_html.to_s.length > 20000000 + return false if !@teacher_instructions.nil? && @teacher_instructions.to_s.length > 100000 + return false if !@teacher_instructions_html.nil? && @teacher_instructions_html.to_s.length > 20000000 return false if !@max_points.nil? && @max_points > 10000 return false if !@max_points.nil? && @max_points < 0 release_grades_validator = EnumAttributeValidator.new('String', ["auto", "manual"]) return false unless release_grades_validator.valid?(@release_grades) + recording_type_validator = EnumAttributeValidator.new('String', ["audio", "video"]) + return false unless recording_type_validator.valid?(@recording_type) true end @@ -230,12 +357,68 @@ def title=(title) end if title.to_s.length < 1 - fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.' + fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 1.' end @title = title end + # Custom attribute writer method with validation + # @param [Object] description Value to be assigned + def description=(description) + if description.nil? + fail ArgumentError, 'description cannot be nil' + end + + if description.to_s.length > 100000 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 100000.' + end + + @description = description + end + + # Custom attribute writer method with validation + # @param [Object] description_html Value to be assigned + def description_html=(description_html) + if description_html.nil? + fail ArgumentError, 'description_html cannot be nil' + end + + if description_html.to_s.length > 20000000 + fail ArgumentError, 'invalid value for "description_html", the character length must be smaller than or equal to 20000000.' + end + + @description_html = description_html + end + + # Custom attribute writer method with validation + # @param [Object] teacher_instructions Value to be assigned + def teacher_instructions=(teacher_instructions) + if teacher_instructions.nil? + fail ArgumentError, 'teacher_instructions cannot be nil' + end + + if teacher_instructions.to_s.length > 100000 + fail ArgumentError, 'invalid value for "teacher_instructions", the character length must be smaller than or equal to 100000.' + end + + @teacher_instructions = teacher_instructions + end + + # Custom attribute writer method with validation + # @param [Object] teacher_instructions_html Value to be assigned + def teacher_instructions_html=(teacher_instructions_html) + if teacher_instructions_html.nil? + fail ArgumentError, 'teacher_instructions_html cannot be nil' + end + + if teacher_instructions_html.to_s.length > 20000000 + fail ArgumentError, 'invalid value for "teacher_instructions_html", the character length must be smaller than or equal to 20000000.' + end + + @teacher_instructions_html = teacher_instructions_html + end + # Custom attribute writer method with validation # @param [Object] max_points Value to be assigned def max_points=(max_points) @@ -260,6 +443,16 @@ def release_grades=(release_grades) @release_grades = release_grades end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] recording_type Object to be assigned + def recording_type=(recording_type) + validator = EnumAttributeValidator.new('String', ["audio", "video"]) + unless validator.valid?(recording_type) + fail ArgumentError, "invalid value for \"recording_type\", must be one of #{validator.allowable_values}." + end + @recording_type = recording_type + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -268,14 +461,25 @@ def ==(o) type == o.type && title == o.title && description == o.description && + description_html == o.description_html && + teacher_instructions == o.teacher_instructions && + teacher_instructions_html == o.teacher_instructions_html && attachments == o.attachments && nb_playback_authorized == o.nb_playback_authorized && + restrict_play_note == o.restrict_play_note && + restrict_to_audio_tracks == o.restrict_to_audio_tracks && toolset == o.toolset && cover_file == o.cover_file && cover == o.cover && max_points == o.max_points && release_grades == o.release_grades && - shuffle_exercises == o.shuffle_exercises + shuffle_exercises == o.shuffle_exercises && + submission_students_mode == o.submission_students_mode && + recording_type == o.recording_type && + allow_metronome == o.allow_metronome && + allow_backing_track == o.allow_backing_track && + allow_speed_change == o.allow_speed_change && + free_record == o.free_record end # @see the `==` method @@ -287,7 +491,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, title, description, attachments, nb_playback_authorized, toolset, cover_file, cover, max_points, release_grades, shuffle_exercises].hash + [type, title, description, description_html, teacher_instructions, teacher_instructions_html, attachments, nb_playback_authorized, restrict_play_note, restrict_to_audio_tracks, toolset, cover_file, cover, max_points, release_grades, shuffle_exercises, submission_students_mode, recording_type, allow_metronome, allow_backing_track, allow_speed_change, free_record].hash end # Builds the object from hash @@ -313,61 +517,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -384,24 +533,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_assignment.rb b/lib/flat_api/models/class_assignment.rb index bd01330..bfc65e6 100644 --- a/lib/flat_api/models/class_assignment.rb +++ b/lib/flat_api/models/class_assignment.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class ClassAssignment + class ClassAssignment < ApiModelBase # Unique identifier of the assignment attr_accessor :id @@ -25,15 +25,25 @@ class ClassAssignment # Title of the assignment attr_accessor :title - # Description and content of the assignment + # Student instructions and content of the assignment (plain text) attr_accessor :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. + attr_accessor :description_html + + # 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. + attr_accessor :teacher_instructions + + # 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. + attr_accessor :teacher_instructions_html + # The URL of the cover to display attr_accessor :cover # The id of the cover to display attr_accessor :cover_file + # 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. attr_accessor :attachments # 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. @@ -54,6 +64,29 @@ class ClassAssignment # The number of playback authorized on the scores of the assignment. attr_accessor :nb_playback_authorized + # Restrict the ability to get an audio feedback every time a student adds or selects a note. + attr_accessor :restrict_play_note + + # Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. + attr_accessor :restrict_to_audio_tracks + + attr_accessor :submission_students_mode + + # 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'. + attr_accessor :recording_type + + # For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. + attr_accessor :allow_metronome + + # For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. + attr_accessor :allow_backing_track + + # 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'. + attr_accessor :allow_speed_change + + # 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'. + attr_accessor :free_record + # The User unique identifier of the creator of this assignment attr_accessor :creator @@ -78,6 +111,9 @@ class ClassAssignment # Identifiers for the students that have access to the assignment attr_accessor :assigned_students + # Groups that have access to the assignment (for shared writing assignments) + attr_accessor :assigned_groups + attr_accessor :submissions attr_accessor :google_classroom @@ -123,6 +159,9 @@ def self.attribute_map :'capabilities' => :'capabilities', :'title' => :'title', :'description' => :'description', + :'description_html' => :'descriptionHtml', + :'teacher_instructions' => :'teacherInstructions', + :'teacher_instructions_html' => :'teacherInstructionsHtml', :'cover' => :'cover', :'cover_file' => :'coverFile', :'attachments' => :'attachments', @@ -132,6 +171,14 @@ def self.attribute_map :'shuffle_exercises' => :'shuffleExercises', :'toolset' => :'toolset', :'nb_playback_authorized' => :'nbPlaybackAuthorized', + :'restrict_play_note' => :'restrictPlayNote', + :'restrict_to_audio_tracks' => :'restrictToAudioTracks', + :'submission_students_mode' => :'submissionStudentsMode', + :'recording_type' => :'recordingType', + :'allow_metronome' => :'allowMetronome', + :'allow_backing_track' => :'allowBackingTrack', + :'allow_speed_change' => :'allowSpeedChange', + :'free_record' => :'freeRecord', :'creator' => :'creator', :'state' => :'state', :'classroom' => :'classroom', @@ -140,6 +187,7 @@ def self.attribute_map :'due_date' => :'dueDate', :'assignee_mode' => :'assigneeMode', :'assigned_students' => :'assignedStudents', + :'assigned_groups' => :'assignedGroups', :'submissions' => :'submissions', :'google_classroom' => :'googleClassroom', :'microsoft_graph' => :'microsoftGraph', @@ -150,9 +198,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -163,6 +216,9 @@ def self.openapi_types :'capabilities' => :'AssignmentCapabilities', :'title' => :'String', :'description' => :'String', + :'description_html' => :'String', + :'teacher_instructions' => :'String', + :'teacher_instructions_html' => :'String', :'cover' => :'String', :'cover_file' => :'String', :'attachments' => :'Array', @@ -172,6 +228,14 @@ def self.openapi_types :'shuffle_exercises' => :'Boolean', :'toolset' => :'String', :'nb_playback_authorized' => :'Float', + :'restrict_play_note' => :'Boolean', + :'restrict_to_audio_tracks' => :'Boolean', + :'submission_students_mode' => :'AssignmentSubmissionStudentsMode', + :'recording_type' => :'String', + :'allow_metronome' => :'Boolean', + :'allow_backing_track' => :'Boolean', + :'allow_speed_change' => :'Boolean', + :'free_record' => :'Boolean', :'creator' => :'String', :'state' => :'String', :'classroom' => :'String', @@ -180,6 +244,7 @@ def self.openapi_types :'due_date' => :'Time', :'assignee_mode' => :'String', :'assigned_students' => :'Array', + :'assigned_groups' => :'Array', :'submissions' => :'Array', :'google_classroom' => :'GoogleClassroomCoursework', :'microsoft_graph' => :'MicrosoftGraphAssignment', @@ -211,9 +276,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -246,6 +312,18 @@ def initialize(attributes = {}) self.description = attributes[:'description'] end + if attributes.key?(:'description_html') + self.description_html = attributes[:'description_html'] + end + + if attributes.key?(:'teacher_instructions') + self.teacher_instructions = attributes[:'teacher_instructions'] + end + + if attributes.key?(:'teacher_instructions_html') + self.teacher_instructions_html = attributes[:'teacher_instructions_html'] + end + if attributes.key?(:'cover') self.cover = attributes[:'cover'] end @@ -286,6 +364,38 @@ def initialize(attributes = {}) self.nb_playback_authorized = attributes[:'nb_playback_authorized'] end + if attributes.key?(:'restrict_play_note') + self.restrict_play_note = attributes[:'restrict_play_note'] + end + + if attributes.key?(:'restrict_to_audio_tracks') + self.restrict_to_audio_tracks = attributes[:'restrict_to_audio_tracks'] + end + + if attributes.key?(:'submission_students_mode') + self.submission_students_mode = attributes[:'submission_students_mode'] + end + + if attributes.key?(:'recording_type') + self.recording_type = attributes[:'recording_type'] + end + + if attributes.key?(:'allow_metronome') + self.allow_metronome = attributes[:'allow_metronome'] + end + + if attributes.key?(:'allow_backing_track') + self.allow_backing_track = attributes[:'allow_backing_track'] + end + + if attributes.key?(:'allow_speed_change') + self.allow_speed_change = attributes[:'allow_speed_change'] + end + + if attributes.key?(:'free_record') + self.free_record = attributes[:'free_record'] + end + if attributes.key?(:'creator') self.creator = attributes[:'creator'] end @@ -324,6 +434,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'assigned_groups') + if (value = attributes[:'assigned_groups']).is_a?(Array) + self.assigned_groups = value + end + end + if attributes.key?(:'submissions') if (value = attributes[:'submissions']).is_a?(Array) self.submissions = value @@ -408,6 +524,8 @@ def valid? return false if @attachments.nil? release_grades_validator = EnumAttributeValidator.new('String', ["auto", "manual"]) return false unless release_grades_validator.valid?(@release_grades) + recording_type_validator = EnumAttributeValidator.new('String', ["audio", "video"]) + return false unless recording_type_validator.valid?(@recording_type) return false if @state.nil? state_validator = EnumAttributeValidator.new('String', ["draft", "active", "archived"]) return false unless state_validator.valid?(@state) @@ -418,6 +536,56 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] capabilities Value to be assigned + def capabilities=(capabilities) + if capabilities.nil? + fail ArgumentError, 'capabilities cannot be nil' + end + + @capabilities = capabilities + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.nil? + fail ArgumentError, 'title cannot be nil' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] attachments Value to be assigned + def attachments=(attachments) + if attachments.nil? + fail ArgumentError, 'attachments cannot be nil' + end + + @attachments = attachments + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] release_grades Object to be assigned def release_grades=(release_grades) @@ -428,6 +596,16 @@ def release_grades=(release_grades) @release_grades = release_grades end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] recording_type Object to be assigned + def recording_type=(recording_type) + validator = EnumAttributeValidator.new('String', ["audio", "video"]) + unless validator.valid?(recording_type) + fail ArgumentError, "invalid value for \"recording_type\", must be one of #{validator.allowable_values}." + end + @recording_type = recording_type + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] state Object to be assigned def state=(state) @@ -438,6 +616,16 @@ def state=(state) @state = state end + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] assignee_mode Object to be assigned def assignee_mode=(assignee_mode) @@ -448,6 +636,16 @@ def assignee_mode=(assignee_mode) @assignee_mode = assignee_mode end + # Custom attribute writer method with validation + # @param [Object] submissions Value to be assigned + def submissions=(submissions) + if submissions.nil? + fail ArgumentError, 'submissions cannot be nil' + end + + @submissions = submissions + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -458,6 +656,9 @@ def ==(o) capabilities == o.capabilities && title == o.title && description == o.description && + description_html == o.description_html && + teacher_instructions == o.teacher_instructions && + teacher_instructions_html == o.teacher_instructions_html && cover == o.cover && cover_file == o.cover_file && attachments == o.attachments && @@ -467,6 +668,14 @@ def ==(o) shuffle_exercises == o.shuffle_exercises && toolset == o.toolset && nb_playback_authorized == o.nb_playback_authorized && + restrict_play_note == o.restrict_play_note && + restrict_to_audio_tracks == o.restrict_to_audio_tracks && + submission_students_mode == o.submission_students_mode && + recording_type == o.recording_type && + allow_metronome == o.allow_metronome && + allow_backing_track == o.allow_backing_track && + allow_speed_change == o.allow_speed_change && + free_record == o.free_record && creator == o.creator && state == o.state && classroom == o.classroom && @@ -475,6 +684,7 @@ def ==(o) due_date == o.due_date && assignee_mode == o.assignee_mode && assigned_students == o.assigned_students && + assigned_groups == o.assigned_groups && submissions == o.submissions && google_classroom == o.google_classroom && microsoft_graph == o.microsoft_graph && @@ -493,7 +703,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, type, capabilities, title, description, cover, cover_file, attachments, use_dedicated_attachments, max_points, release_grades, shuffle_exercises, toolset, nb_playback_authorized, creator, state, classroom, creation_date, scheduled_date, due_date, assignee_mode, assigned_students, submissions, google_classroom, microsoft_graph, mfc, canvas, lti, issue].hash + [id, type, capabilities, title, description, description_html, teacher_instructions, teacher_instructions_html, cover, cover_file, attachments, use_dedicated_attachments, max_points, release_grades, shuffle_exercises, toolset, nb_playback_authorized, restrict_play_note, restrict_to_audio_tracks, submission_students_mode, recording_type, allow_metronome, allow_backing_track, allow_speed_change, free_record, creator, state, classroom, creation_date, scheduled_date, due_date, assignee_mode, assigned_students, assigned_groups, submissions, google_classroom, microsoft_graph, mfc, canvas, lti, issue].hash end # Builds the object from hash @@ -519,61 +729,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -590,24 +745,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_assignment_all_of_canvas.rb b/lib/flat_api/models/class_assignment_all_of_canvas.rb index d7ff2b5..506f1f3 100644 --- a/lib/flat_api/models/class_assignment_all_of_canvas.rb +++ b/lib/flat_api/models/class_assignment_all_of_canvas.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A Canvas LMS assignment - class ClassAssignmentAllOfCanvas + class ClassAssignmentAllOfCanvas < ApiModelBase # Unique identifier of the course on Canvas assignment attr_accessor :id @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentAllOfCanvas`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentAllOfCanvas`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,61 +138,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -203,24 +154,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_assignment_all_of_lti.rb b/lib/flat_api/models/class_assignment_all_of_lti.rb index ec37b35..858d63f 100644 --- a/lib/flat_api/models/class_assignment_all_of_lti.rb +++ b/lib/flat_api/models/class_assignment_all_of_lti.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # An LTI assignment - class ClassAssignmentAllOfLti + class ClassAssignmentAllOfLti < ApiModelBase # Resource ID in the LMS attr_accessor :id @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -52,9 +57,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentAllOfLti`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentAllOfLti`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -122,61 +128,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -193,24 +144,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_assignment_all_of_mfc.rb b/lib/flat_api/models/class_assignment_all_of_mfc.rb index 113c505..55d46d9 100644 --- a/lib/flat_api/models/class_assignment_all_of_mfc.rb +++ b/lib/flat_api/models/class_assignment_all_of_mfc.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A MusicFirst Classroom assignment - class ClassAssignmentAllOfMfc + class ClassAssignmentAllOfMfc < ApiModelBase # Unique identifier of the course on MusicFirst Task attr_accessor :id @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentAllOfMfc`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentAllOfMfc`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,61 +138,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -203,24 +154,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_assignment_update.rb b/lib/flat_api/models/class_assignment_update.rb index e0503b5..ee9c8bc 100644 --- a/lib/flat_api/models/class_assignment_update.rb +++ b/lib/flat_api/models/class_assignment_update.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,20 +14,36 @@ require 'time' module FlatApi - class ClassAssignmentUpdate + class ClassAssignmentUpdate < ApiModelBase attr_accessor :type # Title of the assignment attr_accessor :title - # Description and content of the assignment + # Student instructions and content of the assignment (plain text) attr_accessor :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. + attr_accessor :description_html + + # Teacher-only instructions (plain text) + attr_accessor :teacher_instructions + + # 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. + attr_accessor :teacher_instructions_html + + # 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`. attr_accessor :attachments # The number of playback authorized on the scores of the assignment. attr_accessor :nb_playback_authorized + # Restrict the ability to get an audio feedback every time a student adds or selects a note. + attr_accessor :restrict_play_note + + # Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. + attr_accessor :restrict_to_audio_tracks + # 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. attr_accessor :toolset @@ -46,6 +62,23 @@ class ClassAssignmentUpdate # Mixing worksheets exercises for each student attr_accessor :shuffle_exercises + attr_accessor :submission_students_mode + + # 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'. + attr_accessor :recording_type + + # For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. + attr_accessor :allow_metronome + + # For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. + attr_accessor :allow_backing_track + + # 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'. + attr_accessor :allow_speed_change + + # 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'. + attr_accessor :free_record + # State of the assignment attr_accessor :state @@ -65,6 +98,9 @@ class ClassAssignmentUpdate # Identifiers for the students that have access to the assignment attr_accessor :assigned_students + # 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 + attr_accessor :class_group_ids + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -93,27 +129,44 @@ def self.attribute_map :'type' => :'type', :'title' => :'title', :'description' => :'description', + :'description_html' => :'descriptionHtml', + :'teacher_instructions' => :'teacherInstructions', + :'teacher_instructions_html' => :'teacherInstructionsHtml', :'attachments' => :'attachments', :'nb_playback_authorized' => :'nbPlaybackAuthorized', + :'restrict_play_note' => :'restrictPlayNote', + :'restrict_to_audio_tracks' => :'restrictToAudioTracks', :'toolset' => :'toolset', :'cover_file' => :'coverFile', :'cover' => :'cover', :'max_points' => :'maxPoints', :'release_grades' => :'releaseGrades', :'shuffle_exercises' => :'shuffleExercises', + :'submission_students_mode' => :'submissionStudentsMode', + :'recording_type' => :'recordingType', + :'allow_metronome' => :'allowMetronome', + :'allow_backing_track' => :'allowBackingTrack', + :'allow_speed_change' => :'allowSpeedChange', + :'free_record' => :'freeRecord', :'state' => :'state', :'due_date' => :'dueDate', :'scheduled_date' => :'scheduledDate', :'google_classroom' => :'googleClassroom', :'microsoft_graph' => :'microsoftGraph', :'assignee_mode' => :'assigneeMode', - :'assigned_students' => :'assignedStudents' + :'assigned_students' => :'assignedStudents', + :'class_group_ids' => :'classGroupIds' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -122,34 +175,42 @@ def self.openapi_types :'type' => :'AssignmentType', :'title' => :'String', :'description' => :'String', + :'description_html' => :'String', + :'teacher_instructions' => :'String', + :'teacher_instructions_html' => :'String', :'attachments' => :'Array', :'nb_playback_authorized' => :'Float', + :'restrict_play_note' => :'Boolean', + :'restrict_to_audio_tracks' => :'Boolean', :'toolset' => :'String', :'cover_file' => :'String', :'cover' => :'String', :'max_points' => :'Float', :'release_grades' => :'String', :'shuffle_exercises' => :'Boolean', + :'submission_students_mode' => :'AssignmentSubmissionStudentsMode', + :'recording_type' => :'String', + :'allow_metronome' => :'Boolean', + :'allow_backing_track' => :'Boolean', + :'allow_speed_change' => :'Boolean', + :'free_record' => :'Boolean', :'state' => :'String', :'due_date' => :'Time', :'scheduled_date' => :'Time', :'google_classroom' => :'ClassAssignmentUpdateAllOfGoogleClassroom', :'microsoft_graph' => :'ClassAssignmentUpdateAllOfMicrosoftGraph', :'assignee_mode' => :'String', - :'assigned_students' => :'Array' + :'assigned_students' => :'Array', + :'class_group_ids' => :'Array' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'nb_playback_authorized', - :'toolset', - :'cover_file', - :'cover', - :'max_points', :'due_date', :'scheduled_date', + :'class_group_ids' ]) end @@ -168,9 +229,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -187,6 +249,18 @@ def initialize(attributes = {}) self.description = attributes[:'description'] end + if attributes.key?(:'description_html') + self.description_html = attributes[:'description_html'] + end + + if attributes.key?(:'teacher_instructions') + self.teacher_instructions = attributes[:'teacher_instructions'] + end + + if attributes.key?(:'teacher_instructions_html') + self.teacher_instructions_html = attributes[:'teacher_instructions_html'] + end + if attributes.key?(:'attachments') if (value = attributes[:'attachments']).is_a?(Array) self.attachments = value @@ -197,6 +271,14 @@ def initialize(attributes = {}) self.nb_playback_authorized = attributes[:'nb_playback_authorized'] end + if attributes.key?(:'restrict_play_note') + self.restrict_play_note = attributes[:'restrict_play_note'] + end + + if attributes.key?(:'restrict_to_audio_tracks') + self.restrict_to_audio_tracks = attributes[:'restrict_to_audio_tracks'] + end + if attributes.key?(:'toolset') self.toolset = attributes[:'toolset'] end @@ -221,6 +303,30 @@ def initialize(attributes = {}) self.shuffle_exercises = attributes[:'shuffle_exercises'] end + if attributes.key?(:'submission_students_mode') + self.submission_students_mode = attributes[:'submission_students_mode'] + end + + if attributes.key?(:'recording_type') + self.recording_type = attributes[:'recording_type'] + end + + if attributes.key?(:'allow_metronome') + self.allow_metronome = attributes[:'allow_metronome'] + end + + if attributes.key?(:'allow_backing_track') + self.allow_backing_track = attributes[:'allow_backing_track'] + end + + if attributes.key?(:'allow_speed_change') + self.allow_speed_change = attributes[:'allow_speed_change'] + end + + if attributes.key?(:'free_record') + self.free_record = attributes[:'free_record'] + end + if attributes.key?(:'state') self.state = attributes[:'state'] end @@ -250,6 +356,12 @@ def initialize(attributes = {}) self.assigned_students = value end end + + if attributes.key?(:'class_group_ids') + if (value = attributes[:'class_group_ids']).is_a?(Array) + self.class_group_ids = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -262,7 +374,23 @@ def list_invalid_properties end if !@title.nil? && @title.to_s.length < 1 - invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.') + invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 1.') + end + + if !@description.nil? && @description.to_s.length > 100000 + invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 100000.') + end + + if !@description_html.nil? && @description_html.to_s.length > 20000000 + invalid_properties.push('invalid value for "description_html", the character length must be smaller than or equal to 20000000.') + end + + if !@teacher_instructions.nil? && @teacher_instructions.to_s.length > 100000 + invalid_properties.push('invalid value for "teacher_instructions", the character length must be smaller than or equal to 100000.') + end + + if !@teacher_instructions_html.nil? && @teacher_instructions_html.to_s.length > 20000000 + invalid_properties.push('invalid value for "teacher_instructions_html", the character length must be smaller than or equal to 20000000.') end if !@max_points.nil? && @max_points > 10000 @@ -282,10 +410,16 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@title.nil? && @title.to_s.length > 1000 return false if !@title.nil? && @title.to_s.length < 1 + return false if !@description.nil? && @description.to_s.length > 100000 + return false if !@description_html.nil? && @description_html.to_s.length > 20000000 + return false if !@teacher_instructions.nil? && @teacher_instructions.to_s.length > 100000 + return false if !@teacher_instructions_html.nil? && @teacher_instructions_html.to_s.length > 20000000 return false if !@max_points.nil? && @max_points > 10000 return false if !@max_points.nil? && @max_points < 0 release_grades_validator = EnumAttributeValidator.new('String', ["auto", "manual"]) return false unless release_grades_validator.valid?(@release_grades) + recording_type_validator = EnumAttributeValidator.new('String', ["audio", "video"]) + return false unless recording_type_validator.valid?(@recording_type) state_validator = EnumAttributeValidator.new('String', ["draft", "active"]) return false unless state_validator.valid?(@state) assignee_mode_validator = EnumAttributeValidator.new('String', ["everyone", "selected"]) @@ -305,20 +439,80 @@ def title=(title) end if title.to_s.length < 1 - fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.' + fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 1.' end @title = title end + # Custom attribute writer method with validation + # @param [Object] description Value to be assigned + def description=(description) + if description.nil? + fail ArgumentError, 'description cannot be nil' + end + + if description.to_s.length > 100000 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 100000.' + end + + @description = description + end + + # Custom attribute writer method with validation + # @param [Object] description_html Value to be assigned + def description_html=(description_html) + if description_html.nil? + fail ArgumentError, 'description_html cannot be nil' + end + + if description_html.to_s.length > 20000000 + fail ArgumentError, 'invalid value for "description_html", the character length must be smaller than or equal to 20000000.' + end + + @description_html = description_html + end + + # Custom attribute writer method with validation + # @param [Object] teacher_instructions Value to be assigned + def teacher_instructions=(teacher_instructions) + if teacher_instructions.nil? + fail ArgumentError, 'teacher_instructions cannot be nil' + end + + if teacher_instructions.to_s.length > 100000 + fail ArgumentError, 'invalid value for "teacher_instructions", the character length must be smaller than or equal to 100000.' + end + + @teacher_instructions = teacher_instructions + end + + # Custom attribute writer method with validation + # @param [Object] teacher_instructions_html Value to be assigned + def teacher_instructions_html=(teacher_instructions_html) + if teacher_instructions_html.nil? + fail ArgumentError, 'teacher_instructions_html cannot be nil' + end + + if teacher_instructions_html.to_s.length > 20000000 + fail ArgumentError, 'invalid value for "teacher_instructions_html", the character length must be smaller than or equal to 20000000.' + end + + @teacher_instructions_html = teacher_instructions_html + end + # Custom attribute writer method with validation # @param [Object] max_points Value to be assigned def max_points=(max_points) - if !max_points.nil? && max_points > 10000 + if max_points.nil? + fail ArgumentError, 'max_points cannot be nil' + end + + if max_points > 10000 fail ArgumentError, 'invalid value for "max_points", must be smaller than or equal to 10000.' end - if !max_points.nil? && max_points < 0 + if max_points < 0 fail ArgumentError, 'invalid value for "max_points", must be greater than or equal to 0.' end @@ -335,6 +529,16 @@ def release_grades=(release_grades) @release_grades = release_grades end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] recording_type Object to be assigned + def recording_type=(recording_type) + validator = EnumAttributeValidator.new('String', ["audio", "video"]) + unless validator.valid?(recording_type) + fail ArgumentError, "invalid value for \"recording_type\", must be one of #{validator.allowable_values}." + end + @recording_type = recording_type + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] state Object to be assigned def state=(state) @@ -363,21 +567,33 @@ def ==(o) type == o.type && title == o.title && description == o.description && + description_html == o.description_html && + teacher_instructions == o.teacher_instructions && + teacher_instructions_html == o.teacher_instructions_html && attachments == o.attachments && nb_playback_authorized == o.nb_playback_authorized && + restrict_play_note == o.restrict_play_note && + restrict_to_audio_tracks == o.restrict_to_audio_tracks && toolset == o.toolset && cover_file == o.cover_file && cover == o.cover && max_points == o.max_points && release_grades == o.release_grades && shuffle_exercises == o.shuffle_exercises && + submission_students_mode == o.submission_students_mode && + recording_type == o.recording_type && + allow_metronome == o.allow_metronome && + allow_backing_track == o.allow_backing_track && + allow_speed_change == o.allow_speed_change && + free_record == o.free_record && state == o.state && due_date == o.due_date && scheduled_date == o.scheduled_date && google_classroom == o.google_classroom && microsoft_graph == o.microsoft_graph && assignee_mode == o.assignee_mode && - assigned_students == o.assigned_students + assigned_students == o.assigned_students && + class_group_ids == o.class_group_ids end # @see the `==` method @@ -389,7 +605,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, title, description, attachments, nb_playback_authorized, toolset, cover_file, cover, max_points, release_grades, shuffle_exercises, state, due_date, scheduled_date, google_classroom, microsoft_graph, assignee_mode, assigned_students].hash + [type, title, description, description_html, teacher_instructions, teacher_instructions_html, attachments, nb_playback_authorized, restrict_play_note, restrict_to_audio_tracks, toolset, cover_file, cover, max_points, release_grades, shuffle_exercises, submission_students_mode, recording_type, allow_metronome, allow_backing_track, allow_speed_change, free_record, state, due_date, scheduled_date, google_classroom, microsoft_graph, assignee_mode, assigned_students, class_group_ids].hash end # Builds the object from hash @@ -415,61 +631,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -486,24 +647,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_assignment_update_all_of_google_classroom.rb b/lib/flat_api/models/class_assignment_update_all_of_google_classroom.rb index e87b901..089d22d 100644 --- a/lib/flat_api/models/class_assignment_update_all_of_google_classroom.rb +++ b/lib/flat_api/models/class_assignment_update_all_of_google_classroom.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Google Classroom options for this assignment - class ClassAssignmentUpdateAllOfGoogleClassroom + class ClassAssignmentUpdateAllOfGoogleClassroom < ApiModelBase # Identifier of the topic where the assignment is created attr_accessor :topic_id @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -53,9 +58,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentUpdateAllOfGoogleClassroom`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentUpdateAllOfGoogleClassroom`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -123,61 +129,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -194,24 +145,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_assignment_update_all_of_microsoft_graph.rb b/lib/flat_api/models/class_assignment_update_all_of_microsoft_graph.rb index 3e9769f..7301387 100644 --- a/lib/flat_api/models/class_assignment_update_all_of_microsoft_graph.rb +++ b/lib/flat_api/models/class_assignment_update_all_of_microsoft_graph.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Microsoft Graph options for this assignment - class ClassAssignmentUpdateAllOfMicrosoftGraph + class ClassAssignmentUpdateAllOfMicrosoftGraph < ApiModelBase # List of categories this assignment belongs to attr_accessor :categories @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -53,9 +58,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentUpdateAllOfMicrosoftGraph`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAssignmentUpdateAllOfMicrosoftGraph`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -125,61 +131,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -196,24 +147,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_attachment_creation.rb b/lib/flat_api/models/class_attachment_creation.rb index ec06df7..46a0a2d 100644 --- a/lib/flat_api/models/class_attachment_creation.rb +++ b/lib/flat_api/models/class_attachment_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # 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. - class ClassAttachmentCreation + class ClassAttachmentCreation < ApiModelBase # 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. attr_accessor :type @@ -25,6 +25,12 @@ class ClassAttachmentCreation # An unique worksheet identifier attr_accessor :worksheet + # An unique revision identifier of a score + attr_accessor :revision + + # The UUID of the instrument part selected for this attachment (for performance submissions) + attr_accessor :part_uuid + attr_accessor :sharing_mode # 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. @@ -36,6 +42,9 @@ class ClassAttachmentCreation # The ID of the Google Drive File attr_accessor :google_drive_file_id + # Flag indicating if this attachment should only be visible to teachers + attr_accessor :teacher_only + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -64,16 +73,24 @@ def self.attribute_map :'type' => :'type', :'score' => :'score', :'worksheet' => :'worksheet', + :'revision' => :'revision', + :'part_uuid' => :'partUuid', :'sharing_mode' => :'sharingMode', :'lock_score_template' => :'lockScoreTemplate', :'url' => :'url', - :'google_drive_file_id' => :'googleDriveFileId' + :'google_drive_file_id' => :'googleDriveFileId', + :'teacher_only' => :'teacherOnly' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -82,10 +99,13 @@ def self.openapi_types :'type' => :'String', :'score' => :'String', :'worksheet' => :'String', + :'revision' => :'String', + :'part_uuid' => :'String', :'sharing_mode' => :'MediaScoreSharingMode', :'lock_score_template' => :'Boolean', :'url' => :'String', - :'google_drive_file_id' => :'String' + :'google_drive_file_id' => :'String', + :'teacher_only' => :'Boolean' } end @@ -103,9 +123,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAttachmentCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassAttachmentCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -122,6 +143,14 @@ def initialize(attributes = {}) self.worksheet = attributes[:'worksheet'] end + if attributes.key?(:'revision') + self.revision = attributes[:'revision'] + end + + if attributes.key?(:'part_uuid') + self.part_uuid = attributes[:'part_uuid'] + end + if attributes.key?(:'sharing_mode') self.sharing_mode = attributes[:'sharing_mode'] else @@ -139,6 +168,12 @@ def initialize(attributes = {}) if attributes.key?(:'google_drive_file_id') self.google_drive_file_id = attributes[:'google_drive_file_id'] end + + if attributes.key?(:'teacher_only') + self.teacher_only = attributes[:'teacher_only'] + else + self.teacher_only = false + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -153,7 +188,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet", "performance"]) + type_validator = EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet"]) return false unless type_validator.valid?(@type) true end @@ -161,7 +196,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet", "performance"]) + validator = EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -176,10 +211,13 @@ def ==(o) type == o.type && score == o.score && worksheet == o.worksheet && + revision == o.revision && + part_uuid == o.part_uuid && sharing_mode == o.sharing_mode && lock_score_template == o.lock_score_template && url == o.url && - google_drive_file_id == o.google_drive_file_id + google_drive_file_id == o.google_drive_file_id && + teacher_only == o.teacher_only end # @see the `==` method @@ -191,7 +229,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, score, worksheet, sharing_mode, lock_score_template, url, google_drive_file_id].hash + [type, score, worksheet, revision, part_uuid, sharing_mode, lock_score_template, url, google_drive_file_id, teacher_only].hash end # Builds the object from hash @@ -217,61 +255,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -288,24 +271,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_creation.rb b/lib/flat_api/models/class_creation.rb index a6a8b9a..59f5507 100644 --- a/lib/flat_api/models/class_creation.rb +++ b/lib/flat_api/models/class_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Creation of a classroom - class ClassCreation + class ClassCreation < ApiModelBase # The name of the new class attr_accessor :name @@ -63,9 +63,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -94,9 +99,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -246,61 +252,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -317,24 +268,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details.rb b/lib/flat_api/models/class_details.rb index dec9e8e..d250543 100644 --- a/lib/flat_api/models/class_details.rb +++ b/lib/flat_api/models/class_details.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A classroom - class ClassDetails + class ClassDetails < ApiModelBase # The unique identifier of the class attr_accessor :id @@ -39,6 +39,9 @@ class ClassDetails # The date when the class was create attr_accessor :creation_date + # The date when the class was last modified + attr_accessor :modification_date + # [Teachers only] The enrollment code that can be used by the students to join the class attr_accessor :enrollment_code @@ -109,6 +112,7 @@ def self.attribute_map :'organization' => :'organization', :'owner' => :'owner', :'creation_date' => :'creationDate', + :'modification_date' => :'modificationDate', :'enrollment_code' => :'enrollmentCode', :'theme' => :'theme', :'assignments_count' => :'assignmentsCount', @@ -128,9 +132,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -144,6 +153,7 @@ def self.openapi_types :'organization' => :'String', :'owner' => :'String', :'creation_date' => :'Time', + :'modification_date' => :'Time', :'enrollment_code' => :'String', :'theme' => :'String', :'assignments_count' => :'Float', @@ -178,9 +188,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -193,10 +204,14 @@ def initialize(attributes = {}) if attributes.key?(:'state') self.state = attributes[:'state'] + else + self.state = nil end if attributes.key?(:'name') self.name = attributes[:'name'] + else + self.name = nil end if attributes.key?(:'section') @@ -217,6 +232,12 @@ def initialize(attributes = {}) if attributes.key?(:'creation_date') self.creation_date = attributes[:'creation_date'] + else + self.creation_date = nil + end + + if attributes.key?(:'modification_date') + self.modification_date = attributes[:'modification_date'] end if attributes.key?(:'enrollment_code') @@ -295,6 +316,18 @@ def list_invalid_properties invalid_properties.push('invalid value for "id", id cannot be nil.') end + if @state.nil? + invalid_properties.push('invalid value for "state", state cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @creation_date.nil? + invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') + end + invalid_properties end @@ -303,9 +336,52 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? + return false if @state.nil? + return false if @name.nil? + return false if @creation_date.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] state Value to be assigned + def state=(state) + if state.nil? + fail ArgumentError, 'state cannot be nil' + end + + @state = state + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -319,6 +395,7 @@ def ==(o) organization == o.organization && owner == o.owner && creation_date == o.creation_date && + modification_date == o.modification_date && enrollment_code == o.enrollment_code && theme == o.theme && assignments_count == o.assignments_count && @@ -346,7 +423,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, state, name, section, description, organization, owner, creation_date, enrollment_code, theme, assignments_count, students_group, teachers_group, issues, google_classroom, google_drive, microsoft_graph, lti, canvas, mfc, clever, level, skills_focused, size].hash + [id, state, name, section, description, organization, owner, creation_date, modification_date, enrollment_code, theme, assignments_count, students_group, teachers_group, issues, google_classroom, google_drive, microsoft_graph, lti, canvas, mfc, clever, level, skills_focused, size].hash end # Builds the object from hash @@ -372,61 +449,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -443,24 +465,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details_canvas.rb b/lib/flat_api/models/class_details_canvas.rb index 9aa79c8..b700b24 100644 --- a/lib/flat_api/models/class_details_canvas.rb +++ b/lib/flat_api/models/class_details_canvas.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Meta information provided by Canvs LMS - class ClassDetailsCanvas + class ClassDetailsCanvas < ApiModelBase # Unique identifier of the course on Canvas attr_accessor :id @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsCanvas`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsCanvas`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,61 +138,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -203,24 +154,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details_clever.rb b/lib/flat_api/models/class_details_clever.rb index 58ed4a0..19f9a43 100644 --- a/lib/flat_api/models/class_details_clever.rb +++ b/lib/flat_api/models/class_details_clever.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Clever.com section-related information - class ClassDetailsClever + class ClassDetailsClever < ApiModelBase # Clever section unique identifier attr_accessor :id @@ -72,9 +72,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -104,9 +109,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsClever`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsClever`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -216,61 +222,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -287,24 +238,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details_google_classroom.rb b/lib/flat_api/models/class_details_google_classroom.rb index 2ba6639..e649c46 100644 --- a/lib/flat_api/models/class_details_google_classroom.rb +++ b/lib/flat_api/models/class_details_google_classroom.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Google Classroom course-related information - class ClassDetailsGoogleClassroom + class ClassDetailsGoogleClassroom < ApiModelBase # The course identifier on Google Classroom attr_accessor :id @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsGoogleClassroom`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsGoogleClassroom`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,61 +138,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -203,24 +154,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details_google_drive.rb b/lib/flat_api/models/class_details_google_drive.rb index cc3eb41..0a70758 100644 --- a/lib/flat_api/models/class_details_google_drive.rb +++ b/lib/flat_api/models/class_details_google_drive.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Google Drive course-related information provided by Google Classroom - class ClassDetailsGoogleDrive + class ClassDetailsGoogleDrive < ApiModelBase # [Teachers only] The Drive directory identifier of the teachers' folder attr_accessor :teacher_folder_id @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsGoogleDrive`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsGoogleDrive`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,61 +138,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -203,24 +154,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details_issues.rb b/lib/flat_api/models/class_details_issues.rb index 27cc5df..5b35789 100644 --- a/lib/flat_api/models/class_details_issues.rb +++ b/lib/flat_api/models/class_details_issues.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Detected issues for this class - class ClassDetailsIssues + class ClassDetailsIssues < ApiModelBase # Synchronization issues for the class attr_accessor :sync @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -52,9 +57,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsIssues`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsIssues`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -124,61 +130,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -195,24 +146,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details_issues_sync_inner.rb b/lib/flat_api/models/class_details_issues_sync_inner.rb index 7365c0d..d60656d 100644 --- a/lib/flat_api/models/class_details_issues_sync_inner.rb +++ b/lib/flat_api/models/class_details_issues_sync_inner.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A sync issue - class ClassDetailsIssuesSyncInner + class ClassDetailsIssuesSyncInner < ApiModelBase # The account user identifier attr_accessor :id @@ -56,9 +56,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -84,9 +89,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsIssuesSyncInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsIssuesSyncInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -116,7 +122,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - reason_validator = EnumAttributeValidator.new('String', ["otherOrgnanization", "personalSubscription"]) + reason_validator = EnumAttributeValidator.new('String', ["otherOrgnanization", "productMigration", "disabledAccount"]) return false unless reason_validator.valid?(@reason) true end @@ -124,7 +130,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] reason Object to be assigned def reason=(reason) - validator = EnumAttributeValidator.new('String', ["otherOrgnanization", "personalSubscription"]) + validator = EnumAttributeValidator.new('String', ["otherOrgnanization", "productMigration", "disabledAccount"]) unless validator.valid?(reason) fail ArgumentError, "invalid value for \"reason\", must be one of #{validator.allowable_values}." end @@ -176,61 +182,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -247,24 +198,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details_lti.rb b/lib/flat_api/models/class_details_lti.rb index 8441bb2..6ec260c 100644 --- a/lib/flat_api/models/class_details_lti.rb +++ b/lib/flat_api/models/class_details_lti.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,8 +14,8 @@ require 'time' module FlatApi - # Meta information provided by the LTI consumer - class ClassDetailsLti + # Info about LTI context (1.1 and 1.3) + class ClassDetailsLti < ApiModelBase # Unique context identifier provided attr_accessor :context_id @@ -25,18 +25,27 @@ class ClassDetailsLti # Context label attr_accessor :context_label + # If true, the class has been synchronized with the LTI 1.3 NRPS 2.0 service + attr_accessor :has_nrps_service + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'context_id' => :'contextId', :'context_title' => :'contextTitle', - :'context_label' => :'contextLabel' + :'context_label' => :'contextLabel', + :'has_nrps_service' => :'hasNrpsService' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -44,7 +53,8 @@ def self.openapi_types { :'context_id' => :'String', :'context_title' => :'String', - :'context_label' => :'String' + :'context_label' => :'String', + :'has_nrps_service' => :'Boolean' } end @@ -62,9 +72,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsLti`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsLti`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -80,6 +91,10 @@ def initialize(attributes = {}) if attributes.key?(:'context_label') self.context_label = attributes[:'context_label'] end + + if attributes.key?(:'has_nrps_service') + self.has_nrps_service = attributes[:'has_nrps_service'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -104,7 +119,8 @@ def ==(o) self.class == o.class && context_id == o.context_id && context_title == o.context_title && - context_label == o.context_label + context_label == o.context_label && + has_nrps_service == o.has_nrps_service end # @see the `==` method @@ -116,7 +132,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [context_id, context_title, context_label].hash + [context_id, context_title, context_label, has_nrps_service].hash end # Builds the object from hash @@ -142,61 +158,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -213,24 +174,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details_mfc.rb b/lib/flat_api/models/class_details_mfc.rb index 6e89a77..80a27f0 100644 --- a/lib/flat_api/models/class_details_mfc.rb +++ b/lib/flat_api/models/class_details_mfc.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Meta information provided by Canvs LMS - class ClassDetailsMfc + class ClassDetailsMfc < ApiModelBase # Unique identifier of the course on MusicFirst Classroom attr_accessor :id @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsMfc`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsMfc`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,61 +138,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -203,24 +154,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_details_microsoft_graph.rb b/lib/flat_api/models/class_details_microsoft_graph.rb index 5c21bdd..fa0eedb 100644 --- a/lib/flat_api/models/class_details_microsoft_graph.rb +++ b/lib/flat_api/models/class_details_microsoft_graph.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class ClassDetailsMicrosoftGraph + class ClassDetailsMicrosoftGraph < ApiModelBase # The course identifier on Microsoft Graph attr_accessor :id @@ -25,9 +25,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -51,9 +56,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsMicrosoftGraph`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassDetailsMicrosoftGraph`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -121,61 +127,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -192,24 +143,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/class_grade_level.rb b/lib/flat_api/models/class_grade_level.rb index 63e1e62..ea435fa 100644 --- a/lib/flat_api/models/class_grade_level.rb +++ b/lib/flat_api/models/class_grade_level.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/class_roles.rb b/lib/flat_api/models/class_roles.rb index 0cadcb0..8987f6e 100644 --- a/lib/flat_api/models/class_roles.rb +++ b/lib/flat_api/models/class_roles.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/class_state.rb b/lib/flat_api/models/class_state.rb index 34d0508..b61f569 100644 --- a/lib/flat_api/models/class_state.rb +++ b/lib/flat_api/models/class_state.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -18,9 +18,10 @@ class ClassState ACTIVE = "active".freeze INACTIVE = "inactive".freeze ARCHIVED = "archived".freeze + DELETED = "deleted".freeze def self.all_vars - @all_vars ||= [ACTIVE, INACTIVE, ARCHIVED].freeze + @all_vars ||= [ACTIVE, INACTIVE, ARCHIVED, DELETED].freeze end # Builds the enum from string diff --git a/lib/flat_api/models/class_update.rb b/lib/flat_api/models/class_update.rb index 1a5c0fc..067d566 100644 --- a/lib/flat_api/models/class_update.rb +++ b/lib/flat_api/models/class_update.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Update of a classroom - class ClassUpdate + class ClassUpdate < ApiModelBase # The name of the class attr_accessor :name @@ -63,9 +63,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -94,9 +99,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ClassUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -239,61 +245,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -310,24 +261,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/collection.rb b/lib/flat_api/models/collection.rb index 60ba206..12a7e70 100644 --- a/lib/flat_api/models/collection.rb +++ b/lib/flat_api/models/collection.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Collection of scores - class Collection + class Collection < ApiModelBase # Unique identifier of the collection attr_accessor :id @@ -27,6 +27,9 @@ class Collection attr_accessor :type + # 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. + attr_accessor :label_key + attr_accessor :privacy # The private sharing key of the collection (available when the `privacy` mode is set to `privateLink`) @@ -37,6 +40,9 @@ class Collection # The date when the collection was created attr_accessor :creation_date + # The date when the collection was last modified + attr_accessor :modification_date + attr_accessor :user # If the score has been created in an organization, the identifier of this organization. @@ -47,6 +53,11 @@ class Collection # The list of the collaborators of the collection attr_accessor :collaborators + # Whether the collection is pinned by the owner + attr_accessor :is_pinned + + attr_accessor :contents + attr_accessor :capabilities # 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. @@ -81,22 +92,31 @@ def self.attribute_map :'title' => :'title', :'html_url' => :'htmlUrl', :'type' => :'type', + :'label_key' => :'labelKey', :'privacy' => :'privacy', :'sharing_key' => :'sharingKey', :'app' => :'app', :'creation_date' => :'creationDate', + :'modification_date' => :'modificationDate', :'user' => :'user', :'organization' => :'organization', :'rights' => :'rights', :'collaborators' => :'collaborators', + :'is_pinned' => :'isPinned', + :'contents' => :'contents', :'capabilities' => :'capabilities', :'collections' => :'collections' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -106,14 +126,18 @@ def self.openapi_types :'title' => :'String', :'html_url' => :'String', :'type' => :'CollectionType', + :'label_key' => :'String', :'privacy' => :'CollectionPrivacy', :'sharing_key' => :'String', :'app' => :'CollectionApp', :'creation_date' => :'Time', + :'modification_date' => :'Time', :'user' => :'UserPublicSummary', :'organization' => :'String', :'rights' => :'ResourceRights', :'collaborators' => :'Array', + :'is_pinned' => :'Boolean', + :'contents' => :'CollectionContents', :'capabilities' => :'CollectionCapabilities', :'collections' => :'Array' } @@ -133,31 +157,46 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::Collection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::Collection`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'title') self.title = attributes[:'title'] + else + self.title = nil end if attributes.key?(:'html_url') self.html_url = attributes[:'html_url'] + else + self.html_url = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'label_key') + self.label_key = attributes[:'label_key'] end if attributes.key?(:'privacy') self.privacy = attributes[:'privacy'] + else + self.privacy = 'private' end if attributes.key?(:'sharing_key') @@ -170,6 +209,12 @@ def initialize(attributes = {}) if attributes.key?(:'creation_date') self.creation_date = attributes[:'creation_date'] + else + self.creation_date = nil + end + + if attributes.key?(:'modification_date') + self.modification_date = attributes[:'modification_date'] end if attributes.key?(:'user') @@ -190,6 +235,16 @@ def initialize(attributes = {}) end end + if attributes.key?(:'is_pinned') + self.is_pinned = attributes[:'is_pinned'] + end + + if attributes.key?(:'contents') + self.contents = attributes[:'contents'] + else + self.contents = nil + end + if attributes.key?(:'capabilities') self.capabilities = attributes[:'capabilities'] else @@ -208,6 +263,34 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @title.nil? + invalid_properties.push('invalid value for "title", title cannot be nil.') + end + + if @html_url.nil? + invalid_properties.push('invalid value for "html_url", html_url cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @privacy.nil? + invalid_properties.push('invalid value for "privacy", privacy cannot be nil.') + end + + if @creation_date.nil? + invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') + end + + if @contents.nil? + invalid_properties.push('invalid value for "contents", contents cannot be nil.') + end + if @capabilities.nil? invalid_properties.push('invalid value for "capabilities", capabilities cannot be nil.') end @@ -219,10 +302,97 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @title.nil? + return false if @html_url.nil? + return false if @type.nil? + return false if @privacy.nil? + return false if @creation_date.nil? + return false if @contents.nil? return false if @capabilities.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.nil? + fail ArgumentError, 'title cannot be nil' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] html_url Value to be assigned + def html_url=(html_url) + if html_url.nil? + fail ArgumentError, 'html_url cannot be nil' + end + + @html_url = html_url + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] privacy Value to be assigned + def privacy=(privacy) + if privacy.nil? + fail ArgumentError, 'privacy cannot be nil' + end + + @privacy = privacy + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method with validation + # @param [Object] contents Value to be assigned + def contents=(contents) + if contents.nil? + fail ArgumentError, 'contents cannot be nil' + end + + @contents = contents + end + + # Custom attribute writer method with validation + # @param [Object] capabilities Value to be assigned + def capabilities=(capabilities) + if capabilities.nil? + fail ArgumentError, 'capabilities cannot be nil' + end + + @capabilities = capabilities + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -232,14 +402,18 @@ def ==(o) title == o.title && html_url == o.html_url && type == o.type && + label_key == o.label_key && privacy == o.privacy && sharing_key == o.sharing_key && app == o.app && creation_date == o.creation_date && + modification_date == o.modification_date && user == o.user && organization == o.organization && rights == o.rights && collaborators == o.collaborators && + is_pinned == o.is_pinned && + contents == o.contents && capabilities == o.capabilities && collections == o.collections end @@ -253,7 +427,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, title, html_url, type, privacy, sharing_key, app, creation_date, user, organization, rights, collaborators, capabilities, collections].hash + [id, title, html_url, type, label_key, privacy, sharing_key, app, creation_date, modification_date, user, organization, rights, collaborators, is_pinned, contents, capabilities, collections].hash end # Builds the object from hash @@ -279,61 +453,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -350,24 +469,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/collection_app.rb b/lib/flat_api/models/collection_app.rb index be3b36a..6fddfe8 100644 --- a/lib/flat_api/models/collection_app.rb +++ b/lib/flat_api/models/collection_app.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # For App collections, the details of the app that created the collection - class CollectionApp + class CollectionApp < ApiModelBase # The app unique identifier attr_accessor :id @@ -34,9 +34,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -62,9 +67,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CollectionApp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CollectionApp`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -142,61 +148,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -213,24 +164,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/collection_capabilities.rb b/lib/flat_api/models/collection_capabilities.rb index 9252fd2..9a6d44f 100644 --- a/lib/flat_api/models/collection_capabilities.rb +++ b/lib/flat_api/models/collection_capabilities.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Capabilities the current user has on this collection. Each capability corresponds to a fine-grained action that a user may take. - class CollectionCapabilities + class CollectionCapabilities < ApiModelBase # Whether the current user can modify the metadata for the collection attr_accessor :can_edit @@ -42,9 +42,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -72,9 +77,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CollectionCapabilities`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CollectionCapabilities`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -150,6 +156,56 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] can_edit Value to be assigned + def can_edit=(can_edit) + if can_edit.nil? + fail ArgumentError, 'can_edit cannot be nil' + end + + @can_edit = can_edit + end + + # Custom attribute writer method with validation + # @param [Object] can_share Value to be assigned + def can_share=(can_share) + if can_share.nil? + fail ArgumentError, 'can_share cannot be nil' + end + + @can_share = can_share + end + + # Custom attribute writer method with validation + # @param [Object] can_delete Value to be assigned + def can_delete=(can_delete) + if can_delete.nil? + fail ArgumentError, 'can_delete cannot be nil' + end + + @can_delete = can_delete + end + + # Custom attribute writer method with validation + # @param [Object] can_add_scores Value to be assigned + def can_add_scores=(can_add_scores) + if can_add_scores.nil? + fail ArgumentError, 'can_add_scores cannot be nil' + end + + @can_add_scores = can_add_scores + end + + # Custom attribute writer method with validation + # @param [Object] can_delete_scores Value to be assigned + def can_delete_scores=(can_delete_scores) + if can_delete_scores.nil? + fail ArgumentError, 'can_delete_scores cannot be nil' + end + + @can_delete_scores = can_delete_scores + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -197,61 +253,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -268,24 +269,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/collection_contents.rb b/lib/flat_api/models/collection_contents.rb new file mode 100644 index 0000000..88e9c5c --- /dev/null +++ b/lib/flat_api/models/collection_contents.rb @@ -0,0 +1,166 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # The contents of the collection + class CollectionContents < ApiModelBase + # The number of scores in the collection + attr_accessor :scores_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'scores_count' => :'scoresCount' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'scores_count' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::CollectionContents` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CollectionContents`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'scores_count') + self.scores_count = attributes[:'scores_count'] + else + self.scores_count = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @scores_count.nil? + invalid_properties.push('invalid value for "scores_count", scores_count cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @scores_count.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] scores_count Value to be assigned + def scores_count=(scores_count) + if scores_count.nil? + fail ArgumentError, 'scores_count cannot be nil' + end + + @scores_count = scores_count + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + scores_count == o.scores_count + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [scores_count].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/collection_creation.rb b/lib/flat_api/models/collection_creation.rb index a05d685..f6c088e 100644 --- a/lib/flat_api/models/collection_creation.rb +++ b/lib/flat_api/models/collection_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class CollectionCreation + class CollectionCreation < ApiModelBase # The title of the collection attr_accessor :title @@ -50,9 +50,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -77,23 +82,22 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CollectionCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CollectionCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'title') self.title = attributes[:'title'] - else - self.title = nil end if attributes.key?(:'privacy') self.privacy = attributes[:'privacy'] else - self.privacy = nil + self.privacy = 'private' end end @@ -102,20 +106,12 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @title.nil? - invalid_properties.push('invalid value for "title", title cannot be nil.') - end - - if @title.to_s.length > 300 + if !@title.nil? && @title.to_s.length > 300 invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 300.') end - if @title.to_s.length < 1 - invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.') - end - - if @privacy.nil? - invalid_properties.push('invalid value for "privacy", privacy cannot be nil.') + if !@title.nil? && @title.to_s.length < 1 + invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 1.') end invalid_properties @@ -125,10 +121,8 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @title.nil? - return false if @title.to_s.length > 300 - return false if @title.to_s.length < 1 - return false if @privacy.nil? + return false if !@title.nil? && @title.to_s.length > 300 + return false if !@title.nil? && @title.to_s.length < 1 true end @@ -144,7 +138,7 @@ def title=(title) end if title.to_s.length < 1 - fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.' + fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 1.' end @title = title @@ -194,61 +188,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -265,24 +204,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/collection_modification.rb b/lib/flat_api/models/collection_modification.rb index 5c2f2e4..785abc5 100644 --- a/lib/flat_api/models/collection_modification.rb +++ b/lib/flat_api/models/collection_modification.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Edit the collection metadata - class CollectionModification + class CollectionModification < ApiModelBase # The title of the collection attr_accessor :title @@ -51,9 +51,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -78,9 +83,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CollectionModification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CollectionModification`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -91,6 +97,8 @@ def initialize(attributes = {}) if attributes.key?(:'privacy') self.privacy = attributes[:'privacy'] + else + self.privacy = 'private' end end @@ -104,7 +112,7 @@ def list_invalid_properties end if !@title.nil? && @title.to_s.length < 1 - invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.') + invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 1.') end invalid_properties @@ -131,7 +139,7 @@ def title=(title) end if title.to_s.length < 1 - fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.' + fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 1.' end @title = title @@ -181,61 +189,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -252,24 +205,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/collection_privacy.rb b/lib/flat_api/models/collection_privacy.rb index 115264b..4462674 100644 --- a/lib/flat_api/models/collection_privacy.rb +++ b/lib/flat_api/models/collection_privacy.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/collection_type.rb b/lib/flat_api/models/collection_type.rb index dd5e7dd..9d52def 100644 --- a/lib/flat_api/models/collection_type.rb +++ b/lib/flat_api/models/collection_type.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -17,13 +17,14 @@ module FlatApi class CollectionType ROOT = "root".freeze REGULAR = "regular".freeze - SHARED_WITH_ME = "sharedWithMe".freeze - SHARED_WITH_GROUP = "sharedWithGroup".freeze APP = "app".freeze TRASH = "trash".freeze + ALL_SCORES = "allScores".freeze + COLLABORATIONS = "collaborations".freeze + LIKES = "likes".freeze def self.all_vars - @all_vars ||= [ROOT, REGULAR, SHARED_WITH_ME, SHARED_WITH_GROUP, APP, TRASH].freeze + @all_vars ||= [ROOT, REGULAR, APP, TRASH, ALL_SCORES, COLLABORATIONS, LIKES].freeze end # Builds the enum from string diff --git a/lib/flat_api/models/credit_transaction.rb b/lib/flat_api/models/credit_transaction.rb new file mode 100644 index 0000000..b5efb83 --- /dev/null +++ b/lib/flat_api/models/credit_transaction.rb @@ -0,0 +1,388 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # A single credit ledger entry + class CreditTransaction < ApiModelBase + # Unique identifier of the credit transaction + attr_accessor :id + + # Credit category. `ai` covers every AI-powered feature. + attr_accessor :type + + # 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. + attr_accessor :feature + + # 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`. + attr_accessor :amount + + # 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`. + attr_accessor :source + + # 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. + attr_accessor :state + + # 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. + attr_accessor :job + + # When the transaction was created + attr_accessor :creation_date + + # When the transaction was last modified + attr_accessor :modification_date + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'feature' => :'feature', + :'amount' => :'amount', + :'source' => :'source', + :'state' => :'state', + :'job' => :'job', + :'creation_date' => :'creationDate', + :'modification_date' => :'modificationDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String', + :'feature' => :'String', + :'amount' => :'Integer', + :'source' => :'String', + :'state' => :'String', + :'job' => :'String', + :'creation_date' => :'Time', + :'modification_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::CreditTransaction` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::CreditTransaction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'feature') + self.feature = attributes[:'feature'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + else + self.amount = nil + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + else + self.source = nil + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + else + self.state = nil + end + + if attributes.key?(:'job') + self.job = attributes[:'job'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + else + self.creation_date = nil + end + + if attributes.key?(:'modification_date') + self.modification_date = attributes[:'modification_date'] + else + self.modification_date = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @amount.nil? + invalid_properties.push('invalid value for "amount", amount cannot be nil.') + end + + if @source.nil? + invalid_properties.push('invalid value for "source", source cannot be nil.') + end + + if @state.nil? + invalid_properties.push('invalid value for "state", state cannot be nil.') + end + + if @creation_date.nil? + invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') + end + + if @modification_date.nil? + invalid_properties.push('invalid value for "modification_date", modification_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('String', ["ai"]) + return false unless type_validator.valid?(@type) + feature_validator = EnumAttributeValidator.new('String', ["omr"]) + return false unless feature_validator.valid?(@feature) + return false if @amount.nil? + return false if @source.nil? + source_validator = EnumAttributeValidator.new('String', ["subscription", "purchase", "free_tier", "support"]) + return false unless source_validator.valid?(@source) + return false if @state.nil? + state_validator = EnumAttributeValidator.new('String', ["active", "canceled"]) + return false unless state_validator.valid?(@state) + return false if @creation_date.nil? + return false if @modification_date.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["ai"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] feature Object to be assigned + def feature=(feature) + validator = EnumAttributeValidator.new('String', ["omr"]) + unless validator.valid?(feature) + fail ArgumentError, "invalid value for \"feature\", must be one of #{validator.allowable_values}." + end + @feature = feature + end + + # Custom attribute writer method with validation + # @param [Object] amount Value to be assigned + def amount=(amount) + if amount.nil? + fail ArgumentError, 'amount cannot be nil' + end + + @amount = amount + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] source Object to be assigned + def source=(source) + validator = EnumAttributeValidator.new('String', ["subscription", "purchase", "free_tier", "support"]) + unless validator.valid?(source) + fail ArgumentError, "invalid value for \"source\", must be one of #{validator.allowable_values}." + end + @source = source + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] state Object to be assigned + def state=(state) + validator = EnumAttributeValidator.new('String', ["active", "canceled"]) + unless validator.valid?(state) + fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}." + end + @state = state + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method with validation + # @param [Object] modification_date Value to be assigned + def modification_date=(modification_date) + if modification_date.nil? + fail ArgumentError, 'modification_date cannot be nil' + end + + @modification_date = modification_date + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + feature == o.feature && + amount == o.amount && + source == o.source && + state == o.state && + job == o.job && + creation_date == o.creation_date && + modification_date == o.modification_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, type, feature, amount, source, state, job, creation_date, modification_date].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/edu_library.rb b/lib/flat_api/models/edu_library.rb index ed1f776..b7f6cf8 100644 --- a/lib/flat_api/models/edu_library.rb +++ b/lib/flat_api/models/edu_library.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A Flat for Education Library - class EduLibrary + class EduLibrary < ApiModelBase # Unique identifier of the library. This one can be used to list the underlying resources using `GET /v2/eduResources?parent={library-id}` attr_accessor :id @@ -60,9 +60,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -89,27 +94,36 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduLibrary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduLibrary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] + else + self.name = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'visibility') self.visibility = attributes[:'visibility'] + else + self.visibility = nil end end @@ -118,6 +132,22 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @visibility.nil? + invalid_properties.push('invalid value for "visibility", visibility cannot be nil.') + end + invalid_properties end @@ -125,17 +155,41 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["myResources", "organizationResources", "flatEduSamples"]) + return false if @id.nil? + return false if @name.nil? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('String', ["myResources", "organizationResources", "flatEduContent"]) return false unless type_validator.valid?(@type) + return false if @visibility.nil? visibility_validator = EnumAttributeValidator.new('String', ["private", "organization", "public"]) return false unless visibility_validator.valid?(@visibility) true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["myResources", "organizationResources", "flatEduSamples"]) + validator = EnumAttributeValidator.new('String', ["myResources", "organizationResources", "flatEduContent"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -198,61 +252,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -269,24 +268,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/edu_resource.rb b/lib/flat_api/models/edu_resource.rb index 26bd497..384a7eb 100644 --- a/lib/flat_api/models/edu_resource.rb +++ b/lib/flat_api/models/edu_resource.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A Flat for Education resource contained in a resources library - class EduResource + class EduResource < ApiModelBase # Resource unique identifier attr_accessor :id @@ -35,6 +35,12 @@ class EduResource # Title of the resource attr_accessor :title + # Sharing description of this resource + attr_accessor :sharing_description + + # HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. + attr_accessor :sharing_description_html + # The date when the resource was created attr_accessor :creation_date @@ -45,6 +51,12 @@ class EduResource attr_accessor :capabilities + # The subjects of this resource, or the subjects of the resources included in the folder + attr_accessor :subjects + + # The grades of this resource, or the grades of the resources included in the folder. + attr_accessor :grades + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -77,16 +89,25 @@ def self.attribute_map :'tags' => :'tags', :'parent' => :'parent', :'title' => :'title', + :'sharing_description' => :'sharingDescription', + :'sharing_description_html' => :'sharingDescriptionHtml', :'creation_date' => :'creationDate', :'update_date' => :'updateDate', :'resource' => :'resource', - :'capabilities' => :'capabilities' + :'capabilities' => :'capabilities', + :'subjects' => :'subjects', + :'grades' => :'grades' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -99,10 +120,14 @@ def self.openapi_types :'tags' => :'Array', :'parent' => :'String', :'title' => :'String', + :'sharing_description' => :'String', + :'sharing_description_html' => :'String', :'creation_date' => :'Time', :'update_date' => :'Time', :'resource' => :'EduResourceResource', - :'capabilities' => :'EduResourceCapabilities' + :'capabilities' => :'EduResourceCapabilities', + :'subjects' => :'Array', + :'grades' => :'Array' } end @@ -120,9 +145,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -165,6 +191,14 @@ def initialize(attributes = {}) self.title = nil end + if attributes.key?(:'sharing_description') + self.sharing_description = attributes[:'sharing_description'] + end + + if attributes.key?(:'sharing_description_html') + self.sharing_description_html = attributes[:'sharing_description_html'] + end + if attributes.key?(:'creation_date') self.creation_date = attributes[:'creation_date'] end @@ -182,6 +216,18 @@ def initialize(attributes = {}) else self.capabilities = nil end + + if attributes.key?(:'subjects') + if (value = attributes[:'subjects']).is_a?(Array) + self.subjects = value + end + end + + if attributes.key?(:'grades') + if (value = attributes[:'grades']).is_a?(Array) + self.grades = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -219,6 +265,46 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.nil? + fail ArgumentError, 'title cannot be nil' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] capabilities Value to be assigned + def capabilities=(capabilities) + if capabilities.nil? + fail ArgumentError, 'capabilities cannot be nil' + end + + @capabilities = capabilities + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -231,10 +317,14 @@ def ==(o) tags == o.tags && parent == o.parent && title == o.title && + sharing_description == o.sharing_description && + sharing_description_html == o.sharing_description_html && creation_date == o.creation_date && update_date == o.update_date && resource == o.resource && - capabilities == o.capabilities + capabilities == o.capabilities && + subjects == o.subjects && + grades == o.grades end # @see the `==` method @@ -246,7 +336,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, creator, type, privacy, tags, parent, title, creation_date, update_date, resource, capabilities].hash + [id, creator, type, privacy, tags, parent, title, sharing_description, sharing_description_html, creation_date, update_date, resource, capabilities, subjects, grades].hash end # Builds the object from hash @@ -272,61 +362,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -343,24 +378,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/edu_resource_assignment_creation.rb b/lib/flat_api/models/edu_resource_assignment_creation.rb new file mode 100644 index 0000000..2843859 --- /dev/null +++ b/lib/flat_api/models/edu_resource_assignment_creation.rb @@ -0,0 +1,170 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Assignment-specific creation options. Only applicable when creating a resource with `type: assignment`. If `type` is not provided, defaults to `none`. + class EduResourceAssignmentCreation < ApiModelBase + attr_accessor :type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'AssignmentType' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::EduResourceAssignmentCreation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceAssignmentCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/edu_resource_capabilities.rb b/lib/flat_api/models/edu_resource_capabilities.rb index b4b8d2e..5ad8917 100644 --- a/lib/flat_api/models/edu_resource_capabilities.rb +++ b/lib/flat_api/models/edu_resource_capabilities.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Capabilities available for this resource - class EduResourceCapabilities + class EduResourceCapabilities < ApiModelBase # Whether the current user can modify this resource attr_accessor :can_edit @@ -25,18 +25,27 @@ class EduResourceCapabilities # Whether the current user can add folders within this resource (e.g. `folder` inside `root`) attr_accessor :can_add_folders + # Whether the current user can change the privacy of this resource (e.g. to share as `organizationPublic` or unshare it with `private`) + attr_accessor :can_change_privacy + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'can_edit' => :'canEdit', :'can_add_resources' => :'canAddResources', - :'can_add_folders' => :'canAddFolders' + :'can_add_folders' => :'canAddFolders', + :'can_change_privacy' => :'canChangePrivacy' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -44,7 +53,8 @@ def self.openapi_types { :'can_edit' => :'Boolean', :'can_add_resources' => :'Boolean', - :'can_add_folders' => :'Boolean' + :'can_add_folders' => :'Boolean', + :'can_change_privacy' => :'Boolean' } end @@ -62,9 +72,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceCapabilities`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceCapabilities`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -80,6 +91,10 @@ def initialize(attributes = {}) if attributes.key?(:'can_add_folders') self.can_add_folders = attributes[:'can_add_folders'] end + + if attributes.key?(:'can_change_privacy') + self.can_change_privacy = attributes[:'can_change_privacy'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -104,7 +119,8 @@ def ==(o) self.class == o.class && can_edit == o.can_edit && can_add_resources == o.can_add_resources && - can_add_folders == o.can_add_folders + can_add_folders == o.can_add_folders && + can_change_privacy == o.can_change_privacy end # @see the `==` method @@ -116,7 +132,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [can_edit, can_add_resources, can_add_folders].hash + [can_edit, can_add_resources, can_add_folders, can_change_privacy].hash end # Builds the object from hash @@ -142,61 +158,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -213,24 +174,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/edu_resource_copy.rb b/lib/flat_api/models/edu_resource_copy.rb index 78f8e04..a3cbefe 100644 --- a/lib/flat_api/models/edu_resource_copy.rb +++ b/lib/flat_api/models/edu_resource_copy.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Copy an education resource - class EduResourceCopy + class EduResourceCopy < ApiModelBase # 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. attr_accessor :destination @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -52,9 +57,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceCopy`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceCopy`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -86,6 +92,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] destination Value to be assigned + def destination=(destination) + if destination.nil? + fail ArgumentError, 'destination cannot be nil' + end + + @destination = destination + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -129,61 +145,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -200,24 +161,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/edu_resource_creation.rb b/lib/flat_api/models/edu_resource_creation.rb index b01568b..75c8913 100644 --- a/lib/flat_api/models/edu_resource_creation.rb +++ b/lib/flat_api/models/edu_resource_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Creation of an education resource - class EduResourceCreation + class EduResourceCreation < ApiModelBase attr_accessor :type # Title of the resource @@ -24,6 +24,14 @@ class EduResourceCreation # Identifier of the parent resource where the new one will created, e.g. a folder id or `root` attr_accessor :parent + # Sharing description of the resource + attr_accessor :sharing_description + + # HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. + attr_accessor :sharing_description_html + + attr_accessor :resource + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -51,13 +59,21 @@ def self.attribute_map { :'type' => :'type', :'title' => :'title', - :'parent' => :'parent' + :'parent' => :'parent', + :'sharing_description' => :'sharingDescription', + :'sharing_description_html' => :'sharingDescriptionHtml', + :'resource' => :'resource' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -65,7 +81,10 @@ def self.openapi_types { :'type' => :'EduResourceType', :'title' => :'String', - :'parent' => :'String' + :'parent' => :'String', + :'sharing_description' => :'String', + :'sharing_description_html' => :'String', + :'resource' => :'EduResourceAssignmentCreation' } end @@ -83,9 +102,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -107,6 +127,18 @@ def initialize(attributes = {}) else self.parent = 'root' end + + if attributes.key?(:'sharing_description') + self.sharing_description = attributes[:'sharing_description'] + end + + if attributes.key?(:'sharing_description_html') + self.sharing_description_html = attributes[:'sharing_description_html'] + end + + if attributes.key?(:'resource') + self.resource = attributes[:'resource'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -127,7 +159,15 @@ def list_invalid_properties end if @title.to_s.length < 1 - invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.') + invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 1.') + end + + if !@sharing_description.nil? && @sharing_description.to_s.length > 400 + invalid_properties.push('invalid value for "sharing_description", the character length must be smaller than or equal to 400.') + end + + if !@sharing_description_html.nil? && @sharing_description_html.to_s.length > 10000 + invalid_properties.push('invalid value for "sharing_description_html", the character length must be smaller than or equal to 10000.') end invalid_properties @@ -141,9 +181,21 @@ def valid? return false if @title.nil? return false if @title.to_s.length > 1000 return false if @title.to_s.length < 1 + return false if !@sharing_description.nil? && @sharing_description.to_s.length > 400 + return false if !@sharing_description_html.nil? && @sharing_description_html.to_s.length > 10000 true end + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + # Custom attribute writer method with validation # @param [Object] title Value to be assigned def title=(title) @@ -156,12 +208,40 @@ def title=(title) end if title.to_s.length < 1 - fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.' + fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 1.' end @title = title end + # Custom attribute writer method with validation + # @param [Object] sharing_description Value to be assigned + def sharing_description=(sharing_description) + if sharing_description.nil? + fail ArgumentError, 'sharing_description cannot be nil' + end + + if sharing_description.to_s.length > 400 + fail ArgumentError, 'invalid value for "sharing_description", the character length must be smaller than or equal to 400.' + end + + @sharing_description = sharing_description + end + + # Custom attribute writer method with validation + # @param [Object] sharing_description_html Value to be assigned + def sharing_description_html=(sharing_description_html) + if sharing_description_html.nil? + fail ArgumentError, 'sharing_description_html cannot be nil' + end + + if sharing_description_html.to_s.length > 10000 + fail ArgumentError, 'invalid value for "sharing_description_html", the character length must be smaller than or equal to 10000.' + end + + @sharing_description_html = sharing_description_html + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -169,7 +249,10 @@ def ==(o) self.class == o.class && type == o.type && title == o.title && - parent == o.parent + parent == o.parent && + sharing_description == o.sharing_description && + sharing_description_html == o.sharing_description_html && + resource == o.resource end # @see the `==` method @@ -181,7 +264,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, title, parent].hash + [type, title, parent, sharing_description, sharing_description_html, resource].hash end # Builds the object from hash @@ -207,61 +290,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -278,24 +306,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/edu_resource_folder.rb b/lib/flat_api/models/edu_resource_folder.rb index e02da94..4b9395c 100644 --- a/lib/flat_api/models/edu_resource_folder.rb +++ b/lib/flat_api/models/edu_resource_folder.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,26 +15,41 @@ module FlatApi # Education resources folder - class EduResourceFolder + class EduResourceFolder < ApiModelBase # Title of the folder attr_accessor :title + # The assignment type of the resources that are included in the folder, + attr_accessor :assignments_types + + # The number of resources inside the folder + attr_accessor :resources_count + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'title' => :'title' + :'title' => :'title', + :'assignments_types' => :'assignmentsTypes', + :'resources_count' => :'resourcesCount' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. def self.openapi_types { - :'title' => :'String' + :'title' => :'String', + :'assignments_types' => :'Array', + :'resources_count' => :'Float' } end @@ -52,9 +67,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceFolder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceFolder`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -62,6 +78,16 @@ def initialize(attributes = {}) if attributes.key?(:'title') self.title = attributes[:'title'] end + + if attributes.key?(:'assignments_types') + if (value = attributes[:'assignments_types']).is_a?(Array) + self.assignments_types = value + end + end + + if attributes.key?(:'resources_count') + self.resources_count = attributes[:'resources_count'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -84,7 +110,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - title == o.title + title == o.title && + assignments_types == o.assignments_types && + resources_count == o.resources_count end # @see the `==` method @@ -96,7 +124,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title].hash + [title, assignments_types, resources_count].hash end # Builds the object from hash @@ -122,61 +150,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -193,24 +166,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/edu_resource_lti_link.rb b/lib/flat_api/models/edu_resource_lti_link.rb index 5183539..876b1ea 100644 --- a/lib/flat_api/models/edu_resource_lti_link.rb +++ b/lib/flat_api/models/edu_resource_lti_link.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # LTI Link details for the class - class EduResourceLtiLink + class EduResourceLtiLink < ApiModelBase # An URL that can be used to launch LTI with this resource in a classroom. attr_accessor :lti_url @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -52,9 +57,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceLtiLink`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceLtiLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -86,6 +92,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] lti_url Value to be assigned + def lti_url=(lti_url) + if lti_url.nil? + fail ArgumentError, 'lti_url cannot be nil' + end + + @lti_url = lti_url + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -129,61 +145,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -200,24 +161,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/edu_resource_move.rb b/lib/flat_api/models/edu_resource_move.rb index 0d66be0..a8d3335 100644 --- a/lib/flat_api/models/edu_resource_move.rb +++ b/lib/flat_api/models/edu_resource_move.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Move an education resource - class EduResourceMove + class EduResourceMove < ApiModelBase # 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. attr_accessor :destination @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -52,9 +57,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceMove`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceMove`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -86,6 +92,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] destination Value to be assigned + def destination=(destination) + if destination.nil? + fail ArgumentError, 'destination cannot be nil' + end + + @destination = destination + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -129,61 +145,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -200,24 +161,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/edu_resource_privacy.rb b/lib/flat_api/models/edu_resource_privacy.rb index 8fae4a1..0e8613f 100644 --- a/lib/flat_api/models/edu_resource_privacy.rb +++ b/lib/flat_api/models/edu_resource_privacy.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/edu_resource_resource.rb b/lib/flat_api/models/edu_resource_resource.rb index 035695e..7885d40 100644 --- a/lib/flat_api/models/edu_resource_resource.rb +++ b/lib/flat_api/models/edu_resource_resource.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -38,8 +38,7 @@ def build(data) openapi_one_of.each do |klass| begin next if klass == :AnyType # "nullable: true" - typed_data = find_and_cast_into_type(klass, data) - return typed_data if typed_data + return find_and_cast_into_type(klass, data) rescue # rescue all errors so we keep iterating even if the current item lookup raises end end @@ -65,7 +64,7 @@ def find_and_cast_into_type(klass, data) when 'Time' return Time.parse(data) when 'Date' - return Date.parse(data) + return Date.iso8601(data) when 'String' return data if data.instance_of?(String) when 'Object' # "type: object" diff --git a/lib/flat_api/models/edu_resource_type.rb b/lib/flat_api/models/edu_resource_type.rb index 12f23da..aa14b5d 100644 --- a/lib/flat_api/models/edu_resource_type.rb +++ b/lib/flat_api/models/edu_resource_type.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/edu_resource_update.rb b/lib/flat_api/models/edu_resource_update.rb index 59f5674..540b4a9 100644 --- a/lib/flat_api/models/edu_resource_update.rb +++ b/lib/flat_api/models/edu_resource_update.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,12 +15,24 @@ module FlatApi # Update of an education resource - class EduResourceUpdate + class EduResourceUpdate < ApiModelBase # Title of the resource attr_accessor :title + # Sharing description of the resource + attr_accessor :sharing_description + + # HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. + attr_accessor :sharing_description_html + attr_accessor :privacy + # The subjects of this resource, or the subjects of the resources included in the folder + attr_accessor :subjects + + # The grades of this resource, or the grades of the resources included in the folder. + attr_accessor :grades + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -47,20 +59,33 @@ def valid?(value) def self.attribute_map { :'title' => :'title', - :'privacy' => :'privacy' + :'sharing_description' => :'sharingDescription', + :'sharing_description_html' => :'sharingDescriptionHtml', + :'privacy' => :'privacy', + :'subjects' => :'subjects', + :'grades' => :'grades' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. def self.openapi_types { :'title' => :'String', - :'privacy' => :'EduResourcePrivacy' + :'sharing_description' => :'String', + :'sharing_description_html' => :'String', + :'privacy' => :'EduResourcePrivacy', + :'subjects' => :'Array', + :'grades' => :'Array' } end @@ -78,9 +103,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -89,11 +115,31 @@ def initialize(attributes = {}) self.title = attributes[:'title'] end + if attributes.key?(:'sharing_description') + self.sharing_description = attributes[:'sharing_description'] + end + + if attributes.key?(:'sharing_description_html') + self.sharing_description_html = attributes[:'sharing_description_html'] + end + if attributes.key?(:'privacy') self.privacy = attributes[:'privacy'] else self.privacy = 'private' end + + if attributes.key?(:'subjects') + if (value = attributes[:'subjects']).is_a?(Array) + self.subjects = value + end + end + + if attributes.key?(:'grades') + if (value = attributes[:'grades']).is_a?(Array) + self.grades = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -106,7 +152,15 @@ def list_invalid_properties end if !@title.nil? && @title.to_s.length < 1 - invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.') + invalid_properties.push('invalid value for "title", the character length must be greater than or equal to 1.') + end + + if !@sharing_description.nil? && @sharing_description.to_s.length > 400 + invalid_properties.push('invalid value for "sharing_description", the character length must be smaller than or equal to 400.') + end + + if !@sharing_description_html.nil? && @sharing_description_html.to_s.length > 10000 + invalid_properties.push('invalid value for "sharing_description_html", the character length must be smaller than or equal to 10000.') end invalid_properties @@ -118,6 +172,8 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@title.nil? && @title.to_s.length > 1000 return false if !@title.nil? && @title.to_s.length < 1 + return false if !@sharing_description.nil? && @sharing_description.to_s.length > 400 + return false if !@sharing_description_html.nil? && @sharing_description_html.to_s.length > 10000 true end @@ -133,19 +189,51 @@ def title=(title) end if title.to_s.length < 1 - fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.' + fail ArgumentError, 'invalid value for "title", the character length must be greater than or equal to 1.' end @title = title end + # Custom attribute writer method with validation + # @param [Object] sharing_description Value to be assigned + def sharing_description=(sharing_description) + if sharing_description.nil? + fail ArgumentError, 'sharing_description cannot be nil' + end + + if sharing_description.to_s.length > 400 + fail ArgumentError, 'invalid value for "sharing_description", the character length must be smaller than or equal to 400.' + end + + @sharing_description = sharing_description + end + + # Custom attribute writer method with validation + # @param [Object] sharing_description_html Value to be assigned + def sharing_description_html=(sharing_description_html) + if sharing_description_html.nil? + fail ArgumentError, 'sharing_description_html cannot be nil' + end + + if sharing_description_html.to_s.length > 10000 + fail ArgumentError, 'invalid value for "sharing_description_html", the character length must be smaller than or equal to 10000.' + end + + @sharing_description_html = sharing_description_html + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && title == o.title && - privacy == o.privacy + sharing_description == o.sharing_description && + sharing_description_html == o.sharing_description_html && + privacy == o.privacy && + subjects == o.subjects && + grades == o.grades end # @see the `==` method @@ -157,7 +245,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, privacy].hash + [title, sharing_description, sharing_description_html, privacy, subjects, grades].hash end # Builds the object from hash @@ -183,61 +271,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -254,24 +287,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/edu_resource_use_in_class.rb b/lib/flat_api/models/edu_resource_use_in_class.rb index ce2cfd9..91e4572 100644 --- a/lib/flat_api/models/edu_resource_use_in_class.rb +++ b/lib/flat_api/models/edu_resource_use_in_class.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Use an education resource in class - class EduResourceUseInClass + class EduResourceUseInClass < ApiModelBase # The destination classroom where the resource will be copied. attr_accessor :classroom @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceUseInClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::EduResourceUseInClass`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -95,6 +101,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] classroom Value to be assigned + def classroom=(classroom) + if classroom.nil? + fail ArgumentError, 'classroom cannot be nil' + end + + @classroom = classroom + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -139,61 +155,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -210,24 +171,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/flat_error_response.rb b/lib/flat_api/models/flat_error_response.rb index 77d2396..74b7595 100644 --- a/lib/flat_api/models/flat_error_response.rb +++ b/lib/flat_api/models/flat_error_response.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # An API Error response - class FlatErrorResponse + class FlatErrorResponse < ApiModelBase # A corresponding code for this error attr_accessor :code @@ -28,19 +28,28 @@ class FlatErrorResponse # The related parameter that caused the error attr_accessor :param + # 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. + attr_accessor :provider_message + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'code' => :'code', :'message' => :'message', :'id' => :'id', - :'param' => :'param' + :'param' => :'param', + :'provider_message' => :'providerMessage' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -49,7 +58,8 @@ def self.openapi_types :'code' => :'String', :'message' => :'String', :'id' => :'String', - :'param' => :'String' + :'param' => :'String', + :'provider_message' => :'String' } end @@ -67,9 +77,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::FlatErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::FlatErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -93,6 +104,10 @@ def initialize(attributes = {}) if attributes.key?(:'param') self.param = attributes[:'param'] end + + if attributes.key?(:'provider_message') + self.provider_message = attributes[:'provider_message'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -120,6 +135,26 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if code.nil? + fail ArgumentError, 'code cannot be nil' + end + + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if message.nil? + fail ArgumentError, 'message cannot be nil' + end + + @message = message + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -128,7 +163,8 @@ def ==(o) code == o.code && message == o.message && id == o.id && - param == o.param + param == o.param && + provider_message == o.provider_message end # @see the `==` method @@ -140,7 +176,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [code, message, id, param].hash + [code, message, id, param, provider_message].hash end # Builds the object from hash @@ -166,61 +202,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -237,24 +218,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/flat_locales.rb b/lib/flat_api/models/flat_locales.rb deleted file mode 100644 index 06763a4..0000000 --- a/lib/flat_api/models/flat_locales.rb +++ /dev/null @@ -1,56 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'date' -require 'time' - -module FlatApi - class FlatLocales - EN = "en".freeze - EN_GB = "en-GB".freeze - ES = "es".freeze - FR = "fr".freeze - DE = "de".freeze - IT = "it".freeze - JA = "ja".freeze - JA_HIRA = "ja-HIRA".freeze - KO = "ko".freeze - NL = "nl".freeze - PL = "pl".freeze - PT = "pt".freeze - PT_BR = "pt-BR".freeze - RO = "ro".freeze - RU = "ru".freeze - SV = "sv".freeze - TR = "tr".freeze - ZH_HANS = "zh-Hans".freeze - - def self.all_vars - @all_vars ||= [EN, EN_GB, ES, FR, DE, IT, JA, JA_HIRA, KO, NL, PL, PT, PT_BR, RO, RU, SV, TR, ZH_HANS].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if FlatLocales.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #FlatLocales" - end - end -end diff --git a/lib/flat_api/models/google_classroom_coursework.rb b/lib/flat_api/models/google_classroom_coursework.rb index 5d0fd57..3c8c5d8 100644 --- a/lib/flat_api/models/google_classroom_coursework.rb +++ b/lib/flat_api/models/google_classroom_coursework.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A coursework on Google Classroom - class GoogleClassroomCoursework + class GoogleClassroomCoursework < ApiModelBase # Identifier of the coursework assigned by Classroom attr_accessor :id @@ -38,9 +38,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -68,9 +73,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::GoogleClassroomCoursework`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::GoogleClassroomCoursework`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -153,61 +159,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -224,24 +175,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/google_classroom_submission.rb b/lib/flat_api/models/google_classroom_submission.rb index ae9e994..25ac509 100644 --- a/lib/flat_api/models/google_classroom_submission.rb +++ b/lib/flat_api/models/google_classroom_submission.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A coursework submission on Google Classroom - class GoogleClassroomSubmission + class GoogleClassroomSubmission < ApiModelBase # Identifier of the coursework submission assigned by Classroom attr_accessor :id @@ -34,9 +34,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -62,9 +67,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::GoogleClassroomSubmission`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::GoogleClassroomSubmission`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -118,6 +124,36 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] state Value to be assigned + def state=(state) + if state.nil? + fail ArgumentError, 'state cannot be nil' + end + + @state = state + end + + # Custom attribute writer method with validation + # @param [Object] alternate_link Value to be assigned + def alternate_link=(alternate_link) + if alternate_link.nil? + fail ArgumentError, 'alternate_link cannot be nil' + end + + @alternate_link = alternate_link + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -163,61 +199,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -234,24 +215,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/grade.rb b/lib/flat_api/models/grade.rb new file mode 100644 index 0000000..4d9f59c --- /dev/null +++ b/lib/flat_api/models/grade.rb @@ -0,0 +1,51 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class Grade + N1 = "1".freeze + N2 = "2".freeze + N3 = "3".freeze + N4 = "4".freeze + N5 = "5".freeze + N6 = "6".freeze + N7 = "7".freeze + N8 = "8".freeze + N9 = "9".freeze + N10 = "10".freeze + N11 = "11".freeze + N12 = "12".freeze + UNIVERSITY = "university".freeze + + def self.all_vars + @all_vars ||= [N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N11, N12, UNIVERSITY].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if Grade.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #Grade" + end + end +end diff --git a/lib/flat_api/models/group.rb b/lib/flat_api/models/group.rb index 4ddcf32..5d34377 100644 --- a/lib/flat_api/models/group.rb +++ b/lib/flat_api/models/group.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,14 +15,13 @@ module FlatApi # A group of users - class Group + class Group < ApiModelBase # The unique identifier of the group attr_accessor :id # The display name of the group attr_accessor :name - # 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 attr_accessor :type # The number of users in this group @@ -72,9 +71,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -82,7 +86,7 @@ def self.openapi_types { :'id' => :'String', :'name' => :'String', - :'type' => :'String', + :'type' => :'GroupType', :'users_count' => :'Float', :'read_only' => :'Boolean', :'organization' => :'String', @@ -104,9 +108,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::Group`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::Group`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -152,21 +157,9 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["generic", "classTeachers", "classStudents"]) - return false unless type_validator.valid?(@type) true end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["generic", "classTeachers", "classStudents"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -216,61 +209,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -287,24 +225,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/group_creation.rb b/lib/flat_api/models/group_creation.rb new file mode 100644 index 0000000..1e2c4d4 --- /dev/null +++ b/lib/flat_api/models/group_creation.rb @@ -0,0 +1,238 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class GroupCreation < ApiModelBase + # Type of group (currently only classStudentsSubGroup is supported) + attr_accessor :type + + # Classroom ID + attr_accessor :classroom + + # 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`. + attr_accessor :name + + # Array of student IDs to add to the group + attr_accessor :members + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'classroom' => :'classroom', + :'name' => :'name', + :'members' => :'members' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'classroom' => :'String', + :'name' => :'String', + :'members' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::GroupCreation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::GroupCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'classroom') + self.classroom = attributes[:'classroom'] + else + self.classroom = nil + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'members') + if (value = attributes[:'members']).is_a?(Array) + self.members = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @classroom.nil? + invalid_properties.push('invalid value for "classroom", classroom cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @type.nil? + type_validator = EnumAttributeValidator.new('String', ["classStudentsSubGroup"]) + return false unless type_validator.valid?(@type) + return false if @classroom.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["classStudentsSubGroup"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] classroom Value to be assigned + def classroom=(classroom) + if classroom.nil? + fail ArgumentError, 'classroom cannot be nil' + end + + @classroom = classroom + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + classroom == o.classroom && + name == o.name && + members == o.members + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, classroom, name, members].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/group_details.rb b/lib/flat_api/models/group_details.rb index b26009f..9b34e4d 100644 --- a/lib/flat_api/models/group_details.rb +++ b/lib/flat_api/models/group_details.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # The details of a group - class GroupDetails + class GroupDetails < ApiModelBase # The unique identifier of the group attr_accessor :id @@ -27,6 +27,15 @@ class GroupDetails # The unique identifier of the Organization owning the group attr_accessor :organization + # The unique identifier of the classroom owning the group. Only available for groups of type 'classromStudentsSubGroup' or 'assignmentStudentsSubGroup' + attr_accessor :classroom + + # The unique identifier of the assignment owning the group. Only available for groups of type 'assignmentStudentsSubGroup'. + attr_accessor :assignment + + # 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. + attr_accessor :parent + # The date when the group was create attr_accessor :creation_date @@ -36,6 +45,9 @@ class GroupDetails # `true` if the properties and members of this group are in in read-only attr_accessor :read_only + # Tags for categorizing groups. * `edu:testing-students`: Marks this group as containing test student accounts + attr_accessor :tags + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -65,15 +77,24 @@ def self.attribute_map :'name' => :'name', :'type' => :'type', :'organization' => :'organization', + :'classroom' => :'classroom', + :'assignment' => :'assignment', + :'parent' => :'parent', :'creation_date' => :'creationDate', :'users_count' => :'usersCount', - :'read_only' => :'readOnly' + :'read_only' => :'readOnly', + :'tags' => :'tags' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -83,9 +104,13 @@ def self.openapi_types :'name' => :'String', :'type' => :'GroupType', :'organization' => :'String', + :'classroom' => :'String', + :'assignment' => :'String', + :'parent' => :'String', :'creation_date' => :'Time', :'users_count' => :'Float', - :'read_only' => :'Boolean' + :'read_only' => :'Boolean', + :'tags' => :'Array' } end @@ -103,39 +128,72 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::GroupDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::GroupDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] + else + self.name = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'organization') self.organization = attributes[:'organization'] end + if attributes.key?(:'classroom') + self.classroom = attributes[:'classroom'] + end + + if attributes.key?(:'assignment') + self.assignment = attributes[:'assignment'] + end + + if attributes.key?(:'parent') + self.parent = attributes[:'parent'] + end + if attributes.key?(:'creation_date') self.creation_date = attributes[:'creation_date'] + else + self.creation_date = nil end if attributes.key?(:'users_count') self.users_count = attributes[:'users_count'] + else + self.users_count = nil end if attributes.key?(:'read_only') self.read_only = attributes[:'read_only'] + else + self.read_only = nil + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + else + self.tags = nil end end @@ -144,6 +202,34 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @creation_date.nil? + invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') + end + + if @users_count.nil? + invalid_properties.push('invalid value for "users_count", users_count cannot be nil.') + end + + if @read_only.nil? + invalid_properties.push('invalid value for "read_only", read_only cannot be nil.') + end + + if @tags.nil? + invalid_properties.push('invalid value for "tags", tags cannot be nil.') + end + invalid_properties end @@ -151,9 +237,86 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @name.nil? + return false if @type.nil? + return false if @creation_date.nil? + return false if @users_count.nil? + return false if @read_only.nil? + return false if @tags.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method with validation + # @param [Object] users_count Value to be assigned + def users_count=(users_count) + if users_count.nil? + fail ArgumentError, 'users_count cannot be nil' + end + + @users_count = users_count + end + + # Custom attribute writer method with validation + # @param [Object] read_only Value to be assigned + def read_only=(read_only) + if read_only.nil? + fail ArgumentError, 'read_only cannot be nil' + end + + @read_only = read_only + end + + # Custom attribute writer method with validation + # @param [Object] tags Value to be assigned + def tags=(tags) + if tags.nil? + fail ArgumentError, 'tags cannot be nil' + end + + @tags = tags + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -163,9 +326,13 @@ def ==(o) name == o.name && type == o.type && organization == o.organization && + classroom == o.classroom && + assignment == o.assignment && + parent == o.parent && creation_date == o.creation_date && users_count == o.users_count && - read_only == o.read_only + read_only == o.read_only && + tags == o.tags end # @see the `==` method @@ -177,7 +344,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, type, organization, creation_date, users_count, read_only].hash + [id, name, type, organization, classroom, assignment, parent, creation_date, users_count, read_only, tags].hash end # Builds the object from hash @@ -203,61 +370,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -274,24 +386,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/group_type.rb b/lib/flat_api/models/group_type.rb index eab10ea..4cca859 100644 --- a/lib/flat_api/models/group_type.rb +++ b/lib/flat_api/models/group_type.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -18,9 +18,11 @@ class GroupType GENERIC = "generic".freeze CLASS_TEACHERS = "classTeachers".freeze CLASS_STUDENTS = "classStudents".freeze + CLASS_STUDENTS_SUB_GROUP = "classStudentsSubGroup".freeze + ASSIGNMENT_STUDENTS_SUB_GROUP = "assignmentStudentsSubGroup".freeze def self.all_vars - @all_vars ||= [GENERIC, CLASS_TEACHERS, CLASS_STUDENTS].freeze + @all_vars ||= [GENERIC, CLASS_TEACHERS, CLASS_STUDENTS, CLASS_STUDENTS_SUB_GROUP, ASSIGNMENT_STUDENTS_SUB_GROUP].freeze end # Builds the enum from string diff --git a/lib/flat_api/models/license_mode.rb b/lib/flat_api/models/license_mode.rb index 9fbae11..b3fc4f2 100644 --- a/lib/flat_api/models/license_mode.rb +++ b/lib/flat_api/models/license_mode.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/license_sources.rb b/lib/flat_api/models/license_sources.rb index 4bb7659..07148a7 100644 --- a/lib/flat_api/models/license_sources.rb +++ b/lib/flat_api/models/license_sources.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/lms_name.rb b/lib/flat_api/models/lms_name.rb index cdc29cd..b7d3dec 100644 --- a/lib/flat_api/models/lms_name.rb +++ b/lib/flat_api/models/lms_name.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/lti_configuration.rb b/lib/flat_api/models/lti_configuration.rb new file mode 100644 index 0000000..99914f4 --- /dev/null +++ b/lib/flat_api/models/lti_configuration.rb @@ -0,0 +1,56 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # LTI configuration details (unified 1.1 and 1.3) + module LtiConfiguration + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LtiConfiguration1p1', + :'LtiConfiguration1p3' + ] + end + + # Discriminator's property name (OpenAPI v3) + def openapi_discriminator_name + :'lti_version' + end + + # Discriminator's mapping (OpenAPI v3) + def openapi_discriminator_mapping + { + :'1p1' => :'LtiConfiguration1p1', + :'1p3' => :'LtiConfiguration1p3' + } + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + discriminator_value = data[openapi_discriminator_name] + return nil if discriminator_value.nil? + + klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym] + return nil unless klass + + FlatApi.const_get(klass).build_from_hash(data) + end + end + end + +end diff --git a/lib/flat_api/models/lti_configuration1p1.rb b/lib/flat_api/models/lti_configuration1p1.rb new file mode 100644 index 0000000..564dd2a --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p1.rb @@ -0,0 +1,361 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class LtiConfiguration1p1 < ApiModelBase + # Configuration ID + attr_accessor :id + + # LTI version (1.1) + attr_accessor :lti_version + + # Organization ID + attr_accessor :organization_id + + # Organization name + attr_accessor :organization_name + + # ID of the user who created this configuration + attr_accessor :creator_id + + # Configuration creation date + attr_accessor :creation_date + + # Last time this configuration was used + attr_accessor :last_used_date + + # Configuration status indicator + attr_accessor :status + + # LTI 1.1 consumer key + attr_accessor :consumer_key + + # LTI 1.1 consumer secret (only included for admins) + attr_accessor :consumer_secret + + # LMS type + attr_accessor :lms + + # Configuration name + attr_accessor :name + + attr_accessor :tool + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'lti_version' => :'ltiVersion', + :'organization_id' => :'organizationId', + :'organization_name' => :'organizationName', + :'creator_id' => :'creatorId', + :'creation_date' => :'creationDate', + :'last_used_date' => :'lastUsedDate', + :'status' => :'status', + :'consumer_key' => :'consumerKey', + :'consumer_secret' => :'consumerSecret', + :'lms' => :'lms', + :'name' => :'name', + :'tool' => :'tool' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'lti_version' => :'String', + :'organization_id' => :'String', + :'organization_name' => :'String', + :'creator_id' => :'String', + :'creation_date' => :'Time', + :'last_used_date' => :'Time', + :'status' => :'String', + :'consumer_key' => :'String', + :'consumer_secret' => :'String', + :'lms' => :'String', + :'name' => :'String', + :'tool' => :'LtiConfiguration1p1AllOfTool' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'LtiConfigurationBase' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'lti_version') + self.lti_version = attributes[:'lti_version'] + else + self.lti_version = nil + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'organization_name') + self.organization_name = attributes[:'organization_name'] + end + + if attributes.key?(:'creator_id') + self.creator_id = attributes[:'creator_id'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + else + self.creation_date = nil + end + + if attributes.key?(:'last_used_date') + self.last_used_date = attributes[:'last_used_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'consumer_key') + self.consumer_key = attributes[:'consumer_key'] + end + + if attributes.key?(:'consumer_secret') + self.consumer_secret = attributes[:'consumer_secret'] + end + + if attributes.key?(:'lms') + self.lms = attributes[:'lms'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tool') + self.tool = attributes[:'tool'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @lti_version.nil? + invalid_properties.push('invalid value for "lti_version", lti_version cannot be nil.') + end + + if @creation_date.nil? + invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @lti_version.nil? + lti_version_validator = EnumAttributeValidator.new('String', ["1p1"]) + return false unless lti_version_validator.valid?(@lti_version) + return false if @creation_date.nil? + status_validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] lti_version Object to be assigned + def lti_version=(lti_version) + validator = EnumAttributeValidator.new('String', ["1p1"]) + unless validator.valid?(lti_version) + fail ArgumentError, "invalid value for \"lti_version\", must be one of #{validator.allowable_values}." + end + @lti_version = lti_version + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + lti_version == o.lti_version && + organization_id == o.organization_id && + organization_name == o.organization_name && + creator_id == o.creator_id && + creation_date == o.creation_date && + last_used_date == o.last_used_date && + status == o.status && + consumer_key == o.consumer_key && + consumer_secret == o.consumer_secret && + lms == o.lms && + name == o.name && + tool == o.tool + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, lti_version, organization_id, organization_name, creator_id, creation_date, last_used_date, status, consumer_key, consumer_secret, lms, name, tool].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p1_all_of_tool.rb b/lib/flat_api/models/lti_configuration1p1_all_of_tool.rb new file mode 100644 index 0000000..015be5c --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p1_all_of_tool.rb @@ -0,0 +1,199 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Platform/tool product information + class LtiConfiguration1p1AllOfTool < ApiModelBase + # Product family code (e.g., canvas, moodle, schoology) + attr_accessor :product + + # Platform version string + attr_accessor :version + + # Instance display name + attr_accessor :instance_name + + # Unique instance identifier + attr_accessor :instance_guid + + # Contact email or handle for the instance + attr_accessor :instance_contact + + # Instance root domain + attr_accessor :instance_domain + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'product' => :'product', + :'version' => :'version', + :'instance_name' => :'instanceName', + :'instance_guid' => :'instanceGuid', + :'instance_contact' => :'instanceContact', + :'instance_domain' => :'instanceDomain' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'product' => :'String', + :'version' => :'String', + :'instance_name' => :'String', + :'instance_guid' => :'String', + :'instance_contact' => :'String', + :'instance_domain' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p1AllOfTool` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p1AllOfTool`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'product') + self.product = attributes[:'product'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + + if attributes.key?(:'instance_name') + self.instance_name = attributes[:'instance_name'] + end + + if attributes.key?(:'instance_guid') + self.instance_guid = attributes[:'instance_guid'] + end + + if attributes.key?(:'instance_contact') + self.instance_contact = attributes[:'instance_contact'] + end + + if attributes.key?(:'instance_domain') + self.instance_domain = attributes[:'instance_domain'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + product == o.product && + version == o.version && + instance_name == o.instance_name && + instance_guid == o.instance_guid && + instance_contact == o.instance_contact && + instance_domain == o.instance_domain + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [product, version, instance_name, instance_guid, instance_contact, instance_domain].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3.rb b/lib/flat_api/models/lti_configuration1p3.rb new file mode 100644 index 0000000..659f1e0 --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3.rb @@ -0,0 +1,106 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # LTI 1.3 configuration details + module LtiConfiguration1p3 + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LtiConfiguration1p3Deployment', + :'LtiConfiguration1p3Dynamic', + :'LtiConfiguration1p3Manual' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + return find_and_cast_into_type(klass, data) + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.iso8601(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = FlatApi.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3_base.rb b/lib/flat_api/models/lti_configuration1p3_base.rb new file mode 100644 index 0000000..03be8da --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3_base.rb @@ -0,0 +1,336 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class LtiConfiguration1p3Base < ApiModelBase + # LTI 1.3 configuration mode + attr_accessor :mode + + # Platform issuer URL + attr_accessor :platform_iss + + # Platform display name + attr_accessor :platform_name + + # OAuth2 client_id allocated by the platform + attr_accessor :client_id + + # Deployment ID linking the tool to a tenant/class (varies by platform) + attr_accessor :deployment_id + + # OAuth2 token endpoint (for AGS/NRPS) + attr_accessor :access_token_url + + # OIDC authorization/login endpoint + attr_accessor :authorization_url + + # Platform JWKS endpoint (public keys) + attr_accessor :jwks_url + + # Deployment mode (single for organization-specific, multi for shared parent platforms) + attr_accessor :deployment_mode + + attr_accessor :supported_services + + attr_accessor :tool + + # Public keyset URL for the platform to retrieve Flat's public keys + attr_accessor :public_keyset_url + + # URL for the platform to initiate LTI login + attr_accessor :initiate_login_url + + # Allowed redirect URIs for LTI launches + attr_accessor :redirect_uris + + # 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. + attr_accessor :enable_email_matching + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'mode' => :'mode', + :'platform_iss' => :'platformIss', + :'platform_name' => :'platformName', + :'client_id' => :'clientId', + :'deployment_id' => :'deploymentId', + :'access_token_url' => :'accessTokenUrl', + :'authorization_url' => :'authorizationUrl', + :'jwks_url' => :'jwksUrl', + :'deployment_mode' => :'deploymentMode', + :'supported_services' => :'supportedServices', + :'tool' => :'tool', + :'public_keyset_url' => :'publicKeysetUrl', + :'initiate_login_url' => :'initiateLoginUrl', + :'redirect_uris' => :'redirectUris', + :'enable_email_matching' => :'enableEmailMatching' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'mode' => :'String', + :'platform_iss' => :'String', + :'platform_name' => :'String', + :'client_id' => :'String', + :'deployment_id' => :'String', + :'access_token_url' => :'String', + :'authorization_url' => :'String', + :'jwks_url' => :'String', + :'deployment_mode' => :'String', + :'supported_services' => :'LtiConfiguration1p3BaseSupportedServices', + :'tool' => :'LtiConfiguration1p3BaseTool', + :'public_keyset_url' => :'String', + :'initiate_login_url' => :'String', + :'redirect_uris' => :'Array', + :'enable_email_matching' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p3Base` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p3Base`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'platform_iss') + self.platform_iss = attributes[:'platform_iss'] + end + + if attributes.key?(:'platform_name') + self.platform_name = attributes[:'platform_name'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + end + + if attributes.key?(:'access_token_url') + self.access_token_url = attributes[:'access_token_url'] + end + + if attributes.key?(:'authorization_url') + self.authorization_url = attributes[:'authorization_url'] + end + + if attributes.key?(:'jwks_url') + self.jwks_url = attributes[:'jwks_url'] + end + + if attributes.key?(:'deployment_mode') + self.deployment_mode = attributes[:'deployment_mode'] + end + + if attributes.key?(:'supported_services') + self.supported_services = attributes[:'supported_services'] + end + + if attributes.key?(:'tool') + self.tool = attributes[:'tool'] + end + + if attributes.key?(:'public_keyset_url') + self.public_keyset_url = attributes[:'public_keyset_url'] + end + + if attributes.key?(:'initiate_login_url') + self.initiate_login_url = attributes[:'initiate_login_url'] + end + + if attributes.key?(:'redirect_uris') + if (value = attributes[:'redirect_uris']).is_a?(Array) + self.redirect_uris = value + end + end + + if attributes.key?(:'enable_email_matching') + self.enable_email_matching = attributes[:'enable_email_matching'] + else + self.enable_email_matching = true + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + mode_validator = EnumAttributeValidator.new('String', ["1p3-manual", "1p3-deployment", "1p3-dynamic"]) + return false unless mode_validator.valid?(@mode) + deployment_mode_validator = EnumAttributeValidator.new('String', ["single", "multi"]) + return false unless deployment_mode_validator.valid?(@deployment_mode) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ["1p3-manual", "1p3-deployment", "1p3-dynamic"]) + unless validator.valid?(mode) + fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}." + end + @mode = mode + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] deployment_mode Object to be assigned + def deployment_mode=(deployment_mode) + validator = EnumAttributeValidator.new('String', ["single", "multi"]) + unless validator.valid?(deployment_mode) + fail ArgumentError, "invalid value for \"deployment_mode\", must be one of #{validator.allowable_values}." + end + @deployment_mode = deployment_mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + mode == o.mode && + platform_iss == o.platform_iss && + platform_name == o.platform_name && + client_id == o.client_id && + deployment_id == o.deployment_id && + access_token_url == o.access_token_url && + authorization_url == o.authorization_url && + jwks_url == o.jwks_url && + deployment_mode == o.deployment_mode && + supported_services == o.supported_services && + tool == o.tool && + public_keyset_url == o.public_keyset_url && + initiate_login_url == o.initiate_login_url && + redirect_uris == o.redirect_uris && + enable_email_matching == o.enable_email_matching + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [mode, platform_iss, platform_name, client_id, deployment_id, access_token_url, authorization_url, jwks_url, deployment_mode, supported_services, tool, public_keyset_url, initiate_login_url, redirect_uris, enable_email_matching].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3_base_supported_services.rb b/lib/flat_api/models/lti_configuration1p3_base_supported_services.rb new file mode 100644 index 0000000..f260847 --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3_base_supported_services.rb @@ -0,0 +1,166 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # LTI services support information + class LtiConfiguration1p3BaseSupportedServices < ApiModelBase + attr_accessor :ags + + attr_accessor :nrps + + attr_accessor :deep_linking + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ags' => :'ags', + :'nrps' => :'nrps', + :'deep_linking' => :'deepLinking' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ags' => :'LtiConfiguration1p3BaseSupportedServicesAgs', + :'nrps' => :'LtiConfiguration1p3BaseSupportedServicesNrps', + :'deep_linking' => :'LtiConfiguration1p3BaseSupportedServicesDeepLinking' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p3BaseSupportedServices` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p3BaseSupportedServices`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ags') + self.ags = attributes[:'ags'] + end + + if attributes.key?(:'nrps') + self.nrps = attributes[:'nrps'] + end + + if attributes.key?(:'deep_linking') + self.deep_linking = attributes[:'deep_linking'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ags == o.ags && + nrps == o.nrps && + deep_linking == o.deep_linking + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ags, nrps, deep_linking].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3_base_supported_services_ags.rb b/lib/flat_api/models/lti_configuration1p3_base_supported_services_ags.rb new file mode 100644 index 0000000..919663f --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3_base_supported_services_ags.rb @@ -0,0 +1,179 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Assignment and Grade Services support + class LtiConfiguration1p3BaseSupportedServicesAgs < ApiModelBase + # Whether AGS claims were detected in launches from this platform + attr_accessor :available + + # AGS version supported (e.g., \"2.0\") + attr_accessor :version + + # Whether we have AGS enabled for this platform + attr_accessor :enabled + + # Base URL for line items operations as provided by the platform + attr_accessor :lineitems_url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'available' => :'available', + :'version' => :'version', + :'enabled' => :'enabled', + :'lineitems_url' => :'lineitemsUrl' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'available' => :'Boolean', + :'version' => :'String', + :'enabled' => :'Boolean', + :'lineitems_url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p3BaseSupportedServicesAgs` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p3BaseSupportedServicesAgs`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'available') + self.available = attributes[:'available'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'lineitems_url') + self.lineitems_url = attributes[:'lineitems_url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + available == o.available && + version == o.version && + enabled == o.enabled && + lineitems_url == o.lineitems_url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [available, version, enabled, lineitems_url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3_base_supported_services_deep_linking.rb b/lib/flat_api/models/lti_configuration1p3_base_supported_services_deep_linking.rb new file mode 100644 index 0000000..2cd5547 --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3_base_supported_services_deep_linking.rb @@ -0,0 +1,159 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Deep Linking support + class LtiConfiguration1p3BaseSupportedServicesDeepLinking < ApiModelBase + # Whether Deep Linking claims were detected in launches from this platform + attr_accessor :available + + # Deep Linking version supported (e.g., \"2.0\") + attr_accessor :version + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'available' => :'available', + :'version' => :'version' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'available' => :'Boolean', + :'version' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p3BaseSupportedServicesDeepLinking` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p3BaseSupportedServicesDeepLinking`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'available') + self.available = attributes[:'available'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + available == o.available && + version == o.version + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [available, version].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3_base_supported_services_nrps.rb b/lib/flat_api/models/lti_configuration1p3_base_supported_services_nrps.rb new file mode 100644 index 0000000..920e2ce --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3_base_supported_services_nrps.rb @@ -0,0 +1,169 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Names and Role Provisioning Services support + class LtiConfiguration1p3BaseSupportedServicesNrps < ApiModelBase + # Whether NRPS claims were detected in launches from this platform + attr_accessor :available + + # NRPS version supported (e.g., \"2.0\") + attr_accessor :version + + # Whether we have NRPS enabled for this platform + attr_accessor :enabled + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'available' => :'available', + :'version' => :'version', + :'enabled' => :'enabled' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'available' => :'Boolean', + :'version' => :'String', + :'enabled' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p3BaseSupportedServicesNrps` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p3BaseSupportedServicesNrps`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'available') + self.available = attributes[:'available'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + available == o.available && + version == o.version && + enabled == o.enabled + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [available, version, enabled].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3_base_tool.rb b/lib/flat_api/models/lti_configuration1p3_base_tool.rb new file mode 100644 index 0000000..cf53226 --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3_base_tool.rb @@ -0,0 +1,199 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Platform/tool product information + class LtiConfiguration1p3BaseTool < ApiModelBase + # Product family code (e.g., canvas, moodle, schoology) + attr_accessor :product + + # Platform version string + attr_accessor :version + + # Instance name (e.g., 'My University Canvas') + attr_accessor :instance_name + + # Unique instance identifier + attr_accessor :instance_guid + + # Contact email or handle for the instance + attr_accessor :instance_contact + + # Instance root domain + attr_accessor :instance_domain + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'product' => :'product', + :'version' => :'version', + :'instance_name' => :'instanceName', + :'instance_guid' => :'instanceGuid', + :'instance_contact' => :'instanceContact', + :'instance_domain' => :'instanceDomain' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'product' => :'String', + :'version' => :'String', + :'instance_name' => :'String', + :'instance_guid' => :'String', + :'instance_contact' => :'String', + :'instance_domain' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p3BaseTool` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p3BaseTool`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'product') + self.product = attributes[:'product'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + + if attributes.key?(:'instance_name') + self.instance_name = attributes[:'instance_name'] + end + + if attributes.key?(:'instance_guid') + self.instance_guid = attributes[:'instance_guid'] + end + + if attributes.key?(:'instance_contact') + self.instance_contact = attributes[:'instance_contact'] + end + + if attributes.key?(:'instance_domain') + self.instance_domain = attributes[:'instance_domain'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + product == o.product && + version == o.version && + instance_name == o.instance_name && + instance_guid == o.instance_guid && + instance_contact == o.instance_contact && + instance_domain == o.instance_domain + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [product, version, instance_name, instance_guid, instance_contact, instance_domain].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3_deployment.rb b/lib/flat_api/models/lti_configuration1p3_deployment.rb new file mode 100644 index 0000000..05588e5 --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3_deployment.rb @@ -0,0 +1,529 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class LtiConfiguration1p3Deployment < ApiModelBase + # Configuration ID + attr_accessor :id + + # LTI version (1.3) + attr_accessor :lti_version + + # Organization ID + attr_accessor :organization_id + + # Organization name + attr_accessor :organization_name + + # ID of the user who created this configuration + attr_accessor :creator_id + + # Configuration creation date + attr_accessor :creation_date + + # Last time this configuration was used + attr_accessor :last_used_date + + # Configuration status indicator + attr_accessor :status + + # Deployment-based LTI 1.3 configuration mode + attr_accessor :mode + + # Platform issuer URL + attr_accessor :platform_iss + + # Platform display name + attr_accessor :platform_name + + # OAuth2 client_id allocated by the platform + attr_accessor :client_id + + # Deployment ID linking the tool to a tenant/class (varies by platform) + attr_accessor :deployment_id + + # OAuth2 token endpoint (for AGS/NRPS) + attr_accessor :access_token_url + + # OIDC authorization/login endpoint + attr_accessor :authorization_url + + # Platform JWKS endpoint (public keys) + attr_accessor :jwks_url + + # Deployment mode (single for organization-specific, multi for shared parent platforms) + attr_accessor :deployment_mode + + attr_accessor :supported_services + + attr_accessor :tool + + # Public keyset URL for the platform to retrieve Flat's public keys + attr_accessor :public_keyset_url + + # URL for the platform to initiate LTI login + attr_accessor :initiate_login_url + + # Allowed redirect URIs for LTI launches + attr_accessor :redirect_uris + + # 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. + attr_accessor :enable_email_matching + + # Parent configuration ID (for deployment-based configs) + attr_accessor :parent_id + + # Deployment key (e.g., schoology, classlink) + attr_accessor :deployment_key + + # Custom claim used for tenant identification (parent platforms only, read-only) + attr_accessor :deployment_breakdown_by + + # Value of the custom claim that identifies this specific tenant (child platforms only) + attr_accessor :deployment_breakdown_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'lti_version' => :'ltiVersion', + :'organization_id' => :'organizationId', + :'organization_name' => :'organizationName', + :'creator_id' => :'creatorId', + :'creation_date' => :'creationDate', + :'last_used_date' => :'lastUsedDate', + :'status' => :'status', + :'mode' => :'mode', + :'platform_iss' => :'platformIss', + :'platform_name' => :'platformName', + :'client_id' => :'clientId', + :'deployment_id' => :'deploymentId', + :'access_token_url' => :'accessTokenUrl', + :'authorization_url' => :'authorizationUrl', + :'jwks_url' => :'jwksUrl', + :'deployment_mode' => :'deploymentMode', + :'supported_services' => :'supportedServices', + :'tool' => :'tool', + :'public_keyset_url' => :'publicKeysetUrl', + :'initiate_login_url' => :'initiateLoginUrl', + :'redirect_uris' => :'redirectUris', + :'enable_email_matching' => :'enableEmailMatching', + :'parent_id' => :'parentId', + :'deployment_key' => :'deploymentKey', + :'deployment_breakdown_by' => :'deploymentBreakdownBy', + :'deployment_breakdown_id' => :'deploymentBreakdownId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'lti_version' => :'String', + :'organization_id' => :'String', + :'organization_name' => :'String', + :'creator_id' => :'String', + :'creation_date' => :'Time', + :'last_used_date' => :'Time', + :'status' => :'String', + :'mode' => :'String', + :'platform_iss' => :'String', + :'platform_name' => :'String', + :'client_id' => :'String', + :'deployment_id' => :'String', + :'access_token_url' => :'String', + :'authorization_url' => :'String', + :'jwks_url' => :'String', + :'deployment_mode' => :'String', + :'supported_services' => :'LtiConfiguration1p3BaseSupportedServices', + :'tool' => :'LtiConfiguration1p3BaseTool', + :'public_keyset_url' => :'String', + :'initiate_login_url' => :'String', + :'redirect_uris' => :'Array', + :'enable_email_matching' => :'Boolean', + :'parent_id' => :'String', + :'deployment_key' => :'String', + :'deployment_breakdown_by' => :'String', + :'deployment_breakdown_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'LtiConfiguration1p3Base', + :'LtiConfigurationBase' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p3Deployment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p3Deployment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'lti_version') + self.lti_version = attributes[:'lti_version'] + else + self.lti_version = nil + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'organization_name') + self.organization_name = attributes[:'organization_name'] + end + + if attributes.key?(:'creator_id') + self.creator_id = attributes[:'creator_id'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + else + self.creation_date = nil + end + + if attributes.key?(:'last_used_date') + self.last_used_date = attributes[:'last_used_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'platform_iss') + self.platform_iss = attributes[:'platform_iss'] + end + + if attributes.key?(:'platform_name') + self.platform_name = attributes[:'platform_name'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + end + + if attributes.key?(:'access_token_url') + self.access_token_url = attributes[:'access_token_url'] + end + + if attributes.key?(:'authorization_url') + self.authorization_url = attributes[:'authorization_url'] + end + + if attributes.key?(:'jwks_url') + self.jwks_url = attributes[:'jwks_url'] + end + + if attributes.key?(:'deployment_mode') + self.deployment_mode = attributes[:'deployment_mode'] + end + + if attributes.key?(:'supported_services') + self.supported_services = attributes[:'supported_services'] + end + + if attributes.key?(:'tool') + self.tool = attributes[:'tool'] + end + + if attributes.key?(:'public_keyset_url') + self.public_keyset_url = attributes[:'public_keyset_url'] + end + + if attributes.key?(:'initiate_login_url') + self.initiate_login_url = attributes[:'initiate_login_url'] + end + + if attributes.key?(:'redirect_uris') + if (value = attributes[:'redirect_uris']).is_a?(Array) + self.redirect_uris = value + end + end + + if attributes.key?(:'enable_email_matching') + self.enable_email_matching = attributes[:'enable_email_matching'] + else + self.enable_email_matching = true + end + + if attributes.key?(:'parent_id') + self.parent_id = attributes[:'parent_id'] + end + + if attributes.key?(:'deployment_key') + self.deployment_key = attributes[:'deployment_key'] + end + + if attributes.key?(:'deployment_breakdown_by') + self.deployment_breakdown_by = attributes[:'deployment_breakdown_by'] + end + + if attributes.key?(:'deployment_breakdown_id') + self.deployment_breakdown_id = attributes[:'deployment_breakdown_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @lti_version.nil? + invalid_properties.push('invalid value for "lti_version", lti_version cannot be nil.') + end + + if @creation_date.nil? + invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @lti_version.nil? + lti_version_validator = EnumAttributeValidator.new('String', ["1p3"]) + return false unless lti_version_validator.valid?(@lti_version) + return false if @creation_date.nil? + status_validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + return false unless status_validator.valid?(@status) + mode_validator = EnumAttributeValidator.new('String', ["1p3-deployment"]) + return false unless mode_validator.valid?(@mode) + deployment_mode_validator = EnumAttributeValidator.new('String', ["single", "multi"]) + return false unless deployment_mode_validator.valid?(@deployment_mode) + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] lti_version Object to be assigned + def lti_version=(lti_version) + validator = EnumAttributeValidator.new('String', ["1p3"]) + unless validator.valid?(lti_version) + fail ArgumentError, "invalid value for \"lti_version\", must be one of #{validator.allowable_values}." + end + @lti_version = lti_version + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ["1p3-deployment"]) + unless validator.valid?(mode) + fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}." + end + @mode = mode + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] deployment_mode Object to be assigned + def deployment_mode=(deployment_mode) + validator = EnumAttributeValidator.new('String', ["single", "multi"]) + unless validator.valid?(deployment_mode) + fail ArgumentError, "invalid value for \"deployment_mode\", must be one of #{validator.allowable_values}." + end + @deployment_mode = deployment_mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + lti_version == o.lti_version && + organization_id == o.organization_id && + organization_name == o.organization_name && + creator_id == o.creator_id && + creation_date == o.creation_date && + last_used_date == o.last_used_date && + status == o.status && + mode == o.mode && + platform_iss == o.platform_iss && + platform_name == o.platform_name && + client_id == o.client_id && + deployment_id == o.deployment_id && + access_token_url == o.access_token_url && + authorization_url == o.authorization_url && + jwks_url == o.jwks_url && + deployment_mode == o.deployment_mode && + supported_services == o.supported_services && + tool == o.tool && + public_keyset_url == o.public_keyset_url && + initiate_login_url == o.initiate_login_url && + redirect_uris == o.redirect_uris && + enable_email_matching == o.enable_email_matching && + parent_id == o.parent_id && + deployment_key == o.deployment_key && + deployment_breakdown_by == o.deployment_breakdown_by && + deployment_breakdown_id == o.deployment_breakdown_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, lti_version, organization_id, organization_name, creator_id, creation_date, last_used_date, status, mode, platform_iss, platform_name, client_id, deployment_id, access_token_url, authorization_url, jwks_url, deployment_mode, supported_services, tool, public_keyset_url, initiate_login_url, redirect_uris, enable_email_matching, parent_id, deployment_key, deployment_breakdown_by, deployment_breakdown_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3_dynamic.rb b/lib/flat_api/models/lti_configuration1p3_dynamic.rb new file mode 100644 index 0000000..bade13f --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3_dynamic.rb @@ -0,0 +1,530 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class LtiConfiguration1p3Dynamic < ApiModelBase + # Configuration ID + attr_accessor :id + + # LTI version (1.3) + attr_accessor :lti_version + + # Organization ID + attr_accessor :organization_id + + # Organization name + attr_accessor :organization_name + + # ID of the user who created this configuration + attr_accessor :creator_id + + # Configuration creation date + attr_accessor :creation_date + + # Last time this configuration was used + attr_accessor :last_used_date + + # Configuration status indicator + attr_accessor :status + + # Dynamic registration LTI 1.3 configuration mode + attr_accessor :mode + + # Platform issuer URL + attr_accessor :platform_iss + + # Platform display name + attr_accessor :platform_name + + # OAuth2 client_id allocated by the platform + attr_accessor :client_id + + # Deployment ID linking the tool to a tenant/class (varies by platform) + attr_accessor :deployment_id + + # OAuth2 token endpoint (for AGS/NRPS) + attr_accessor :access_token_url + + # OIDC authorization/login endpoint + attr_accessor :authorization_url + + # Platform JWKS endpoint (public keys) + attr_accessor :jwks_url + + # Deployment mode (single for organization-specific, multi for shared parent platforms) + attr_accessor :deployment_mode + + attr_accessor :supported_services + + attr_accessor :tool + + # Public keyset URL for the platform to retrieve Flat's public keys + attr_accessor :public_keyset_url + + # URL for the platform to initiate LTI login + attr_accessor :initiate_login_url + + # Allowed redirect URIs for LTI launches + attr_accessor :redirect_uris + + # 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. + attr_accessor :enable_email_matching + + # Only included for admins + attr_accessor :registration_token + + # Dynamic registration URL (only included for admins when available) + attr_accessor :registration_url + + # Whether dynamic registration token has been used + attr_accessor :registration_token_used + + # Date when dynamic registration completed (null when not completed) + attr_accessor :registration_completion_date + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'lti_version' => :'ltiVersion', + :'organization_id' => :'organizationId', + :'organization_name' => :'organizationName', + :'creator_id' => :'creatorId', + :'creation_date' => :'creationDate', + :'last_used_date' => :'lastUsedDate', + :'status' => :'status', + :'mode' => :'mode', + :'platform_iss' => :'platformIss', + :'platform_name' => :'platformName', + :'client_id' => :'clientId', + :'deployment_id' => :'deploymentId', + :'access_token_url' => :'accessTokenUrl', + :'authorization_url' => :'authorizationUrl', + :'jwks_url' => :'jwksUrl', + :'deployment_mode' => :'deploymentMode', + :'supported_services' => :'supportedServices', + :'tool' => :'tool', + :'public_keyset_url' => :'publicKeysetUrl', + :'initiate_login_url' => :'initiateLoginUrl', + :'redirect_uris' => :'redirectUris', + :'enable_email_matching' => :'enableEmailMatching', + :'registration_token' => :'registrationToken', + :'registration_url' => :'registrationUrl', + :'registration_token_used' => :'registrationTokenUsed', + :'registration_completion_date' => :'registrationCompletionDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'lti_version' => :'String', + :'organization_id' => :'String', + :'organization_name' => :'String', + :'creator_id' => :'String', + :'creation_date' => :'Time', + :'last_used_date' => :'Time', + :'status' => :'String', + :'mode' => :'String', + :'platform_iss' => :'String', + :'platform_name' => :'String', + :'client_id' => :'String', + :'deployment_id' => :'String', + :'access_token_url' => :'String', + :'authorization_url' => :'String', + :'jwks_url' => :'String', + :'deployment_mode' => :'String', + :'supported_services' => :'LtiConfiguration1p3BaseSupportedServices', + :'tool' => :'LtiConfiguration1p3BaseTool', + :'public_keyset_url' => :'String', + :'initiate_login_url' => :'String', + :'redirect_uris' => :'Array', + :'enable_email_matching' => :'Boolean', + :'registration_token' => :'String', + :'registration_url' => :'String', + :'registration_token_used' => :'Boolean', + :'registration_completion_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'registration_completion_date' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'LtiConfiguration1p3Base', + :'LtiConfigurationBase' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p3Dynamic` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p3Dynamic`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'lti_version') + self.lti_version = attributes[:'lti_version'] + else + self.lti_version = nil + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'organization_name') + self.organization_name = attributes[:'organization_name'] + end + + if attributes.key?(:'creator_id') + self.creator_id = attributes[:'creator_id'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + else + self.creation_date = nil + end + + if attributes.key?(:'last_used_date') + self.last_used_date = attributes[:'last_used_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'platform_iss') + self.platform_iss = attributes[:'platform_iss'] + end + + if attributes.key?(:'platform_name') + self.platform_name = attributes[:'platform_name'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + end + + if attributes.key?(:'access_token_url') + self.access_token_url = attributes[:'access_token_url'] + end + + if attributes.key?(:'authorization_url') + self.authorization_url = attributes[:'authorization_url'] + end + + if attributes.key?(:'jwks_url') + self.jwks_url = attributes[:'jwks_url'] + end + + if attributes.key?(:'deployment_mode') + self.deployment_mode = attributes[:'deployment_mode'] + end + + if attributes.key?(:'supported_services') + self.supported_services = attributes[:'supported_services'] + end + + if attributes.key?(:'tool') + self.tool = attributes[:'tool'] + end + + if attributes.key?(:'public_keyset_url') + self.public_keyset_url = attributes[:'public_keyset_url'] + end + + if attributes.key?(:'initiate_login_url') + self.initiate_login_url = attributes[:'initiate_login_url'] + end + + if attributes.key?(:'redirect_uris') + if (value = attributes[:'redirect_uris']).is_a?(Array) + self.redirect_uris = value + end + end + + if attributes.key?(:'enable_email_matching') + self.enable_email_matching = attributes[:'enable_email_matching'] + else + self.enable_email_matching = true + end + + if attributes.key?(:'registration_token') + self.registration_token = attributes[:'registration_token'] + end + + if attributes.key?(:'registration_url') + self.registration_url = attributes[:'registration_url'] + end + + if attributes.key?(:'registration_token_used') + self.registration_token_used = attributes[:'registration_token_used'] + end + + if attributes.key?(:'registration_completion_date') + self.registration_completion_date = attributes[:'registration_completion_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @lti_version.nil? + invalid_properties.push('invalid value for "lti_version", lti_version cannot be nil.') + end + + if @creation_date.nil? + invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @lti_version.nil? + lti_version_validator = EnumAttributeValidator.new('String', ["1p3"]) + return false unless lti_version_validator.valid?(@lti_version) + return false if @creation_date.nil? + status_validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + return false unless status_validator.valid?(@status) + mode_validator = EnumAttributeValidator.new('String', ["1p3-dynamic"]) + return false unless mode_validator.valid?(@mode) + deployment_mode_validator = EnumAttributeValidator.new('String', ["single", "multi"]) + return false unless deployment_mode_validator.valid?(@deployment_mode) + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] lti_version Object to be assigned + def lti_version=(lti_version) + validator = EnumAttributeValidator.new('String', ["1p3"]) + unless validator.valid?(lti_version) + fail ArgumentError, "invalid value for \"lti_version\", must be one of #{validator.allowable_values}." + end + @lti_version = lti_version + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ["1p3-dynamic"]) + unless validator.valid?(mode) + fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}." + end + @mode = mode + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] deployment_mode Object to be assigned + def deployment_mode=(deployment_mode) + validator = EnumAttributeValidator.new('String', ["single", "multi"]) + unless validator.valid?(deployment_mode) + fail ArgumentError, "invalid value for \"deployment_mode\", must be one of #{validator.allowable_values}." + end + @deployment_mode = deployment_mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + lti_version == o.lti_version && + organization_id == o.organization_id && + organization_name == o.organization_name && + creator_id == o.creator_id && + creation_date == o.creation_date && + last_used_date == o.last_used_date && + status == o.status && + mode == o.mode && + platform_iss == o.platform_iss && + platform_name == o.platform_name && + client_id == o.client_id && + deployment_id == o.deployment_id && + access_token_url == o.access_token_url && + authorization_url == o.authorization_url && + jwks_url == o.jwks_url && + deployment_mode == o.deployment_mode && + supported_services == o.supported_services && + tool == o.tool && + public_keyset_url == o.public_keyset_url && + initiate_login_url == o.initiate_login_url && + redirect_uris == o.redirect_uris && + enable_email_matching == o.enable_email_matching && + registration_token == o.registration_token && + registration_url == o.registration_url && + registration_token_used == o.registration_token_used && + registration_completion_date == o.registration_completion_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, lti_version, organization_id, organization_name, creator_id, creation_date, last_used_date, status, mode, platform_iss, platform_name, client_id, deployment_id, access_token_url, authorization_url, jwks_url, deployment_mode, supported_services, tool, public_keyset_url, initiate_login_url, redirect_uris, enable_email_matching, registration_token, registration_url, registration_token_used, registration_completion_date].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration1p3_manual.rb b/lib/flat_api/models/lti_configuration1p3_manual.rb new file mode 100644 index 0000000..21083cc --- /dev/null +++ b/lib/flat_api/models/lti_configuration1p3_manual.rb @@ -0,0 +1,489 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class LtiConfiguration1p3Manual < ApiModelBase + # Configuration ID + attr_accessor :id + + # LTI version (1.3) + attr_accessor :lti_version + + # Organization ID + attr_accessor :organization_id + + # Organization name + attr_accessor :organization_name + + # ID of the user who created this configuration + attr_accessor :creator_id + + # Configuration creation date + attr_accessor :creation_date + + # Last time this configuration was used + attr_accessor :last_used_date + + # Configuration status indicator + attr_accessor :status + + # Manual LTI 1.3 configuration mode + attr_accessor :mode + + # Platform issuer URL + attr_accessor :platform_iss + + # Platform display name + attr_accessor :platform_name + + # OAuth2 client_id allocated by the platform + attr_accessor :client_id + + # Deployment ID linking the tool to a tenant/class (varies by platform) + attr_accessor :deployment_id + + # OAuth2 token endpoint (for AGS/NRPS) + attr_accessor :access_token_url + + # OIDC authorization/login endpoint + attr_accessor :authorization_url + + # Platform JWKS endpoint (public keys) + attr_accessor :jwks_url + + # Deployment mode (single for organization-specific, multi for shared parent platforms) + attr_accessor :deployment_mode + + attr_accessor :supported_services + + attr_accessor :tool + + # Public keyset URL for the platform to retrieve Flat's public keys + attr_accessor :public_keyset_url + + # URL for the platform to initiate LTI login + attr_accessor :initiate_login_url + + # Allowed redirect URIs for LTI launches + attr_accessor :redirect_uris + + # 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. + attr_accessor :enable_email_matching + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'lti_version' => :'ltiVersion', + :'organization_id' => :'organizationId', + :'organization_name' => :'organizationName', + :'creator_id' => :'creatorId', + :'creation_date' => :'creationDate', + :'last_used_date' => :'lastUsedDate', + :'status' => :'status', + :'mode' => :'mode', + :'platform_iss' => :'platformIss', + :'platform_name' => :'platformName', + :'client_id' => :'clientId', + :'deployment_id' => :'deploymentId', + :'access_token_url' => :'accessTokenUrl', + :'authorization_url' => :'authorizationUrl', + :'jwks_url' => :'jwksUrl', + :'deployment_mode' => :'deploymentMode', + :'supported_services' => :'supportedServices', + :'tool' => :'tool', + :'public_keyset_url' => :'publicKeysetUrl', + :'initiate_login_url' => :'initiateLoginUrl', + :'redirect_uris' => :'redirectUris', + :'enable_email_matching' => :'enableEmailMatching' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'lti_version' => :'String', + :'organization_id' => :'String', + :'organization_name' => :'String', + :'creator_id' => :'String', + :'creation_date' => :'Time', + :'last_used_date' => :'Time', + :'status' => :'String', + :'mode' => :'String', + :'platform_iss' => :'String', + :'platform_name' => :'String', + :'client_id' => :'String', + :'deployment_id' => :'String', + :'access_token_url' => :'String', + :'authorization_url' => :'String', + :'jwks_url' => :'String', + :'deployment_mode' => :'String', + :'supported_services' => :'LtiConfiguration1p3BaseSupportedServices', + :'tool' => :'LtiConfiguration1p3BaseTool', + :'public_keyset_url' => :'String', + :'initiate_login_url' => :'String', + :'redirect_uris' => :'Array', + :'enable_email_matching' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'LtiConfiguration1p3Base', + :'LtiConfigurationBase' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfiguration1p3Manual` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfiguration1p3Manual`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'lti_version') + self.lti_version = attributes[:'lti_version'] + else + self.lti_version = nil + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'organization_name') + self.organization_name = attributes[:'organization_name'] + end + + if attributes.key?(:'creator_id') + self.creator_id = attributes[:'creator_id'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + else + self.creation_date = nil + end + + if attributes.key?(:'last_used_date') + self.last_used_date = attributes[:'last_used_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'platform_iss') + self.platform_iss = attributes[:'platform_iss'] + end + + if attributes.key?(:'platform_name') + self.platform_name = attributes[:'platform_name'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + end + + if attributes.key?(:'access_token_url') + self.access_token_url = attributes[:'access_token_url'] + end + + if attributes.key?(:'authorization_url') + self.authorization_url = attributes[:'authorization_url'] + end + + if attributes.key?(:'jwks_url') + self.jwks_url = attributes[:'jwks_url'] + end + + if attributes.key?(:'deployment_mode') + self.deployment_mode = attributes[:'deployment_mode'] + end + + if attributes.key?(:'supported_services') + self.supported_services = attributes[:'supported_services'] + end + + if attributes.key?(:'tool') + self.tool = attributes[:'tool'] + end + + if attributes.key?(:'public_keyset_url') + self.public_keyset_url = attributes[:'public_keyset_url'] + end + + if attributes.key?(:'initiate_login_url') + self.initiate_login_url = attributes[:'initiate_login_url'] + end + + if attributes.key?(:'redirect_uris') + if (value = attributes[:'redirect_uris']).is_a?(Array) + self.redirect_uris = value + end + end + + if attributes.key?(:'enable_email_matching') + self.enable_email_matching = attributes[:'enable_email_matching'] + else + self.enable_email_matching = true + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @lti_version.nil? + invalid_properties.push('invalid value for "lti_version", lti_version cannot be nil.') + end + + if @creation_date.nil? + invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @lti_version.nil? + lti_version_validator = EnumAttributeValidator.new('String', ["1p3"]) + return false unless lti_version_validator.valid?(@lti_version) + return false if @creation_date.nil? + status_validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + return false unless status_validator.valid?(@status) + mode_validator = EnumAttributeValidator.new('String', ["1p3-manual"]) + return false unless mode_validator.valid?(@mode) + deployment_mode_validator = EnumAttributeValidator.new('String', ["single", "multi"]) + return false unless deployment_mode_validator.valid?(@deployment_mode) + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] lti_version Object to be assigned + def lti_version=(lti_version) + validator = EnumAttributeValidator.new('String', ["1p3"]) + unless validator.valid?(lti_version) + fail ArgumentError, "invalid value for \"lti_version\", must be one of #{validator.allowable_values}." + end + @lti_version = lti_version + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ["1p3-manual"]) + unless validator.valid?(mode) + fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}." + end + @mode = mode + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] deployment_mode Object to be assigned + def deployment_mode=(deployment_mode) + validator = EnumAttributeValidator.new('String', ["single", "multi"]) + unless validator.valid?(deployment_mode) + fail ArgumentError, "invalid value for \"deployment_mode\", must be one of #{validator.allowable_values}." + end + @deployment_mode = deployment_mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + lti_version == o.lti_version && + organization_id == o.organization_id && + organization_name == o.organization_name && + creator_id == o.creator_id && + creation_date == o.creation_date && + last_used_date == o.last_used_date && + status == o.status && + mode == o.mode && + platform_iss == o.platform_iss && + platform_name == o.platform_name && + client_id == o.client_id && + deployment_id == o.deployment_id && + access_token_url == o.access_token_url && + authorization_url == o.authorization_url && + jwks_url == o.jwks_url && + deployment_mode == o.deployment_mode && + supported_services == o.supported_services && + tool == o.tool && + public_keyset_url == o.public_keyset_url && + initiate_login_url == o.initiate_login_url && + redirect_uris == o.redirect_uris && + enable_email_matching == o.enable_email_matching + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, lti_version, organization_id, organization_name, creator_id, creation_date, last_used_date, status, mode, platform_iss, platform_name, client_id, deployment_id, access_token_url, authorization_url, jwks_url, deployment_mode, supported_services, tool, public_keyset_url, initiate_login_url, redirect_uris, enable_email_matching].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration_base.rb b/lib/flat_api/models/lti_configuration_base.rb new file mode 100644 index 0000000..e1a87b3 --- /dev/null +++ b/lib/flat_api/models/lti_configuration_base.rb @@ -0,0 +1,306 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class LtiConfigurationBase < ApiModelBase + # Configuration ID + attr_accessor :id + + # LTI version + attr_accessor :lti_version + + # Organization ID + attr_accessor :organization_id + + # Organization name + attr_accessor :organization_name + + # ID of the user who created this configuration + attr_accessor :creator_id + + # Configuration creation date + attr_accessor :creation_date + + # Last time this configuration was used + attr_accessor :last_used_date + + # Configuration status indicator + attr_accessor :status + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'lti_version' => :'ltiVersion', + :'organization_id' => :'organizationId', + :'organization_name' => :'organizationName', + :'creator_id' => :'creatorId', + :'creation_date' => :'creationDate', + :'last_used_date' => :'lastUsedDate', + :'status' => :'status' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'lti_version' => :'String', + :'organization_id' => :'String', + :'organization_name' => :'String', + :'creator_id' => :'String', + :'creation_date' => :'Time', + :'last_used_date' => :'Time', + :'status' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'last_used_date', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfigurationBase` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfigurationBase`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'lti_version') + self.lti_version = attributes[:'lti_version'] + else + self.lti_version = nil + end + + if attributes.key?(:'organization_id') + self.organization_id = attributes[:'organization_id'] + end + + if attributes.key?(:'organization_name') + self.organization_name = attributes[:'organization_name'] + end + + if attributes.key?(:'creator_id') + self.creator_id = attributes[:'creator_id'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + else + self.creation_date = nil + end + + if attributes.key?(:'last_used_date') + self.last_used_date = attributes[:'last_used_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @lti_version.nil? + invalid_properties.push('invalid value for "lti_version", lti_version cannot be nil.') + end + + if @creation_date.nil? + invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @lti_version.nil? + lti_version_validator = EnumAttributeValidator.new('String', ["1p1", "1p3"]) + return false unless lti_version_validator.valid?(@lti_version) + return false if @creation_date.nil? + status_validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] lti_version Object to be assigned + def lti_version=(lti_version) + validator = EnumAttributeValidator.new('String', ["1p1", "1p3"]) + unless validator.valid?(lti_version) + fail ArgumentError, "invalid value for \"lti_version\", must be one of #{validator.allowable_values}." + end + @lti_version = lti_version + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ready-to-use", "in-use", "incomplete-setup"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + lti_version == o.lti_version && + organization_id == o.organization_id && + organization_name == o.organization_name && + creator_id == o.creator_id && + creation_date == o.creation_date && + last_used_date == o.last_used_date && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, lti_version, organization_id, organization_name, creator_id, creation_date, last_used_date, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration_create.rb b/lib/flat_api/models/lti_configuration_create.rb new file mode 100644 index 0000000..4692416 --- /dev/null +++ b/lib/flat_api/models/lti_configuration_create.rb @@ -0,0 +1,60 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Request to create a new LTI configuration (unified 1.1 and 1.3) + module LtiConfigurationCreate + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LtiConfigurationCreate1p1', + :'LtiConfigurationCreate1p3Deployment', + :'LtiConfigurationCreate1p3Dynamic', + :'LtiConfigurationCreate1p3Manual' + ] + end + + # Discriminator's property name (OpenAPI v3) + def openapi_discriminator_name + :'mode' + end + + # Discriminator's mapping (OpenAPI v3) + def openapi_discriminator_mapping + { + :'1p1-manual' => :'LtiConfigurationCreate1p1', + :'1p3-deployment' => :'LtiConfigurationCreate1p3Deployment', + :'1p3-dynamic' => :'LtiConfigurationCreate1p3Dynamic', + :'1p3-manual' => :'LtiConfigurationCreate1p3Manual' + } + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + discriminator_value = data[openapi_discriminator_name] + return nil if discriminator_value.nil? + + klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym] + return nil unless klass + + FlatApi.const_get(klass).build_from_hash(data) + end + end + end + +end diff --git a/lib/flat_api/models/lti_configuration_create1p1.rb b/lib/flat_api/models/lti_configuration_create1p1.rb new file mode 100644 index 0000000..fd31740 --- /dev/null +++ b/lib/flat_api/models/lti_configuration_create1p1.rb @@ -0,0 +1,210 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # LTI 1.1 manual configuration creation + class LtiConfigurationCreate1p1 < ApiModelBase + # LTI 1.1 manual creation mode + attr_accessor :mode + + # Display name for LTI 1.1 credentials + attr_accessor :name + + # LMS identifier for LTI 1.1 credentials + attr_accessor :lms + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'mode' => :'mode', + :'name' => :'name', + :'lms' => :'lms' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'mode' => :'String', + :'name' => :'String', + :'lms' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfigurationCreate1p1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfigurationCreate1p1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + else + self.mode = nil + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'lms') + self.lms = attributes[:'lms'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @mode.nil? + invalid_properties.push('invalid value for "mode", mode cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @mode.nil? + mode_validator = EnumAttributeValidator.new('String', ["1p1-manual"]) + return false unless mode_validator.valid?(@mode) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ["1p1-manual"]) + unless validator.valid?(mode) + fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}." + end + @mode = mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + mode == o.mode && + name == o.name && + lms == o.lms + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [mode, name, lms].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration_create1p3_deployment.rb b/lib/flat_api/models/lti_configuration_create1p3_deployment.rb new file mode 100644 index 0000000..81552bb --- /dev/null +++ b/lib/flat_api/models/lti_configuration_create1p3_deployment.rb @@ -0,0 +1,264 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # LTI 1.3 deployment-based configuration creation + class LtiConfigurationCreate1p3Deployment < ApiModelBase + # LTI 1.3 deployment-based creation mode + attr_accessor :mode + + # Parent platform key (e.g., canvas, blackboard, schoology, classlink) + attr_accessor :deployment_type + + # Deployment identifier provided by the platform + attr_accessor :deployment_id + + # OAuth2 client_id for the tenant; required for ClassLink deployments + attr_accessor :client_id + + # Value of the custom claim that identifies this specific tenant (for multi-tenant platforms like Schoology) + attr_accessor :deployment_breakdown_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'mode' => :'mode', + :'deployment_type' => :'deploymentType', + :'deployment_id' => :'deploymentId', + :'client_id' => :'clientId', + :'deployment_breakdown_id' => :'deploymentBreakdownId' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'mode' => :'String', + :'deployment_type' => :'String', + :'deployment_id' => :'String', + :'client_id' => :'String', + :'deployment_breakdown_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfigurationCreate1p3Deployment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfigurationCreate1p3Deployment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + else + self.mode = nil + end + + if attributes.key?(:'deployment_type') + self.deployment_type = attributes[:'deployment_type'] + else + self.deployment_type = nil + end + + if attributes.key?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + else + self.deployment_id = nil + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'deployment_breakdown_id') + self.deployment_breakdown_id = attributes[:'deployment_breakdown_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @mode.nil? + invalid_properties.push('invalid value for "mode", mode cannot be nil.') + end + + if @deployment_type.nil? + invalid_properties.push('invalid value for "deployment_type", deployment_type cannot be nil.') + end + + if @deployment_id.nil? + invalid_properties.push('invalid value for "deployment_id", deployment_id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @mode.nil? + mode_validator = EnumAttributeValidator.new('String', ["1p3-deployment"]) + return false unless mode_validator.valid?(@mode) + return false if @deployment_type.nil? + return false if @deployment_id.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ["1p3-deployment"]) + unless validator.valid?(mode) + fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}." + end + @mode = mode + end + + # Custom attribute writer method with validation + # @param [Object] deployment_type Value to be assigned + def deployment_type=(deployment_type) + if deployment_type.nil? + fail ArgumentError, 'deployment_type cannot be nil' + end + + @deployment_type = deployment_type + end + + # Custom attribute writer method with validation + # @param [Object] deployment_id Value to be assigned + def deployment_id=(deployment_id) + if deployment_id.nil? + fail ArgumentError, 'deployment_id cannot be nil' + end + + @deployment_id = deployment_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + mode == o.mode && + deployment_type == o.deployment_type && + deployment_id == o.deployment_id && + client_id == o.client_id && + deployment_breakdown_id == o.deployment_breakdown_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [mode, deployment_type, deployment_id, client_id, deployment_breakdown_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration_create1p3_dynamic.rb b/lib/flat_api/models/lti_configuration_create1p3_dynamic.rb new file mode 100644 index 0000000..7a8d5b3 --- /dev/null +++ b/lib/flat_api/models/lti_configuration_create1p3_dynamic.rb @@ -0,0 +1,209 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # LTI 1.3 dynamic registration configuration creation + class LtiConfigurationCreate1p3Dynamic < ApiModelBase + # LTI 1.3 dynamic registration mode + attr_accessor :mode + + attr_accessor :platform_info + + # Optional locale code for registration URL. Input values will be automatically normalized to a supported locale code. + attr_accessor :locale + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'mode' => :'mode', + :'platform_info' => :'platformInfo', + :'locale' => :'locale' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'mode' => :'String', + :'platform_info' => :'LtiConfigurationCreate1p3DynamicPlatformInfo', + :'locale' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfigurationCreate1p3Dynamic` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfigurationCreate1p3Dynamic`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + else + self.mode = nil + end + + if attributes.key?(:'platform_info') + self.platform_info = attributes[:'platform_info'] + end + + if attributes.key?(:'locale') + self.locale = attributes[:'locale'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @mode.nil? + invalid_properties.push('invalid value for "mode", mode cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @mode.nil? + mode_validator = EnumAttributeValidator.new('String', ["1p3-dynamic"]) + return false unless mode_validator.valid?(@mode) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ["1p3-dynamic"]) + unless validator.valid?(mode) + fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}." + end + @mode = mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + mode == o.mode && + platform_info == o.platform_info && + locale == o.locale + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [mode, platform_info, locale].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration_create1p3_dynamic_platform_info.rb b/lib/flat_api/models/lti_configuration_create1p3_dynamic_platform_info.rb new file mode 100644 index 0000000..c97e947 --- /dev/null +++ b/lib/flat_api/models/lti_configuration_create1p3_dynamic_platform_info.rb @@ -0,0 +1,159 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Optional platform information for dynamic registration + class LtiConfigurationCreate1p3DynamicPlatformInfo < ApiModelBase + # Platform display name + attr_accessor :name + + # Optional platform homepage or admin URL for reference + attr_accessor :url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'url' => :'url' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'url' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfigurationCreate1p3DynamicPlatformInfo` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfigurationCreate1p3DynamicPlatformInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + url == o.url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration_create1p3_manual.rb b/lib/flat_api/models/lti_configuration_create1p3_manual.rb new file mode 100644 index 0000000..1738f9b --- /dev/null +++ b/lib/flat_api/models/lti_configuration_create1p3_manual.rb @@ -0,0 +1,270 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # LTI 1.3 manual configuration creation + class LtiConfigurationCreate1p3Manual < ApiModelBase + # LTI 1.3 manual creation mode + attr_accessor :mode + + # Platform issuer URL + attr_accessor :platform_iss + + # Platform display name + attr_accessor :platform_name + + # OAuth2 client_id allocated by the platform + attr_accessor :client_id + + # Deployment identifier provided by the platform + attr_accessor :deployment_id + + # Platform access token endpoint URL + attr_accessor :access_token_url + + # Platform OIDC authorization endpoint URL + attr_accessor :authorization_url + + # Platform JWKS endpoint URL for public keys + attr_accessor :jwks_url + + # Enable email-based user matching during LTI authentication + attr_accessor :enable_email_matching + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'mode' => :'mode', + :'platform_iss' => :'platformIss', + :'platform_name' => :'platformName', + :'client_id' => :'clientId', + :'deployment_id' => :'deploymentId', + :'access_token_url' => :'accessTokenUrl', + :'authorization_url' => :'authorizationUrl', + :'jwks_url' => :'jwksUrl', + :'enable_email_matching' => :'enableEmailMatching' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'mode' => :'String', + :'platform_iss' => :'String', + :'platform_name' => :'String', + :'client_id' => :'String', + :'deployment_id' => :'String', + :'access_token_url' => :'String', + :'authorization_url' => :'String', + :'jwks_url' => :'String', + :'enable_email_matching' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfigurationCreate1p3Manual` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfigurationCreate1p3Manual`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + else + self.mode = nil + end + + if attributes.key?(:'platform_iss') + self.platform_iss = attributes[:'platform_iss'] + end + + if attributes.key?(:'platform_name') + self.platform_name = attributes[:'platform_name'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + end + + if attributes.key?(:'access_token_url') + self.access_token_url = attributes[:'access_token_url'] + end + + if attributes.key?(:'authorization_url') + self.authorization_url = attributes[:'authorization_url'] + end + + if attributes.key?(:'jwks_url') + self.jwks_url = attributes[:'jwks_url'] + end + + if attributes.key?(:'enable_email_matching') + self.enable_email_matching = attributes[:'enable_email_matching'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @mode.nil? + invalid_properties.push('invalid value for "mode", mode cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @mode.nil? + mode_validator = EnumAttributeValidator.new('String', ["1p3-manual"]) + return false unless mode_validator.valid?(@mode) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ["1p3-manual"]) + unless validator.valid?(mode) + fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}." + end + @mode = mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + mode == o.mode && + platform_iss == o.platform_iss && + platform_name == o.platform_name && + client_id == o.client_id && + deployment_id == o.deployment_id && + access_token_url == o.access_token_url && + authorization_url == o.authorization_url && + jwks_url == o.jwks_url && + enable_email_matching == o.enable_email_matching + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [mode, platform_iss, platform_name, client_id, deployment_id, access_token_url, authorization_url, jwks_url, enable_email_matching].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration_update.rb b/lib/flat_api/models/lti_configuration_update.rb new file mode 100644 index 0000000..c18fda4 --- /dev/null +++ b/lib/flat_api/models/lti_configuration_update.rb @@ -0,0 +1,104 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Update an existing LTI 1.3 configuration (deployment clone or standalone) + module LtiConfigurationUpdate + class << self + # List of class defined in anyOf (OpenAPI v3) + def openapi_any_of + [ + :'LtiConfigurationUpdateDeployment', + :'LtiConfigurationUpdateStandalone' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of anyOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of anyOf items and attempt to identify the appropriate one. + # Note: + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_any_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + return find_and_cast_into_type(klass, data) + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_any_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.iso8601(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = FlatApi.const_get(klass) + if const + if const.respond_to?(:openapi_any_of) # nested anyOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/flat_api/models/lti_configuration_update_deployment.rb b/lib/flat_api/models/lti_configuration_update_deployment.rb new file mode 100644 index 0000000..688f258 --- /dev/null +++ b/lib/flat_api/models/lti_configuration_update_deployment.rb @@ -0,0 +1,169 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Update fields allowed for deployment-based configurations + class LtiConfigurationUpdateDeployment < ApiModelBase + # Deployment identifier provided by the platform + attr_accessor :deployment_id + + # Specific tenant identifier for multi-tenant platforms + attr_accessor :deployment_breakdown_id + + # Enable email-based user matching during LTI authentication + attr_accessor :enable_email_matching + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'deployment_id' => :'deploymentId', + :'deployment_breakdown_id' => :'deploymentBreakdownId', + :'enable_email_matching' => :'enableEmailMatching' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'deployment_id' => :'String', + :'deployment_breakdown_id' => :'String', + :'enable_email_matching' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfigurationUpdateDeployment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfigurationUpdateDeployment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + end + + if attributes.key?(:'deployment_breakdown_id') + self.deployment_breakdown_id = attributes[:'deployment_breakdown_id'] + end + + if attributes.key?(:'enable_email_matching') + self.enable_email_matching = attributes[:'enable_email_matching'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deployment_id == o.deployment_id && + deployment_breakdown_id == o.deployment_breakdown_id && + enable_email_matching == o.enable_email_matching + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [deployment_id, deployment_breakdown_id, enable_email_matching].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_configuration_update_standalone.rb b/lib/flat_api/models/lti_configuration_update_standalone.rb new file mode 100644 index 0000000..5aa5715 --- /dev/null +++ b/lib/flat_api/models/lti_configuration_update_standalone.rb @@ -0,0 +1,219 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Update fields allowed for standalone (manual/dynamic) configurations + class LtiConfigurationUpdateStandalone < ApiModelBase + # Deployment identifier provided by the platform + attr_accessor :deployment_id + + # Platform issuer URL + attr_accessor :platform_iss + + # Platform display name + attr_accessor :platform_name + + # OAuth2 client_id allocated by the platform + attr_accessor :client_id + + # Platform access token endpoint URL + attr_accessor :access_token_url + + # Platform OIDC authorization endpoint URL + attr_accessor :authorization_url + + # Platform JWKS endpoint URL for public keys + attr_accessor :jwks_url + + # Enable email-based user matching during LTI authentication + attr_accessor :enable_email_matching + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'deployment_id' => :'deploymentId', + :'platform_iss' => :'platformIss', + :'platform_name' => :'platformName', + :'client_id' => :'clientId', + :'access_token_url' => :'accessTokenUrl', + :'authorization_url' => :'authorizationUrl', + :'jwks_url' => :'jwksUrl', + :'enable_email_matching' => :'enableEmailMatching' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'deployment_id' => :'String', + :'platform_iss' => :'String', + :'platform_name' => :'String', + :'client_id' => :'String', + :'access_token_url' => :'String', + :'authorization_url' => :'String', + :'jwks_url' => :'String', + :'enable_email_matching' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::LtiConfigurationUpdateStandalone` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiConfigurationUpdateStandalone`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'deployment_id') + self.deployment_id = attributes[:'deployment_id'] + end + + if attributes.key?(:'platform_iss') + self.platform_iss = attributes[:'platform_iss'] + end + + if attributes.key?(:'platform_name') + self.platform_name = attributes[:'platform_name'] + end + + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'access_token_url') + self.access_token_url = attributes[:'access_token_url'] + end + + if attributes.key?(:'authorization_url') + self.authorization_url = attributes[:'authorization_url'] + end + + if attributes.key?(:'jwks_url') + self.jwks_url = attributes[:'jwks_url'] + end + + if attributes.key?(:'enable_email_matching') + self.enable_email_matching = attributes[:'enable_email_matching'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deployment_id == o.deployment_id && + platform_iss == o.platform_iss && + platform_name == o.platform_name && + client_id == o.client_id && + access_token_url == o.access_token_url && + authorization_url == o.authorization_url && + jwks_url == o.jwks_url && + enable_email_matching == o.enable_email_matching + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [deployment_id, platform_iss, platform_name, client_id, access_token_url, authorization_url, jwks_url, enable_email_matching].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/lti_credentials.rb b/lib/flat_api/models/lti_credentials.rb index a513ddd..094d935 100644 --- a/lib/flat_api/models/lti_credentials.rb +++ b/lib/flat_api/models/lti_credentials.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A couple of LTI 1.x OAuth credentials - class LtiCredentials + class LtiCredentials < ApiModelBase # The unique identifier of this couple of credentials attr_accessor :id @@ -42,6 +42,9 @@ class LtiCredentials # OAuth 1 Consumer Secret attr_accessor :consumer_secret + # 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. + attr_accessor :enable_email_matching + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -75,13 +78,19 @@ def self.attribute_map :'creation_date' => :'creationDate', :'last_usage' => :'lastUsage', :'consumer_key' => :'consumerKey', - :'consumer_secret' => :'consumerSecret' + :'consumer_secret' => :'consumerSecret', + :'enable_email_matching' => :'enableEmailMatching' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -95,7 +104,8 @@ def self.openapi_types :'creation_date' => :'Time', :'last_usage' => :'Time', :'consumer_key' => :'String', - :'consumer_secret' => :'String' + :'consumer_secret' => :'String', + :'enable_email_matching' => :'Boolean' } end @@ -113,9 +123,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiCredentials`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiCredentials`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -155,6 +166,12 @@ def initialize(attributes = {}) if attributes.key?(:'consumer_secret') self.consumer_secret = attributes[:'consumer_secret'] end + + if attributes.key?(:'enable_email_matching') + self.enable_email_matching = attributes[:'enable_email_matching'] + else + self.enable_email_matching = true + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -185,7 +202,8 @@ def ==(o) creation_date == o.creation_date && last_usage == o.last_usage && consumer_key == o.consumer_key && - consumer_secret == o.consumer_secret + consumer_secret == o.consumer_secret && + enable_email_matching == o.enable_email_matching end # @see the `==` method @@ -197,7 +215,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, name, lms, organization, creator, creation_date, last_usage, consumer_key, consumer_secret].hash + [id, name, lms, organization, creator, creation_date, last_usage, consumer_key, consumer_secret, enable_email_matching].hash end # Builds the object from hash @@ -223,61 +241,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -294,24 +257,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/lti_credentials_creation.rb b/lib/flat_api/models/lti_credentials_creation.rb index a84e16c..93cad3d 100644 --- a/lib/flat_api/models/lti_credentials_creation.rb +++ b/lib/flat_api/models/lti_credentials_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Creation of a couple of LTI 1.x OAuth credentials - class LtiCredentialsCreation + class LtiCredentialsCreation < ApiModelBase # Name of the couple of credentials attr_accessor :name @@ -51,9 +51,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -78,9 +83,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiCredentialsCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::LtiCredentialsCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -142,6 +148,16 @@ def name=(name) @name = name end + # Custom attribute writer method with validation + # @param [Object] lms Value to be assigned + def lms=(lms) + if lms.nil? + fail ArgumentError, 'lms cannot be nil' + end + + @lms = lms + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -186,61 +202,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -257,24 +218,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/media_attachment.rb b/lib/flat_api/models/media_attachment.rb index 07d502a..44c6a10 100644 --- a/lib/flat_api/models/media_attachment.rb +++ b/lib/flat_api/models/media_attachment.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Media attachment. The API will automatically resolve the details, oEmbed, and media available if possible and return them in this object - class MediaAttachment + class MediaAttachment < ApiModelBase # 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. attr_accessor :type @@ -34,6 +34,9 @@ class MediaAttachment # A unique track identifier attr_accessor :track + # The UUID of the instrument part selected for this attachment (for performance submissions) + attr_accessor :part_uuid + attr_accessor :sharing_mode # 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. @@ -81,6 +84,9 @@ class MediaAttachment # The ID of the Google Drive File attr_accessor :google_drive_file_id + # If true, this attachment is only visible to teachers. When students view the assignment, attachments with this flag will be filtered out. + attr_accessor :teacher_only + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -112,6 +118,7 @@ def self.attribute_map :'worksheet' => :'worksheet', :'dedicated' => :'dedicated', :'track' => :'track', + :'part_uuid' => :'partUuid', :'sharing_mode' => :'sharingMode', :'lock_score_template' => :'lockScoreTemplate', :'title' => :'title', @@ -127,13 +134,19 @@ def self.attribute_map :'author_url' => :'authorUrl', :'icon_url' => :'iconUrl', :'mime_type' => :'mimeType', - :'google_drive_file_id' => :'googleDriveFileId' + :'google_drive_file_id' => :'googleDriveFileId', + :'teacher_only' => :'teacherOnly' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -145,13 +158,14 @@ def self.openapi_types :'worksheet' => :'String', :'dedicated' => :'Boolean', :'track' => :'String', + :'part_uuid' => :'String', :'sharing_mode' => :'MediaScoreSharingMode', :'lock_score_template' => :'Boolean', :'title' => :'String', :'description' => :'String', :'html' => :'String', - :'html_width' => :'String', - :'html_height' => :'String', + :'html_width' => :'Float', + :'html_height' => :'Float', :'url' => :'String', :'thumbnail_url' => :'String', :'thumbnail_width' => :'Integer', @@ -160,7 +174,8 @@ def self.openapi_types :'author_url' => :'String', :'icon_url' => :'String', :'mime_type' => :'String', - :'google_drive_file_id' => :'String' + :'google_drive_file_id' => :'String', + :'teacher_only' => :'Boolean' } end @@ -178,9 +193,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::MediaAttachment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::MediaAttachment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -211,6 +227,10 @@ def initialize(attributes = {}) self.track = attributes[:'track'] end + if attributes.key?(:'part_uuid') + self.part_uuid = attributes[:'part_uuid'] + end + if attributes.key?(:'sharing_mode') self.sharing_mode = attributes[:'sharing_mode'] else @@ -276,6 +296,12 @@ def initialize(attributes = {}) if attributes.key?(:'google_drive_file_id') self.google_drive_file_id = attributes[:'google_drive_file_id'] end + + if attributes.key?(:'teacher_only') + self.teacher_only = attributes[:'teacher_only'] + else + self.teacher_only = false + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -295,7 +321,7 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet", "performance"]) + type_validator = EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet"]) return false unless type_validator.valid?(@type) true end @@ -303,7 +329,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet", "performance"]) + validator = EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -321,6 +347,7 @@ def ==(o) worksheet == o.worksheet && dedicated == o.dedicated && track == o.track && + part_uuid == o.part_uuid && sharing_mode == o.sharing_mode && lock_score_template == o.lock_score_template && title == o.title && @@ -336,7 +363,8 @@ def ==(o) author_url == o.author_url && icon_url == o.icon_url && mime_type == o.mime_type && - google_drive_file_id == o.google_drive_file_id + google_drive_file_id == o.google_drive_file_id && + teacher_only == o.teacher_only end # @see the `==` method @@ -348,7 +376,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, score, revision, worksheet, dedicated, track, sharing_mode, lock_score_template, title, description, html, html_width, html_height, url, thumbnail_url, thumbnail_width, thumbnail_height, author_name, author_url, icon_url, mime_type, google_drive_file_id].hash + [type, score, revision, worksheet, dedicated, track, part_uuid, sharing_mode, lock_score_template, title, description, html, html_width, html_height, url, thumbnail_url, thumbnail_width, thumbnail_height, author_name, author_url, icon_url, mime_type, google_drive_file_id, teacher_only].hash end # Builds the object from hash @@ -374,61 +402,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -445,24 +418,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/media_score_sharing_mode.rb b/lib/flat_api/models/media_score_sharing_mode.rb index f08939e..9a7dc47 100644 --- a/lib/flat_api/models/media_score_sharing_mode.rb +++ b/lib/flat_api/models/media_score_sharing_mode.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/microsoft_graph_assignment.rb b/lib/flat_api/models/microsoft_graph_assignment.rb index 937c2df..285d4d9 100644 --- a/lib/flat_api/models/microsoft_graph_assignment.rb +++ b/lib/flat_api/models/microsoft_graph_assignment.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,33 +14,72 @@ require 'time' module FlatApi - # A Microsoft Teams asignment - class MicrosoftGraphAssignment - # Identifier of the assignement assigned by Microsoft Teams + # A Microsoft Teams assignment + class MicrosoftGraphAssignment < ApiModelBase + # Identifier of the assignment assigned by Microsoft Teams attr_accessor :id - # State of the assignment + # 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 attr_accessor :state - # Absolute link to this assignement in the Microsoft Teams web UI + # Absolute link to this assignment in the Microsoft Teams web UI attr_accessor :alternate_link + # 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. + attr_accessor :assign_date_time + # List of categories where this assignment is published under attr_accessor :categories + # 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 + attr_accessor :assign_to_type + + # 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. + attr_accessor :assigned_students_ms_ids + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', :'state' => :'state', :'alternate_link' => :'alternateLink', - :'categories' => :'categories' + :'assign_date_time' => :'assignDateTime', + :'categories' => :'categories', + :'assign_to_type' => :'assignToType', + :'assigned_students_ms_ids' => :'assignedStudentsMsIds' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -49,7 +88,10 @@ def self.openapi_types :'id' => :'String', :'state' => :'String', :'alternate_link' => :'String', - :'categories' => :'Array' + :'assign_date_time' => :'Time', + :'categories' => :'Array', + :'assign_to_type' => :'String', + :'assigned_students_ms_ids' => :'Array' } end @@ -67,9 +109,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::MicrosoftGraphAssignment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::MicrosoftGraphAssignment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -86,11 +129,25 @@ def initialize(attributes = {}) self.alternate_link = attributes[:'alternate_link'] end + if attributes.key?(:'assign_date_time') + self.assign_date_time = attributes[:'assign_date_time'] + end + if attributes.key?(:'categories') if (value = attributes[:'categories']).is_a?(Array) self.categories = value end end + + if attributes.key?(:'assign_to_type') + self.assign_to_type = attributes[:'assign_to_type'] + end + + if attributes.key?(:'assigned_students_ms_ids') + if (value = attributes[:'assigned_students_ms_ids']).is_a?(Array) + self.assigned_students_ms_ids = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -105,9 +162,33 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + state_validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "published", "assigned", "inactive"]) + return false unless state_validator.valid?(@state) + assign_to_type_validator = EnumAttributeValidator.new('String', ["class", "individual"]) + return false unless assign_to_type_validator.valid?(@assign_to_type) true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] state Object to be assigned + def state=(state) + validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "published", "assigned", "inactive"]) + unless validator.valid?(state) + fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}." + end + @state = state + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] assign_to_type Object to be assigned + def assign_to_type=(assign_to_type) + validator = EnumAttributeValidator.new('String', ["class", "individual"]) + unless validator.valid?(assign_to_type) + fail ArgumentError, "invalid value for \"assign_to_type\", must be one of #{validator.allowable_values}." + end + @assign_to_type = assign_to_type + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -116,7 +197,10 @@ def ==(o) id == o.id && state == o.state && alternate_link == o.alternate_link && - categories == o.categories + assign_date_time == o.assign_date_time && + categories == o.categories && + assign_to_type == o.assign_to_type && + assigned_students_ms_ids == o.assigned_students_ms_ids end # @see the `==` method @@ -128,7 +212,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, state, alternate_link, categories].hash + [id, state, alternate_link, assign_date_time, categories, assign_to_type, assigned_students_ms_ids].hash end # Builds the object from hash @@ -154,61 +238,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -225,24 +254,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/microsoft_graph_submission.rb b/lib/flat_api/models/microsoft_graph_submission.rb index 6fc30c4..b1e7c22 100644 --- a/lib/flat_api/models/microsoft_graph_submission.rb +++ b/lib/flat_api/models/microsoft_graph_submission.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A Microsoft Teams submission - class MicrosoftGraphSubmission + class MicrosoftGraphSubmission < ApiModelBase # Identifier of the submission assigned by Microsoft Teams attr_accessor :id @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::MicrosoftGraphSubmission`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::MicrosoftGraphSubmission`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -102,6 +108,26 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] state Value to be assigned + def state=(state) + if state.nil? + fail ArgumentError, 'state cannot be nil' + end + + @state = state + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -146,61 +172,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -217,24 +188,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/omr_capabilities.rb b/lib/flat_api/models/omr_capabilities.rb new file mode 100644 index 0000000..4aae10a --- /dev/null +++ b/lib/flat_api/models/omr_capabilities.rb @@ -0,0 +1,480 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # What the account or app can do, for client feature-detection. + class OmrCapabilities < ApiModelBase + # Interactive steps this server supports. + attr_accessor :steps + + # Export formats available via `getOmrJobExport`. + attr_accessor :formats + + # Output destinations the account can use when creating a job. + attr_accessor :outputs + + # Maximum number of input files that can be added to a single job. + attr_accessor :max_files + + # Maximum number of pages allowed across all input files of a single job. + attr_accessor :max_pages + + # Maximum number of OMR jobs that can run in parallel for this account. + attr_accessor :max_parallel_jobs + + # Maximum size of a single file, in bytes. + attr_accessor :max_file_size + + # 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. + attr_accessor :accepted_mime_types + + # 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. + attr_accessor :accepted_extensions + + # Credits charged per page. + attr_accessor :cost_per_page + + # OMR credits remaining for the account. + attr_accessor :remaining_credits + + # 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. + attr_accessor :retention_days + + # 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. + attr_accessor :locales + + # 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. + attr_accessor :locales_details + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'steps' => :'steps', + :'formats' => :'formats', + :'outputs' => :'outputs', + :'max_files' => :'maxFiles', + :'max_pages' => :'maxPages', + :'max_parallel_jobs' => :'maxParallelJobs', + :'max_file_size' => :'maxFileSize', + :'accepted_mime_types' => :'acceptedMimeTypes', + :'accepted_extensions' => :'acceptedExtensions', + :'cost_per_page' => :'costPerPage', + :'remaining_credits' => :'remainingCredits', + :'retention_days' => :'retentionDays', + :'locales' => :'locales', + :'locales_details' => :'localesDetails' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'steps' => :'Array', + :'formats' => :'Array', + :'outputs' => :'Array', + :'max_files' => :'Integer', + :'max_pages' => :'Integer', + :'max_parallel_jobs' => :'Integer', + :'max_file_size' => :'Integer', + :'accepted_mime_types' => :'Array', + :'accepted_extensions' => :'Array', + :'cost_per_page' => :'Integer', + :'remaining_credits' => :'Integer', + :'retention_days' => :'Integer', + :'locales' => :'Array', + :'locales_details' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrCapabilities` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrCapabilities`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'steps') + if (value = attributes[:'steps']).is_a?(Array) + self.steps = value + end + else + self.steps = nil + end + + if attributes.key?(:'formats') + if (value = attributes[:'formats']).is_a?(Array) + self.formats = value + end + else + self.formats = nil + end + + if attributes.key?(:'outputs') + if (value = attributes[:'outputs']).is_a?(Array) + self.outputs = value + end + else + self.outputs = nil + end + + if attributes.key?(:'max_files') + self.max_files = attributes[:'max_files'] + else + self.max_files = nil + end + + if attributes.key?(:'max_pages') + self.max_pages = attributes[:'max_pages'] + else + self.max_pages = nil + end + + if attributes.key?(:'max_parallel_jobs') + self.max_parallel_jobs = attributes[:'max_parallel_jobs'] + else + self.max_parallel_jobs = nil + end + + if attributes.key?(:'max_file_size') + self.max_file_size = attributes[:'max_file_size'] + else + self.max_file_size = nil + end + + if attributes.key?(:'accepted_mime_types') + if (value = attributes[:'accepted_mime_types']).is_a?(Array) + self.accepted_mime_types = value + end + else + self.accepted_mime_types = nil + end + + if attributes.key?(:'accepted_extensions') + if (value = attributes[:'accepted_extensions']).is_a?(Array) + self.accepted_extensions = value + end + else + self.accepted_extensions = nil + end + + if attributes.key?(:'cost_per_page') + self.cost_per_page = attributes[:'cost_per_page'] + end + + if attributes.key?(:'remaining_credits') + self.remaining_credits = attributes[:'remaining_credits'] + end + + if attributes.key?(:'retention_days') + self.retention_days = attributes[:'retention_days'] + end + + if attributes.key?(:'locales') + if (value = attributes[:'locales']).is_a?(Array) + self.locales = value + end + else + self.locales = nil + end + + if attributes.key?(:'locales_details') + if (value = attributes[:'locales_details']).is_a?(Array) + self.locales_details = value + end + else + self.locales_details = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @steps.nil? + invalid_properties.push('invalid value for "steps", steps cannot be nil.') + end + + if @formats.nil? + invalid_properties.push('invalid value for "formats", formats cannot be nil.') + end + + if @outputs.nil? + invalid_properties.push('invalid value for "outputs", outputs cannot be nil.') + end + + if @max_files.nil? + invalid_properties.push('invalid value for "max_files", max_files cannot be nil.') + end + + if @max_pages.nil? + invalid_properties.push('invalid value for "max_pages", max_pages cannot be nil.') + end + + if @max_parallel_jobs.nil? + invalid_properties.push('invalid value for "max_parallel_jobs", max_parallel_jobs cannot be nil.') + end + + if @max_file_size.nil? + invalid_properties.push('invalid value for "max_file_size", max_file_size cannot be nil.') + end + + if @accepted_mime_types.nil? + invalid_properties.push('invalid value for "accepted_mime_types", accepted_mime_types cannot be nil.') + end + + if @accepted_extensions.nil? + invalid_properties.push('invalid value for "accepted_extensions", accepted_extensions cannot be nil.') + end + + if @locales.nil? + invalid_properties.push('invalid value for "locales", locales cannot be nil.') + end + + if @locales_details.nil? + invalid_properties.push('invalid value for "locales_details", locales_details cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @steps.nil? + return false if @formats.nil? + return false if @outputs.nil? + return false if @max_files.nil? + return false if @max_pages.nil? + return false if @max_parallel_jobs.nil? + return false if @max_file_size.nil? + return false if @accepted_mime_types.nil? + return false if @accepted_extensions.nil? + return false if @locales.nil? + return false if @locales_details.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] steps Value to be assigned + def steps=(steps) + if steps.nil? + fail ArgumentError, 'steps cannot be nil' + end + + @steps = steps + end + + # Custom attribute writer method with validation + # @param [Object] formats Value to be assigned + def formats=(formats) + if formats.nil? + fail ArgumentError, 'formats cannot be nil' + end + + @formats = formats + end + + # Custom attribute writer method with validation + # @param [Object] outputs Value to be assigned + def outputs=(outputs) + if outputs.nil? + fail ArgumentError, 'outputs cannot be nil' + end + + @outputs = outputs + end + + # Custom attribute writer method with validation + # @param [Object] max_files Value to be assigned + def max_files=(max_files) + if max_files.nil? + fail ArgumentError, 'max_files cannot be nil' + end + + @max_files = max_files + end + + # Custom attribute writer method with validation + # @param [Object] max_pages Value to be assigned + def max_pages=(max_pages) + if max_pages.nil? + fail ArgumentError, 'max_pages cannot be nil' + end + + @max_pages = max_pages + end + + # Custom attribute writer method with validation + # @param [Object] max_parallel_jobs Value to be assigned + def max_parallel_jobs=(max_parallel_jobs) + if max_parallel_jobs.nil? + fail ArgumentError, 'max_parallel_jobs cannot be nil' + end + + @max_parallel_jobs = max_parallel_jobs + end + + # Custom attribute writer method with validation + # @param [Object] max_file_size Value to be assigned + def max_file_size=(max_file_size) + if max_file_size.nil? + fail ArgumentError, 'max_file_size cannot be nil' + end + + @max_file_size = max_file_size + end + + # Custom attribute writer method with validation + # @param [Object] accepted_mime_types Value to be assigned + def accepted_mime_types=(accepted_mime_types) + if accepted_mime_types.nil? + fail ArgumentError, 'accepted_mime_types cannot be nil' + end + + @accepted_mime_types = accepted_mime_types + end + + # Custom attribute writer method with validation + # @param [Object] accepted_extensions Value to be assigned + def accepted_extensions=(accepted_extensions) + if accepted_extensions.nil? + fail ArgumentError, 'accepted_extensions cannot be nil' + end + + @accepted_extensions = accepted_extensions + end + + # Custom attribute writer method with validation + # @param [Object] locales Value to be assigned + def locales=(locales) + if locales.nil? + fail ArgumentError, 'locales cannot be nil' + end + + @locales = locales + end + + # Custom attribute writer method with validation + # @param [Object] locales_details Value to be assigned + def locales_details=(locales_details) + if locales_details.nil? + fail ArgumentError, 'locales_details cannot be nil' + end + + @locales_details = locales_details + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + steps == o.steps && + formats == o.formats && + outputs == o.outputs && + max_files == o.max_files && + max_pages == o.max_pages && + max_parallel_jobs == o.max_parallel_jobs && + max_file_size == o.max_file_size && + accepted_mime_types == o.accepted_mime_types && + accepted_extensions == o.accepted_extensions && + cost_per_page == o.cost_per_page && + remaining_credits == o.remaining_credits && + retention_days == o.retention_days && + locales == o.locales && + locales_details == o.locales_details + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [steps, formats, outputs, max_files, max_pages, max_parallel_jobs, max_file_size, accepted_mime_types, accepted_extensions, cost_per_page, remaining_credits, retention_days, locales, locales_details].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_details_step_data.rb b/lib/flat_api/models/omr_details_step_data.rb new file mode 100644 index 0000000..221e64f --- /dev/null +++ b/lib/flat_api/models/omr_details_step_data.rb @@ -0,0 +1,228 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # 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). + class OmrDetailsStepData < ApiModelBase + # Discriminator for `OmrPendingStep.data`; always `details` for this payload. + attr_accessor :step + + # OCR-detected work title. + attr_accessor :title + + attr_accessor :instruments + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'step' => :'step', + :'title' => :'title', + :'instruments' => :'instruments' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'step' => :'String', + :'title' => :'String', + :'instruments' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrDetailsStepData` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrDetailsStepData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'step') + self.step = attributes[:'step'] + else + self.step = nil + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'instruments') + if (value = attributes[:'instruments']).is_a?(Array) + self.instruments = value + end + else + self.instruments = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @step.nil? + invalid_properties.push('invalid value for "step", step cannot be nil.') + end + + if @instruments.nil? + invalid_properties.push('invalid value for "instruments", instruments cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @step.nil? + step_validator = EnumAttributeValidator.new('String', ["details"]) + return false unless step_validator.valid?(@step) + return false if @instruments.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] step Object to be assigned + def step=(step) + validator = EnumAttributeValidator.new('String', ["details"]) + unless validator.valid?(step) + fail ArgumentError, "invalid value for \"step\", must be one of #{validator.allowable_values}." + end + @step = step + end + + # Custom attribute writer method with validation + # @param [Object] instruments Value to be assigned + def instruments=(instruments) + if instruments.nil? + fail ArgumentError, 'instruments cannot be nil' + end + + @instruments = instruments + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + step == o.step && + title == o.title && + instruments == o.instruments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [step, title, instruments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_details_submission.rb b/lib/flat_api/models/omr_details_submission.rb new file mode 100644 index 0000000..03f996f --- /dev/null +++ b/lib/flat_api/models/omr_details_submission.rb @@ -0,0 +1,288 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Overrides for the `details` step. Omitted fields keep the server's detected values. + class OmrDetailsSubmission < ApiModelBase + # Discriminator for `OmrStepSubmission`; always `details` for this submission. + attr_accessor :step + + # Override the detected work title. + attr_accessor :title + + # 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. + attr_accessor :main_language + + # Per-part overrides, each matched to a detected part by `index`. + attr_accessor :instruments + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'step' => :'step', + :'title' => :'title', + :'main_language' => :'mainLanguage', + :'instruments' => :'instruments' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'step' => :'String', + :'title' => :'String', + :'main_language' => :'String', + :'instruments' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrDetailsSubmission` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrDetailsSubmission`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'step') + self.step = attributes[:'step'] + else + self.step = nil + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'main_language') + self.main_language = attributes[:'main_language'] + end + + if attributes.key?(:'instruments') + if (value = attributes[:'instruments']).is_a?(Array) + self.instruments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @step.nil? + invalid_properties.push('invalid value for "step", step cannot be nil.') + end + + if !@title.nil? && @title.to_s.length > 500 + invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 500.') + end + + if !@main_language.nil? && @main_language.to_s.length > 35 + invalid_properties.push('invalid value for "main_language", the character length must be smaller than or equal to 35.') + end + + if !@main_language.nil? && @main_language.to_s.length < 1 + invalid_properties.push('invalid value for "main_language", the character length must be greater than or equal to 1.') + end + + if !@instruments.nil? && @instruments.length > 200 + invalid_properties.push('invalid value for "instruments", number of items must be less than or equal to 200.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @step.nil? + step_validator = EnumAttributeValidator.new('String', ["details"]) + return false unless step_validator.valid?(@step) + return false if !@title.nil? && @title.to_s.length > 500 + return false if !@main_language.nil? && @main_language.to_s.length > 35 + return false if !@main_language.nil? && @main_language.to_s.length < 1 + return false if !@instruments.nil? && @instruments.length > 200 + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] step Object to be assigned + def step=(step) + validator = EnumAttributeValidator.new('String', ["details"]) + unless validator.valid?(step) + fail ArgumentError, "invalid value for \"step\", must be one of #{validator.allowable_values}." + end + @step = step + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.nil? + fail ArgumentError, 'title cannot be nil' + end + + if title.to_s.length > 500 + fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 500.' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] main_language Value to be assigned + def main_language=(main_language) + if main_language.nil? + fail ArgumentError, 'main_language cannot be nil' + end + + if main_language.to_s.length > 35 + fail ArgumentError, 'invalid value for "main_language", the character length must be smaller than or equal to 35.' + end + + if main_language.to_s.length < 1 + fail ArgumentError, 'invalid value for "main_language", the character length must be greater than or equal to 1.' + end + + @main_language = main_language + end + + # Custom attribute writer method with validation + # @param [Object] instruments Value to be assigned + def instruments=(instruments) + if instruments.nil? + fail ArgumentError, 'instruments cannot be nil' + end + + if instruments.length > 200 + fail ArgumentError, 'invalid value for "instruments", number of items must be less than or equal to 200.' + end + + @instruments = instruments + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + step == o.step && + title == o.title && + main_language == o.main_language && + instruments == o.instruments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [step, title, main_language, instruments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_detected_instrument.rb b/lib/flat_api/models/omr_detected_instrument.rb new file mode 100644 index 0000000..9586626 --- /dev/null +++ b/lib/flat_api/models/omr_detected_instrument.rb @@ -0,0 +1,260 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # One detected part. + class OmrDetectedInstrument < ApiModelBase + # 0-based position of the part in the score. + attr_accessor :index + + # Verbatim part name read from the score. + attr_accessor :part_name + + # 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. + attr_accessor :instrument_id + + # Localized display name, resolved server-side so the client needs no instruments dictionary. + attr_accessor :instrument_name + + # General MIDI program number. + attr_accessor :midi_program + + # Transposition or written key shown in the UI, for example `F` for Horn in F. + attr_accessor :transpose_key + + # Server confidence in the resolved instrument match. + attr_accessor :resolved_confidence + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'index' => :'index', + :'part_name' => :'partName', + :'instrument_id' => :'instrumentId', + :'instrument_name' => :'instrumentName', + :'midi_program' => :'midiProgram', + :'transpose_key' => :'transposeKey', + :'resolved_confidence' => :'resolvedConfidence' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'index' => :'Integer', + :'part_name' => :'String', + :'instrument_id' => :'String', + :'instrument_name' => :'String', + :'midi_program' => :'Integer', + :'transpose_key' => :'String', + :'resolved_confidence' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrDetectedInstrument` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrDetectedInstrument`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'index') + self.index = attributes[:'index'] + else + self.index = nil + end + + if attributes.key?(:'part_name') + self.part_name = attributes[:'part_name'] + end + + if attributes.key?(:'instrument_id') + self.instrument_id = attributes[:'instrument_id'] + end + + if attributes.key?(:'instrument_name') + self.instrument_name = attributes[:'instrument_name'] + end + + if attributes.key?(:'midi_program') + self.midi_program = attributes[:'midi_program'] + end + + if attributes.key?(:'transpose_key') + self.transpose_key = attributes[:'transpose_key'] + end + + if attributes.key?(:'resolved_confidence') + self.resolved_confidence = attributes[:'resolved_confidence'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @index.nil? + invalid_properties.push('invalid value for "index", index cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @index.nil? + resolved_confidence_validator = EnumAttributeValidator.new('String', ["high", "medium", "low"]) + return false unless resolved_confidence_validator.valid?(@resolved_confidence) + true + end + + # Custom attribute writer method with validation + # @param [Object] index Value to be assigned + def index=(index) + if index.nil? + fail ArgumentError, 'index cannot be nil' + end + + @index = index + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] resolved_confidence Object to be assigned + def resolved_confidence=(resolved_confidence) + validator = EnumAttributeValidator.new('String', ["high", "medium", "low"]) + unless validator.valid?(resolved_confidence) + fail ArgumentError, "invalid value for \"resolved_confidence\", must be one of #{validator.allowable_values}." + end + @resolved_confidence = resolved_confidence + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + index == o.index && + part_name == o.part_name && + instrument_id == o.instrument_id && + instrument_name == o.instrument_name && + midi_program == o.midi_program && + transpose_key == o.transpose_key && + resolved_confidence == o.resolved_confidence + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [index, part_name, instrument_id, instrument_name, midi_program, transpose_key, resolved_confidence].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_imported_metadata.rb b/lib/flat_api/models/omr_imported_metadata.rb new file mode 100644 index 0000000..8bee38f --- /dev/null +++ b/lib/flat_api/models/omr_imported_metadata.rb @@ -0,0 +1,181 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Metadata extracted from the recognized score. + class OmrImportedMetadata < ApiModelBase + # Instrument IDs of the assembled parts. + attr_accessor :instruments + + # Number of measures in the recognized score. + attr_accessor :number_measures + + # Main tempo, in quarter notes per minute. + attr_accessor :main_tempo_qpm + + # Main key signature as a fifths count (negative for flats, positive for sharps, 0 for C major / A minor). + attr_accessor :main_key_signature + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'instruments' => :'instruments', + :'number_measures' => :'numberMeasures', + :'main_tempo_qpm' => :'mainTempoQpm', + :'main_key_signature' => :'mainKeySignature' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'instruments' => :'Array', + :'number_measures' => :'Integer', + :'main_tempo_qpm' => :'Float', + :'main_key_signature' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrImportedMetadata` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrImportedMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'instruments') + if (value = attributes[:'instruments']).is_a?(Array) + self.instruments = value + end + end + + if attributes.key?(:'number_measures') + self.number_measures = attributes[:'number_measures'] + end + + if attributes.key?(:'main_tempo_qpm') + self.main_tempo_qpm = attributes[:'main_tempo_qpm'] + end + + if attributes.key?(:'main_key_signature') + self.main_key_signature = attributes[:'main_key_signature'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + instruments == o.instruments && + number_measures == o.number_measures && + main_tempo_qpm == o.main_tempo_qpm && + main_key_signature == o.main_key_signature + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [instruments, number_measures, main_tempo_qpm, main_key_signature].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_instrument_override.rb b/lib/flat_api/models/omr_instrument_override.rb new file mode 100644 index 0000000..379982b --- /dev/null +++ b/lib/flat_api/models/omr_instrument_override.rb @@ -0,0 +1,311 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # 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. + class OmrInstrumentOverride < ApiModelBase + # 0-based position of the part to override, matching the `index` of the detected part. + attr_accessor :index + + # 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. + attr_accessor :instrument_id + + # Override the part name. + attr_accessor :part_name + + # 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`. + attr_accessor :transpose_key + + # 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. + attr_accessor :midi_program + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'index' => :'index', + :'instrument_id' => :'instrumentId', + :'part_name' => :'partName', + :'transpose_key' => :'transposeKey', + :'midi_program' => :'midiProgram' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'index' => :'Integer', + :'instrument_id' => :'String', + :'part_name' => :'String', + :'transpose_key' => :'String', + :'midi_program' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrInstrumentOverride` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrInstrumentOverride`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'index') + self.index = attributes[:'index'] + else + self.index = nil + end + + if attributes.key?(:'instrument_id') + self.instrument_id = attributes[:'instrument_id'] + end + + if attributes.key?(:'part_name') + self.part_name = attributes[:'part_name'] + end + + if attributes.key?(:'transpose_key') + self.transpose_key = attributes[:'transpose_key'] + end + + if attributes.key?(:'midi_program') + self.midi_program = attributes[:'midi_program'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @index.nil? + invalid_properties.push('invalid value for "index", index cannot be nil.') + end + + if @index < 0 + invalid_properties.push('invalid value for "index", must be greater than or equal to 0.') + end + + if !@instrument_id.nil? && @instrument_id.to_s.length > 100 + invalid_properties.push('invalid value for "instrument_id", the character length must be smaller than or equal to 100.') + end + + if !@instrument_id.nil? && @instrument_id.to_s.length < 1 + invalid_properties.push('invalid value for "instrument_id", the character length must be greater than or equal to 1.') + end + + if !@part_name.nil? && @part_name.to_s.length > 200 + invalid_properties.push('invalid value for "part_name", the character length must be smaller than or equal to 200.') + end + + pattern = Regexp.new(/^[A-G][b♭#♯]?$/) + if !@transpose_key.nil? && @transpose_key !~ pattern + invalid_properties.push("invalid value for \"transpose_key\", must conform to the pattern #{pattern}.") + end + + if !@midi_program.nil? && @midi_program > 127 + invalid_properties.push('invalid value for "midi_program", must be smaller than or equal to 127.') + end + + if !@midi_program.nil? && @midi_program < 0 + invalid_properties.push('invalid value for "midi_program", must be greater than or equal to 0.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @index.nil? + return false if @index < 0 + return false if !@instrument_id.nil? && @instrument_id.to_s.length > 100 + return false if !@instrument_id.nil? && @instrument_id.to_s.length < 1 + return false if !@part_name.nil? && @part_name.to_s.length > 200 + return false if !@transpose_key.nil? && @transpose_key !~ Regexp.new(/^[A-G][b♭#♯]?$/) + return false if !@midi_program.nil? && @midi_program > 127 + return false if !@midi_program.nil? && @midi_program < 0 + true + end + + # Custom attribute writer method with validation + # @param [Object] index Value to be assigned + def index=(index) + if index.nil? + fail ArgumentError, 'index cannot be nil' + end + + if index < 0 + fail ArgumentError, 'invalid value for "index", must be greater than or equal to 0.' + end + + @index = index + end + + # Custom attribute writer method with validation + # @param [Object] instrument_id Value to be assigned + def instrument_id=(instrument_id) + if instrument_id.nil? + fail ArgumentError, 'instrument_id cannot be nil' + end + + if instrument_id.to_s.length > 100 + fail ArgumentError, 'invalid value for "instrument_id", the character length must be smaller than or equal to 100.' + end + + if instrument_id.to_s.length < 1 + fail ArgumentError, 'invalid value for "instrument_id", the character length must be greater than or equal to 1.' + end + + @instrument_id = instrument_id + end + + # Custom attribute writer method with validation + # @param [Object] part_name Value to be assigned + def part_name=(part_name) + if part_name.nil? + fail ArgumentError, 'part_name cannot be nil' + end + + if part_name.to_s.length > 200 + fail ArgumentError, 'invalid value for "part_name", the character length must be smaller than or equal to 200.' + end + + @part_name = part_name + end + + # Custom attribute writer method with validation + # @param [Object] transpose_key Value to be assigned + def transpose_key=(transpose_key) + if transpose_key.nil? + fail ArgumentError, 'transpose_key cannot be nil' + end + + pattern = Regexp.new(/^[A-G][b♭#♯]?$/) + if transpose_key !~ pattern + fail ArgumentError, "invalid value for \"transpose_key\", must conform to the pattern #{pattern}." + end + + @transpose_key = transpose_key + end + + # Custom attribute writer method with validation + # @param [Object] midi_program Value to be assigned + def midi_program=(midi_program) + if midi_program.nil? + fail ArgumentError, 'midi_program cannot be nil' + end + + if midi_program > 127 + fail ArgumentError, 'invalid value for "midi_program", must be smaller than or equal to 127.' + end + + if midi_program < 0 + fail ArgumentError, 'invalid value for "midi_program", must be greater than or equal to 0.' + end + + @midi_program = midi_program + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + index == o.index && + instrument_id == o.instrument_id && + part_name == o.part_name && + transpose_key == o.transpose_key && + midi_program == o.midi_program + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [index, instrument_id, part_name, transpose_key, midi_program].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job.rb b/lib/flat_api/models/omr_job.rb new file mode 100644 index 0000000..a36bce5 --- /dev/null +++ b/lib/flat_api/models/omr_job.rb @@ -0,0 +1,394 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class OmrJob < ApiModelBase + # Unique identifier of the OMR job. + attr_accessor :id + + attr_accessor :status + + attr_accessor :output + + # Steps this job pauses at for client input, echoing the value set at creation. + attr_accessor :interactive_steps + + # Locale hints (BCP 47) the job was created with, used for OCR and as the default main language at the `details` step. + attr_accessor :locales + + # The pending step when `status` is `awaitingInput`. Omitted otherwise. + attr_accessor :current_step + + attr_accessor :pending_step + + # Credits that will be or were charged at start (page-based), so a client can show a confirmation before charging. + attr_accessor :estimated_credits + + attr_accessor :progress + + attr_accessor :original_file_metadata + + attr_accessor :imported_metadata + + attr_accessor :result + + attr_accessor :retention + + # 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. + attr_accessor :error_code + + # 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. + attr_accessor :error_message + + # When the job was created. + attr_accessor :creation_date + + # When the job was last updated. + attr_accessor :modification_date + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'status' => :'status', + :'output' => :'output', + :'interactive_steps' => :'interactiveSteps', + :'locales' => :'locales', + :'current_step' => :'currentStep', + :'pending_step' => :'pendingStep', + :'estimated_credits' => :'estimatedCredits', + :'progress' => :'progress', + :'original_file_metadata' => :'originalFileMetadata', + :'imported_metadata' => :'importedMetadata', + :'result' => :'result', + :'retention' => :'retention', + :'error_code' => :'errorCode', + :'error_message' => :'errorMessage', + :'creation_date' => :'creationDate', + :'modification_date' => :'modificationDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'status' => :'OmrJobStatus', + :'output' => :'OmrJobOutput', + :'interactive_steps' => :'Array', + :'locales' => :'Array', + :'current_step' => :'OmrStepName', + :'pending_step' => :'OmrPendingStep', + :'estimated_credits' => :'Integer', + :'progress' => :'OmrJobProgress', + :'original_file_metadata' => :'OmrJobFileMetadata', + :'imported_metadata' => :'OmrImportedMetadata', + :'result' => :'OmrJobResult', + :'retention' => :'OmrJobRetention', + :'error_code' => :'String', + :'error_message' => :'String', + :'creation_date' => :'Time', + :'modification_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJob` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJob`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'output') + self.output = attributes[:'output'] + else + self.output = 'library' + end + + if attributes.key?(:'interactive_steps') + if (value = attributes[:'interactive_steps']).is_a?(Array) + self.interactive_steps = value + end + else + self.interactive_steps = nil + end + + if attributes.key?(:'locales') + if (value = attributes[:'locales']).is_a?(Array) + self.locales = value + end + end + + if attributes.key?(:'current_step') + self.current_step = attributes[:'current_step'] + end + + if attributes.key?(:'pending_step') + self.pending_step = attributes[:'pending_step'] + end + + if attributes.key?(:'estimated_credits') + self.estimated_credits = attributes[:'estimated_credits'] + end + + if attributes.key?(:'progress') + self.progress = attributes[:'progress'] + end + + if attributes.key?(:'original_file_metadata') + self.original_file_metadata = attributes[:'original_file_metadata'] + end + + if attributes.key?(:'imported_metadata') + self.imported_metadata = attributes[:'imported_metadata'] + end + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'retention') + self.retention = attributes[:'retention'] + end + + if attributes.key?(:'error_code') + self.error_code = attributes[:'error_code'] + end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'creation_date') + self.creation_date = attributes[:'creation_date'] + end + + if attributes.key?(:'modification_date') + self.modification_date = attributes[:'modification_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @output.nil? + invalid_properties.push('invalid value for "output", output cannot be nil.') + end + + if @interactive_steps.nil? + invalid_properties.push('invalid value for "interactive_steps", interactive_steps cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @status.nil? + return false if @output.nil? + return false if @interactive_steps.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] status Value to be assigned + def status=(status) + if status.nil? + fail ArgumentError, 'status cannot be nil' + end + + @status = status + end + + # Custom attribute writer method with validation + # @param [Object] output Value to be assigned + def output=(output) + if output.nil? + fail ArgumentError, 'output cannot be nil' + end + + @output = output + end + + # Custom attribute writer method with validation + # @param [Object] interactive_steps Value to be assigned + def interactive_steps=(interactive_steps) + if interactive_steps.nil? + fail ArgumentError, 'interactive_steps cannot be nil' + end + + @interactive_steps = interactive_steps + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + status == o.status && + output == o.output && + interactive_steps == o.interactive_steps && + locales == o.locales && + current_step == o.current_step && + pending_step == o.pending_step && + estimated_credits == o.estimated_credits && + progress == o.progress && + original_file_metadata == o.original_file_metadata && + imported_metadata == o.imported_metadata && + result == o.result && + retention == o.retention && + error_code == o.error_code && + error_message == o.error_message && + creation_date == o.creation_date && + modification_date == o.modification_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, status, output, interactive_steps, locales, current_step, pending_step, estimated_credits, progress, original_file_metadata, imported_metadata, result, retention, error_code, error_message, creation_date, modification_date].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job_creation.rb b/lib/flat_api/models/omr_job_creation.rb new file mode 100644 index 0000000..19682a4 --- /dev/null +++ b/lib/flat_api/models/omr_job_creation.rb @@ -0,0 +1,238 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # 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. + class OmrJobCreation < ApiModelBase + attr_accessor :output + + # 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. + attr_accessor :interactive_steps + + # 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. + attr_accessor :locales + + # Target collection ID. Only used when `output` is `library`. + attr_accessor :collection + + # 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. + attr_accessor :idempotency_key + + # Optional inline inputs for a one-shot import. For multi-image or mobile capture, omit this and use `addOmrJobFile`. + attr_accessor :files + + # Start processing immediately. Only valid when `files` is provided. + attr_accessor :auto_start + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'output' => :'output', + :'interactive_steps' => :'interactiveSteps', + :'locales' => :'locales', + :'collection' => :'collection', + :'idempotency_key' => :'idempotencyKey', + :'files' => :'files', + :'auto_start' => :'autoStart' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'output' => :'OmrJobOutput', + :'interactive_steps' => :'Array', + :'locales' => :'Array', + :'collection' => :'String', + :'idempotency_key' => :'String', + :'files' => :'Array', + :'auto_start' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJobCreation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJobCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'output') + self.output = attributes[:'output'] + else + self.output = 'library' + end + + if attributes.key?(:'interactive_steps') + if (value = attributes[:'interactive_steps']).is_a?(Array) + self.interactive_steps = value + end + end + + if attributes.key?(:'locales') + if (value = attributes[:'locales']).is_a?(Array) + self.locales = value + end + end + + if attributes.key?(:'collection') + self.collection = attributes[:'collection'] + end + + if attributes.key?(:'idempotency_key') + self.idempotency_key = attributes[:'idempotency_key'] + end + + if attributes.key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = value + end + end + + if attributes.key?(:'auto_start') + self.auto_start = attributes[:'auto_start'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + output == o.output && + interactive_steps == o.interactive_steps && + locales == o.locales && + collection == o.collection && + idempotency_key == o.idempotency_key && + files == o.files && + auto_start == o.auto_start + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [output, interactive_steps, locales, collection, idempotency_key, files, auto_start].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job_file_metadata.rb b/lib/flat_api/models/omr_job_file_metadata.rb new file mode 100644 index 0000000..4d44fd0 --- /dev/null +++ b/lib/flat_api/models/omr_job_file_metadata.rb @@ -0,0 +1,199 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Metadata about the uploaded input. + class OmrJobFileMetadata < ApiModelBase + # Total number of pages across all input files. + attr_accessor :number_of_pages + + # Number of input files attached. + attr_accessor :file_count + + # Original filename of the input as uploaded (of the first file when several were combined). + attr_accessor :filename + + # Combined size of the input files, in bytes. + attr_accessor :file_size + + # MIME type of the input (of the first file when several were combined). + attr_accessor :mime_type + + # File extension of the input, without the leading dot (for example `pdf`). + attr_accessor :file_extension + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'number_of_pages' => :'numberOfPages', + :'file_count' => :'fileCount', + :'filename' => :'filename', + :'file_size' => :'fileSize', + :'mime_type' => :'mimeType', + :'file_extension' => :'fileExtension' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'number_of_pages' => :'Integer', + :'file_count' => :'Integer', + :'filename' => :'String', + :'file_size' => :'Integer', + :'mime_type' => :'String', + :'file_extension' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJobFileMetadata` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJobFileMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'number_of_pages') + self.number_of_pages = attributes[:'number_of_pages'] + end + + if attributes.key?(:'file_count') + self.file_count = attributes[:'file_count'] + end + + if attributes.key?(:'filename') + self.filename = attributes[:'filename'] + end + + if attributes.key?(:'file_size') + self.file_size = attributes[:'file_size'] + end + + if attributes.key?(:'mime_type') + self.mime_type = attributes[:'mime_type'] + end + + if attributes.key?(:'file_extension') + self.file_extension = attributes[:'file_extension'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + number_of_pages == o.number_of_pages && + file_count == o.file_count && + filename == o.filename && + file_size == o.file_size && + mime_type == o.mime_type && + file_extension == o.file_extension + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [number_of_pages, file_count, filename, file_size, mime_type, file_extension].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job_file_upload.rb b/lib/flat_api/models/omr_job_file_upload.rb new file mode 100644 index 0000000..550e2e2 --- /dev/null +++ b/lib/flat_api/models/omr_job_file_upload.rb @@ -0,0 +1,176 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # One image or PDF added to a draft job. + class OmrJobFileUpload < ApiModelBase + # 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`. + attr_accessor :file + + # Optional original filename, kept for display. + attr_accessor :filename + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'file' => :'file', + :'filename' => :'filename' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'file' => :'String', + :'filename' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJobFileUpload` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJobFileUpload`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'file') + self.file = attributes[:'file'] + else + self.file = nil + end + + if attributes.key?(:'filename') + self.filename = attributes[:'filename'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @file.nil? + invalid_properties.push('invalid value for "file", file cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @file.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] file Value to be assigned + def file=(file) + if file.nil? + fail ArgumentError, 'file cannot be nil' + end + + @file = file + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + file == o.file && + filename == o.filename + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [file, filename].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job_file_upload_result.rb b/lib/flat_api/models/omr_job_file_upload_result.rb new file mode 100644 index 0000000..ff134a1 --- /dev/null +++ b/lib/flat_api/models/omr_job_file_upload_result.rb @@ -0,0 +1,159 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Result of adding a file to a draft job. + class OmrJobFileUploadResult < ApiModelBase + # 0-based index assigned to the uploaded file. + attr_accessor :file_index + + # Total number of files now attached to the job. + attr_accessor :file_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'file_index' => :'fileIndex', + :'file_count' => :'fileCount' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'file_index' => :'Integer', + :'file_count' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJobFileUploadResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJobFileUploadResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'file_index') + self.file_index = attributes[:'file_index'] + end + + if attributes.key?(:'file_count') + self.file_count = attributes[:'file_count'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + file_index == o.file_index && + file_count == o.file_count + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [file_index, file_count].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job_input_file.rb b/lib/flat_api/models/omr_job_input_file.rb new file mode 100644 index 0000000..ffdd233 --- /dev/null +++ b/lib/flat_api/models/omr_job_input_file.rb @@ -0,0 +1,176 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # A single image or PDF input, base64-encoded. + class OmrJobInputFile < ApiModelBase + # 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`. + attr_accessor :file + + # Optional original filename, kept for display. + attr_accessor :filename + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'file' => :'file', + :'filename' => :'filename' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'file' => :'String', + :'filename' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJobInputFile` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJobInputFile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'file') + self.file = attributes[:'file'] + else + self.file = nil + end + + if attributes.key?(:'filename') + self.filename = attributes[:'filename'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @file.nil? + invalid_properties.push('invalid value for "file", file cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @file.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] file Value to be assigned + def file=(file) + if file.nil? + fail ArgumentError, 'file cannot be nil' + end + + @file = file + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + file == o.file && + filename == o.filename + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [file, filename].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job_output.rb b/lib/flat_api/models/omr_job_output.rb new file mode 100644 index 0000000..010c207 --- /dev/null +++ b/lib/flat_api/models/omr_job_output.rb @@ -0,0 +1,40 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class OmrJobOutput + LIBRARY = "library".freeze + MUSICXML = "musicxml".freeze + + def self.all_vars + @all_vars ||= [LIBRARY, MUSICXML].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if OmrJobOutput.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #OmrJobOutput" + end + end +end diff --git a/lib/flat_api/models/omr_job_progress.rb b/lib/flat_api/models/omr_job_progress.rb new file mode 100644 index 0000000..2af5c57 --- /dev/null +++ b/lib/flat_api/models/omr_job_progress.rb @@ -0,0 +1,169 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Live progress while the job is processing. + class OmrJobProgress < ApiModelBase + # Completion percentage (0-100). + attr_accessor :percent + + # Localized progress message, ready to display. + attr_accessor :text + + # 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. + attr_accessor :key + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'percent' => :'percent', + :'text' => :'text', + :'key' => :'key' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'percent' => :'Float', + :'text' => :'String', + :'key' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJobProgress` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJobProgress`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'percent') + self.percent = attributes[:'percent'] + end + + if attributes.key?(:'text') + self.text = attributes[:'text'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + percent == o.percent && + text == o.text && + key == o.key + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [percent, text, key].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job_result.rb b/lib/flat_api/models/omr_job_result.rb new file mode 100644 index 0000000..724597b --- /dev/null +++ b/lib/flat_api/models/omr_job_result.rb @@ -0,0 +1,161 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # The outcome of a finished job. Present when `status` is `done`. + class OmrJobResult < ApiModelBase + # Created score ID, when `output` is `library`. + attr_accessor :score + + # Formats available via `getOmrJobExport`, for example `[\"musicxml\", \"mxl\", \"midi\"]`. + attr_accessor :exports + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'score' => :'score', + :'exports' => :'exports' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'score' => :'String', + :'exports' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJobResult` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJobResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'score') + self.score = attributes[:'score'] + end + + if attributes.key?(:'exports') + if (value = attributes[:'exports']).is_a?(Array) + self.exports = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + score == o.score && + exports == o.exports + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [score, exports].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job_retention.rb b/lib/flat_api/models/omr_job_retention.rb new file mode 100644 index 0000000..ee6149d --- /dev/null +++ b/lib/flat_api/models/omr_job_retention.rb @@ -0,0 +1,176 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # 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. + class OmrJobRetention < ApiModelBase + # 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. + attr_accessor :expiry_date + + # 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`. + attr_accessor :expired_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'expiry_date' => :'expiryDate', + :'expired_date' => :'expiredDate' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'expiry_date' => :'Time', + :'expired_date' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJobRetention` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJobRetention`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'expiry_date') + self.expiry_date = attributes[:'expiry_date'] + else + self.expiry_date = nil + end + + if attributes.key?(:'expired_date') + self.expired_date = attributes[:'expired_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @expiry_date.nil? + invalid_properties.push('invalid value for "expiry_date", expiry_date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @expiry_date.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] expiry_date Value to be assigned + def expiry_date=(expiry_date) + if expiry_date.nil? + fail ArgumentError, 'expiry_date cannot be nil' + end + + @expiry_date = expiry_date + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expiry_date == o.expiry_date && + expired_date == o.expired_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [expiry_date, expired_date].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_job_status.rb b/lib/flat_api/models/omr_job_status.rb new file mode 100644 index 0000000..148d880 --- /dev/null +++ b/lib/flat_api/models/omr_job_status.rb @@ -0,0 +1,44 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class OmrJobStatus + DRAFT = "draft".freeze + PROCESSING = "processing".freeze + AWAITING_INPUT = "awaitingInput".freeze + DONE = "done".freeze + ERROR = "error".freeze + CANCELED = "canceled".freeze + + def self.all_vars + @all_vars ||= [DRAFT, PROCESSING, AWAITING_INPUT, DONE, ERROR, CANCELED].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if OmrJobStatus.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #OmrJobStatus" + end + end +end diff --git a/lib/flat_api/models/omr_locale_details.rb b/lib/flat_api/models/omr_locale_details.rb new file mode 100644 index 0000000..50bb626 --- /dev/null +++ b/lib/flat_api/models/omr_locale_details.rb @@ -0,0 +1,193 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # An OCR-selectable locale with its English name. + class OmrLocaleDetails < ApiModelBase + # BCP 47 locale code. Always one of the codes listed in `locales`. + attr_accessor :code + + # English name of the language, for display in a picker. + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'name' => :'name' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrLocaleDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrLocaleDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + else + self.code = nil + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @code.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if code.nil? + fail ArgumentError, 'code cannot be nil' + end + + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_pending_step.rb b/lib/flat_api/models/omr_pending_step.rb new file mode 100644 index 0000000..2523aa4 --- /dev/null +++ b/lib/flat_api/models/omr_pending_step.rb @@ -0,0 +1,213 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # The step currently awaiting client input. The `data` shape is keyed by `step`. + class OmrPendingStep < ApiModelBase + attr_accessor :step + + attr_accessor :data + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'step' => :'step', + :'data' => :'data' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'step' => :'OmrStepName', + :'data' => :'OmrDetailsStepData' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrPendingStep` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrPendingStep`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'step') + self.step = attributes[:'step'] + else + self.step = nil + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] + else + self.data = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @step.nil? + invalid_properties.push('invalid value for "step", step cannot be nil.') + end + + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @step.nil? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] step Value to be assigned + def step=(step) + if step.nil? + fail ArgumentError, 'step cannot be nil' + end + + @step = step + end + + # Custom attribute writer method with validation + # @param [Object] data Value to be assigned + def data=(data) + if data.nil? + fail ArgumentError, 'data cannot be nil' + end + + @data = data + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + step == o.step && + data == o.data + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [step, data].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/omr_step_name.rb b/lib/flat_api/models/omr_step_name.rb new file mode 100644 index 0000000..259fcea --- /dev/null +++ b/lib/flat_api/models/omr_step_name.rb @@ -0,0 +1,39 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class OmrStepName + DETAILS = "details".freeze + + def self.all_vars + @all_vars ||= [DETAILS].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if OmrStepName.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #OmrStepName" + end + end +end diff --git a/lib/flat_api/models/organization_invitation.rb b/lib/flat_api/models/organization_invitation.rb index e98ed54..d4617c4 100644 --- a/lib/flat_api/models/organization_invitation.rb +++ b/lib/flat_api/models/organization_invitation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Details of an invitation to join an organization - class OrganizationInvitation + class OrganizationInvitation < ApiModelBase # The invitation unique identifier attr_accessor :id @@ -36,6 +36,9 @@ class OrganizationInvitation # The unique identifier of the User who created this invitation attr_accessor :invited_by + # URL to join the organization using this invitation + attr_accessor :html_url + # If true, the invitation can be used multiple times. If false, the invitation can only be used once. attr_accessor :allow_multiple_use @@ -74,14 +77,20 @@ def self.attribute_map :'custom_code' => :'customCode', :'email' => :'email', :'invited_by' => :'invitedBy', + :'html_url' => :'htmlUrl', :'allow_multiple_use' => :'allowMultipleUse', :'used_by' => :'usedBy' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -94,6 +103,7 @@ def self.openapi_types :'custom_code' => :'String', :'email' => :'String', :'invited_by' => :'String', + :'html_url' => :'String', :'allow_multiple_use' => :'Boolean', :'used_by' => :'Array' } @@ -114,9 +124,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OrganizationInvitation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OrganizationInvitation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -155,6 +166,10 @@ def initialize(attributes = {}) self.invited_by = attributes[:'invited_by'] end + if attributes.key?(:'html_url') + self.html_url = attributes[:'html_url'] + end + if attributes.key?(:'allow_multiple_use') self.allow_multiple_use = attributes[:'allow_multiple_use'] else @@ -198,6 +213,36 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] organization Value to be assigned + def organization=(organization) + if organization.nil? + fail ArgumentError, 'organization cannot be nil' + end + + @organization = organization + end + + # Custom attribute writer method with validation + # @param [Object] organization_role Value to be assigned + def organization_role=(organization_role) + if organization_role.nil? + fail ArgumentError, 'organization_role cannot be nil' + end + + @organization_role = organization_role + end + + # Custom attribute writer method with validation + # @param [Object] allow_multiple_use Value to be assigned + def allow_multiple_use=(allow_multiple_use) + if allow_multiple_use.nil? + fail ArgumentError, 'allow_multiple_use cannot be nil' + end + + @allow_multiple_use = allow_multiple_use + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -210,6 +255,7 @@ def ==(o) custom_code == o.custom_code && email == o.email && invited_by == o.invited_by && + html_url == o.html_url && allow_multiple_use == o.allow_multiple_use && used_by == o.used_by end @@ -223,7 +269,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, creation_date, organization, organization_role, custom_code, email, invited_by, allow_multiple_use, used_by].hash + [id, creation_date, organization, organization_role, custom_code, email, invited_by, html_url, allow_multiple_use, used_by].hash end # Builds the object from hash @@ -249,61 +295,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -320,24 +311,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/organization_invitation_creation.rb b/lib/flat_api/models/organization_invitation_creation.rb index 0c55dd4..c7edc34 100644 --- a/lib/flat_api/models/organization_invitation_creation.rb +++ b/lib/flat_api/models/organization_invitation_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # The parameters to create an organization invitation - class OrganizationInvitationCreation + class OrganizationInvitationCreation < ApiModelBase # The email address you want to send the invitation to attr_accessor :email @@ -52,9 +52,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -79,9 +84,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OrganizationInvitationCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OrganizationInvitationCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -109,7 +115,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - organization_role_validator = EnumAttributeValidator.new('String', ["admin", "teacher"]) + organization_role_validator = EnumAttributeValidator.new('String', ["admin", "teacher", "accountAdmin"]) return false unless organization_role_validator.valid?(@organization_role) true end @@ -117,7 +123,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] organization_role Object to be assigned def organization_role=(organization_role) - validator = EnumAttributeValidator.new('String', ["admin", "teacher"]) + validator = EnumAttributeValidator.new('String', ["admin", "teacher", "accountAdmin"]) unless validator.valid?(organization_role) fail ArgumentError, "invalid value for \"organization_role\", must be one of #{validator.allowable_values}." end @@ -168,61 +174,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -239,24 +190,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/organization_roles.rb b/lib/flat_api/models/organization_roles.rb index 70e75ea..26aa36e 100644 --- a/lib/flat_api/models/organization_roles.rb +++ b/lib/flat_api/models/organization_roles.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -16,12 +16,12 @@ module FlatApi class OrganizationRoles ADMIN = "admin".freeze - BILLING = "billing".freeze + ACCOUNT_ADMIN = "accountAdmin".freeze TEACHER = "teacher".freeze USER = "user".freeze def self.all_vars - @all_vars ||= [ADMIN, BILLING, TEACHER, USER].freeze + @all_vars ||= [ADMIN, ACCOUNT_ADMIN, TEACHER, USER].freeze end # Builds the enum from string diff --git a/lib/flat_api/models/organization_user_access_token_creation.rb b/lib/flat_api/models/organization_user_access_token_creation.rb index da7f78f..fa827f2 100644 --- a/lib/flat_api/models/organization_user_access_token_creation.rb +++ b/lib/flat_api/models/organization_user_access_token_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Creation of a delegated API access token for an organization user - class OrganizationUserAccessTokenCreation + class OrganizationUserAccessTokenCreation < ApiModelBase # List of requested scopes for this credential attr_accessor :scopes @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -52,9 +57,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OrganizationUserAccessTokenCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OrganizationUserAccessTokenCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -88,6 +94,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] scopes Value to be assigned + def scopes=(scopes) + if scopes.nil? + fail ArgumentError, 'scopes cannot be nil' + end + + @scopes = scopes + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -131,61 +147,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -202,24 +163,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/rename_group_request.rb b/lib/flat_api/models/rename_group_request.rb new file mode 100644 index 0000000..44f2e07 --- /dev/null +++ b/lib/flat_api/models/rename_group_request.rb @@ -0,0 +1,165 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class RenameGroupRequest < ApiModelBase + # New name for the group + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::RenameGroupRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::RenameGroupRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/resource_collaborator.rb b/lib/flat_api/models/resource_collaborator.rb index 4de63e2..6ef4734 100644 --- a/lib/flat_api/models/resource_collaborator.rb +++ b/lib/flat_api/models/resource_collaborator.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # 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). - class ResourceCollaborator + class ResourceCollaborator < ApiModelBase # `True` if the current user can read the current document attr_accessor :acl_read @@ -94,9 +94,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -139,9 +144,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ResourceCollaborator`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ResourceCollaborator`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -224,10 +230,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "acl_admin", acl_admin cannot be nil.') end - if @is_collaborator.nil? - invalid_properties.push('invalid value for "is_collaborator", is_collaborator cannot be nil.') - end - invalid_properties end @@ -238,12 +240,41 @@ def valid? return false if @acl_read.nil? return false if @acl_write.nil? return false if @acl_admin.nil? - return false if @is_collaborator.nil? collaborator_type_validator = EnumAttributeValidator.new('String', ["owner", "user", "group"]) return false unless collaborator_type_validator.valid?(@collaborator_type) true end + # Custom attribute writer method with validation + # @param [Object] acl_read Value to be assigned + def acl_read=(acl_read) + if acl_read.nil? + fail ArgumentError, 'acl_read cannot be nil' + end + + @acl_read = acl_read + end + + # Custom attribute writer method with validation + # @param [Object] acl_write Value to be assigned + def acl_write=(acl_write) + if acl_write.nil? + fail ArgumentError, 'acl_write cannot be nil' + end + + @acl_write = acl_write + end + + # Custom attribute writer method with validation + # @param [Object] acl_admin Value to be assigned + def acl_admin=(acl_admin) + if acl_admin.nil? + fail ArgumentError, 'acl_admin cannot be nil' + end + + @acl_admin = acl_admin + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] collaborator_type Object to be assigned def collaborator_type=(collaborator_type) @@ -309,61 +340,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -380,24 +356,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/resource_collaborator_creation.rb b/lib/flat_api/models/resource_collaborator_creation.rb index f42b334..49903e0 100644 --- a/lib/flat_api/models/resource_collaborator_creation.rb +++ b/lib/flat_api/models/resource_collaborator_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Add a collaborator to a resource. - class ResourceCollaboratorCreation + class ResourceCollaboratorCreation < ApiModelBase # The unique identifier of a Flat user attr_accessor :user @@ -50,9 +50,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -82,9 +87,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ResourceCollaboratorCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ResourceCollaboratorCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -188,61 +194,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -259,24 +210,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/resource_rights.rb b/lib/flat_api/models/resource_rights.rb index b80f7f6..70b60f3 100644 --- a/lib/flat_api/models/resource_rights.rb +++ b/lib/flat_api/models/resource_rights.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # The rights of the current user on a score or collection - class ResourceRights + class ResourceRights < ApiModelBase # `True` if the current user can read the current document attr_accessor :acl_read @@ -64,9 +64,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -94,9 +99,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ResourceRights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ResourceRights`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -147,10 +153,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "acl_admin", acl_admin cannot be nil.') end - if @is_collaborator.nil? - invalid_properties.push('invalid value for "is_collaborator", is_collaborator cannot be nil.') - end - invalid_properties end @@ -161,12 +163,41 @@ def valid? return false if @acl_read.nil? return false if @acl_write.nil? return false if @acl_admin.nil? - return false if @is_collaborator.nil? collaborator_type_validator = EnumAttributeValidator.new('String', ["owner", "user", "group"]) return false unless collaborator_type_validator.valid?(@collaborator_type) true end + # Custom attribute writer method with validation + # @param [Object] acl_read Value to be assigned + def acl_read=(acl_read) + if acl_read.nil? + fail ArgumentError, 'acl_read cannot be nil' + end + + @acl_read = acl_read + end + + # Custom attribute writer method with validation + # @param [Object] acl_write Value to be assigned + def acl_write=(acl_write) + if acl_write.nil? + fail ArgumentError, 'acl_write cannot be nil' + end + + @acl_write = acl_write + end + + # Custom attribute writer method with validation + # @param [Object] acl_admin Value to be assigned + def acl_admin=(acl_admin) + if acl_admin.nil? + fail ArgumentError, 'acl_admin cannot be nil' + end + + @acl_admin = acl_admin + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] collaborator_type Object to be assigned def collaborator_type=(collaborator_type) @@ -224,61 +255,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -295,24 +271,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_comment.rb b/lib/flat_api/models/score_comment.rb index e74c87f..1e8a82f 100644 --- a/lib/flat_api/models/score_comment.rb +++ b/lib/flat_api/models/score_comment.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Comment added on a sheet music - class ScoreComment + class ScoreComment < ApiModelBase # The comment unique identifier attr_accessor :id @@ -106,9 +106,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -147,27 +152,36 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreComment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreComment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'type') self.type = attributes[:'type'] + else + self.type = nil end if attributes.key?(:'user') self.user = attributes[:'user'] + else + self.user = nil end if attributes.key?(:'score') self.score = attributes[:'score'] + else + self.score = nil end if attributes.key?(:'revision') @@ -180,6 +194,8 @@ def initialize(attributes = {}) if attributes.key?(:'date') self.date = attributes[:'date'] + else + self.date = nil end if attributes.key?(:'modification_date') @@ -188,10 +204,14 @@ def initialize(attributes = {}) if attributes.key?(:'comment') self.comment = attributes[:'comment'] + else + self.comment = nil end if attributes.key?(:'raw_comment') self.raw_comment = attributes[:'raw_comment'] + else + self.raw_comment = nil end if attributes.key?(:'context') @@ -226,6 +246,34 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @user.nil? + invalid_properties.push('invalid value for "user", user cannot be nil.') + end + + if @score.nil? + invalid_properties.push('invalid value for "score", score cannot be nil.') + end + + if @date.nil? + invalid_properties.push('invalid value for "date", date cannot be nil.') + end + + if @comment.nil? + invalid_properties.push('invalid value for "comment", comment cannot be nil.') + end + + if @raw_comment.nil? + invalid_properties.push('invalid value for "raw_comment", raw_comment cannot be nil.') + end + invalid_properties end @@ -233,11 +281,28 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @type.nil? type_validator = EnumAttributeValidator.new('String', ["document", "inline"]) return false unless type_validator.valid?(@type) + return false if @user.nil? + return false if @score.nil? + return false if @date.nil? + return false if @comment.nil? + return false if @raw_comment.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) @@ -248,6 +313,56 @@ def type=(type) @type = type end + # Custom attribute writer method with validation + # @param [Object] user Value to be assigned + def user=(user) + if user.nil? + fail ArgumentError, 'user cannot be nil' + end + + @user = user + end + + # Custom attribute writer method with validation + # @param [Object] score Value to be assigned + def score=(score) + if score.nil? + fail ArgumentError, 'score cannot be nil' + end + + @score = score + end + + # Custom attribute writer method with validation + # @param [Object] date Value to be assigned + def date=(date) + if date.nil? + fail ArgumentError, 'date cannot be nil' + end + + @date = date + end + + # Custom attribute writer method with validation + # @param [Object] comment Value to be assigned + def comment=(comment) + if comment.nil? + fail ArgumentError, 'comment cannot be nil' + end + + @comment = comment + end + + # Custom attribute writer method with validation + # @param [Object] raw_comment Value to be assigned + def raw_comment=(raw_comment) + if raw_comment.nil? + fail ArgumentError, 'raw_comment cannot be nil' + end + + @raw_comment = raw_comment + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -306,61 +421,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -377,24 +437,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_comment_context.rb b/lib/flat_api/models/score_comment_context.rb index d79db4c..071ae1f 100644 --- a/lib/flat_api/models/score_comment_context.rb +++ b/lib/flat_api/models/score_comment_context.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # 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). - class ScoreCommentContext + class ScoreCommentContext < ApiModelBase # The unique identifier (UUID) of the score part attr_accessor :part_uuid @@ -50,9 +50,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -83,9 +88,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentContext`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentContext`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -182,6 +188,66 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] part_uuid Value to be assigned + def part_uuid=(part_uuid) + if part_uuid.nil? + fail ArgumentError, 'part_uuid cannot be nil' + end + + @part_uuid = part_uuid + end + + # Custom attribute writer method with validation + # @param [Object] measure_uuids Value to be assigned + def measure_uuids=(measure_uuids) + if measure_uuids.nil? + fail ArgumentError, 'measure_uuids cannot be nil' + end + + @measure_uuids = measure_uuids + end + + # Custom attribute writer method with validation + # @param [Object] start_time_pos Value to be assigned + def start_time_pos=(start_time_pos) + if start_time_pos.nil? + fail ArgumentError, 'start_time_pos cannot be nil' + end + + @start_time_pos = start_time_pos + end + + # Custom attribute writer method with validation + # @param [Object] stop_time_pos Value to be assigned + def stop_time_pos=(stop_time_pos) + if stop_time_pos.nil? + fail ArgumentError, 'stop_time_pos cannot be nil' + end + + @stop_time_pos = stop_time_pos + end + + # Custom attribute writer method with validation + # @param [Object] start_dpq Value to be assigned + def start_dpq=(start_dpq) + if start_dpq.nil? + fail ArgumentError, 'start_dpq cannot be nil' + end + + @start_dpq = start_dpq + end + + # Custom attribute writer method with validation + # @param [Object] stop_dpq Value to be assigned + def stop_dpq=(stop_dpq) + if stop_dpq.nil? + fail ArgumentError, 'stop_dpq cannot be nil' + end + + @stop_dpq = stop_dpq + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -232,61 +298,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -303,24 +314,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_comment_creation.rb b/lib/flat_api/models/score_comment_creation.rb index 992ea9e..60e703b 100644 --- a/lib/flat_api/models/score_comment_creation.rb +++ b/lib/flat_api/models/score_comment_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,8 +15,8 @@ module FlatApi # Creation of a comment - class ScoreCommentCreation - # 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. + class ScoreCommentCreation < ApiModelBase + # 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. attr_accessor :revision # The comment text that can includes mentions using the following format: `@[id:username]`. @@ -45,9 +45,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -76,9 +81,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,6 +138,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] comment Value to be assigned + def comment=(comment) + if comment.nil? + fail ArgumentError, 'comment cannot be nil' + end + + @comment = comment + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -180,61 +196,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -251,24 +212,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_comment_moderation.rb b/lib/flat_api/models/score_comment_moderation.rb index fb275e2..ba46b11 100644 --- a/lib/flat_api/models/score_comment_moderation.rb +++ b/lib/flat_api/models/score_comment_moderation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Information about the comment being moderated - class ScoreCommentModeration + class ScoreCommentModeration < ApiModelBase # If true, this comment will be hidden from other users attr_accessor :hidden @@ -52,9 +52,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -79,9 +84,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentModeration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentModeration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -166,61 +172,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -237,24 +188,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_comment_update.rb b/lib/flat_api/models/score_comment_update.rb index 34da6e3..7dd80f2 100644 --- a/lib/flat_api/models/score_comment_update.rb +++ b/lib/flat_api/models/score_comment_update.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,8 +15,8 @@ module FlatApi # Update of a comment - class ScoreCommentUpdate - # 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. + class ScoreCommentUpdate < ApiModelBase + # 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. attr_accessor :revision # The comment text that can includes mentions using the following format: `@[id:username]`. @@ -37,9 +37,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -66,9 +71,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -100,7 +106,7 @@ def list_invalid_properties end if !@comment.nil? && @comment.to_s.length < 1 - invalid_properties.push('invalid value for "comment", the character length must be great than or equal to 1.') + invalid_properties.push('invalid value for "comment", the character length must be greater than or equal to 1.') end if !@raw_comment.nil? && @raw_comment.to_s.length > 10000 @@ -108,7 +114,7 @@ def list_invalid_properties end if !@raw_comment.nil? && @raw_comment.to_s.length < 1 - invalid_properties.push('invalid value for "raw_comment", the character length must be great than or equal to 1.') + invalid_properties.push('invalid value for "raw_comment", the character length must be greater than or equal to 1.') end invalid_properties @@ -137,7 +143,7 @@ def comment=(comment) end if comment.to_s.length < 1 - fail ArgumentError, 'invalid value for "comment", the character length must be great than or equal to 1.' + fail ArgumentError, 'invalid value for "comment", the character length must be greater than or equal to 1.' end @comment = comment @@ -155,7 +161,7 @@ def raw_comment=(raw_comment) end if raw_comment.to_s.length < 1 - fail ArgumentError, 'invalid value for "raw_comment", the character length must be great than or equal to 1.' + fail ArgumentError, 'invalid value for "raw_comment", the character length must be greater than or equal to 1.' end @raw_comment = raw_comment @@ -207,61 +213,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -278,24 +229,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_comments_counts.rb b/lib/flat_api/models/score_comments_counts.rb index c363f17..67e3374 100644 --- a/lib/flat_api/models/score_comments_counts.rb +++ b/lib/flat_api/models/score_comments_counts.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,8 +14,8 @@ require 'time' module FlatApi - # A computed version of the total, unique, weekly and monthly number of comments added on the documents (this doesn't include inline comments). - class ScoreCommentsCounts + # A computed version of the total, unique, weekly, monthly and yearly number of comments added on the documents (this doesn't include inline comments). + class ScoreCommentsCounts < ApiModelBase # The total number of comments added to the score attr_accessor :total @@ -28,19 +28,28 @@ class ScoreCommentsCounts # The monthly unique number of comments added to the score attr_accessor :monthly + # The yearly unique number of comments added to the score + attr_accessor :yearly + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'total' => :'total', :'unique' => :'unique', :'weekly' => :'weekly', - :'monthly' => :'monthly' + :'monthly' => :'monthly', + :'yearly' => :'yearly' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -49,7 +58,8 @@ def self.openapi_types :'total' => :'Float', :'unique' => :'Float', :'weekly' => :'Float', - :'monthly' => :'Float' + :'monthly' => :'Float', + :'yearly' => :'Float' } end @@ -67,9 +77,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentsCounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCommentsCounts`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -89,6 +100,10 @@ def initialize(attributes = {}) if attributes.key?(:'monthly') self.monthly = attributes[:'monthly'] end + + if attributes.key?(:'yearly') + self.yearly = attributes[:'yearly'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -114,7 +129,8 @@ def ==(o) total == o.total && unique == o.unique && weekly == o.weekly && - monthly == o.monthly + monthly == o.monthly && + yearly == o.yearly end # @see the `==` method @@ -126,7 +142,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [total, unique, weekly, monthly].hash + [total, unique, weekly, monthly, yearly].hash end # Builds the object from hash @@ -152,61 +168,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -223,24 +184,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_creation.rb b/lib/flat_api/models/score_creation.rb index ecf1ba3..ee7e5cf 100644 --- a/lib/flat_api/models/score_creation.rb +++ b/lib/flat_api/models/score_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -39,8 +39,7 @@ def build(data) openapi_one_of.each do |klass| begin next if klass == :AnyType # "nullable: true" - typed_data = find_and_cast_into_type(klass, data) - return typed_data if typed_data + return find_and_cast_into_type(klass, data) rescue # rescue all errors so we keep iterating even if the current item lookup raises end end @@ -66,7 +65,7 @@ def find_and_cast_into_type(klass, data) when 'Time' return Time.parse(data) when 'Date' - return Date.parse(data) + return Date.iso8601(data) when 'String' return data if data.instance_of?(String) when 'Object' # "type: object" diff --git a/lib/flat_api/models/score_creation_builder_data.rb b/lib/flat_api/models/score_creation_builder_data.rb index 9ca60ae..00b161e 100644 --- a/lib/flat_api/models/score_creation_builder_data.rb +++ b/lib/flat_api/models/score_creation_builder_data.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,13 +14,13 @@ require 'time' module FlatApi - class ScoreCreationBuilderData + class ScoreCreationBuilderData < ApiModelBase # 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\") attr_accessor :title attr_accessor :privacy - # 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. + # 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. attr_accessor :collection # 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. @@ -61,9 +61,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -98,17 +103,16 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'title') self.title = attributes[:'title'] - else - self.title = nil end if attributes.key?(:'privacy') @@ -137,10 +141,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @title.nil? - invalid_properties.push('invalid value for "title", title cannot be nil.') - end - if @builder_data.nil? invalid_properties.push('invalid value for "builder_data", builder_data cannot be nil.') end @@ -152,11 +152,20 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @title.nil? return false if @builder_data.nil? true end + # Custom attribute writer method with validation + # @param [Object] builder_data Value to be assigned + def builder_data=(builder_data) + if builder_data.nil? + fail ArgumentError, 'builder_data cannot be nil' + end + + @builder_data = builder_data + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -204,61 +213,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -275,24 +229,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_creation_builder_data_all_of_builder_data.rb b/lib/flat_api/models/score_creation_builder_data_all_of_builder_data.rb index f8fb323..c74a8fc 100644 --- a/lib/flat_api/models/score_creation_builder_data_all_of_builder_data.rb +++ b/lib/flat_api/models/score_creation_builder_data_all_of_builder_data.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class ScoreCreationBuilderDataAllOfBuilderData + class ScoreCreationBuilderDataAllOfBuilderData < ApiModelBase attr_accessor :score_data attr_accessor :layout_data @@ -27,9 +27,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -54,9 +59,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderDataAllOfBuilderData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderDataAllOfBuilderData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -92,6 +98,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] score_data Value to be assigned + def score_data=(score_data) + if score_data.nil? + fail ArgumentError, 'score_data cannot be nil' + end + + @score_data = score_data + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -136,61 +152,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -207,24 +168,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_layout_data.rb b/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_layout_data.rb index 038aa8e..d433a87 100644 --- a/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_layout_data.rb +++ b/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_layout_data.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Control the appearance of the score. If missing, default values are used. - class ScoreCreationBuilderDataAllOfBuilderDataLayoutData + class ScoreCreationBuilderDataAllOfBuilderDataLayoutData < ApiModelBase # A float value >= 1 that controls the spacing between notes. attr_accessor :notes_spacing_coeff @@ -76,9 +76,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -109,9 +114,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderDataAllOfBuilderDataLayoutData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderDataAllOfBuilderDataLayoutData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -228,61 +234,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -299,24 +250,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data.rb b/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data.rb index 90feabb..827b83e 100644 --- a/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data.rb +++ b/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class ScoreCreationBuilderDataAllOfBuilderDataScoreData + class ScoreCreationBuilderDataAllOfBuilderDataScoreData < ApiModelBase # true if the TAB staff is displayed with fretted instruments attr_accessor :use_tab_staff @@ -30,7 +30,7 @@ class ScoreCreationBuilderDataAllOfBuilderDataScoreData # The duration of a beat in the measure attr_accessor :beat_type - # 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`. + # 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). attr_accessor :instruments # Attribute mapping from ruby-style variable name to JSON key. @@ -45,9 +45,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -76,9 +81,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,6 +138,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] instruments Value to be assigned + def instruments=(instruments) + if instruments.nil? + fail ArgumentError, 'instruments cannot be nil' + end + + @instruments = instruments + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -180,61 +196,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -251,24 +212,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.rb b/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.rb index 174be20..93f192f 100644 --- a/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.rb +++ b/lib/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments + class ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments < ApiModelBase # The of the instrument group (e.g. `keyboards`, `brass`) attr_accessor :group @@ -41,9 +41,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -71,9 +76,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -128,6 +134,26 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] group Value to be assigned + def group=(group) + if group.nil? + fail ArgumentError, 'group cannot be nil' + end + + @group = group + end + + # Custom attribute writer method with validation + # @param [Object] instrument Value to be assigned + def instrument=(instrument) + if instrument.nil? + fail ArgumentError, 'instrument cannot be nil' + end + + @instrument = instrument + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -175,61 +201,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -246,24 +217,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_creation_common.rb b/lib/flat_api/models/score_creation_common.rb index cfc6e0e..bea897e 100644 --- a/lib/flat_api/models/score_creation_common.rb +++ b/lib/flat_api/models/score_creation_common.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,13 +14,13 @@ require 'time' module FlatApi - class ScoreCreationCommon + class ScoreCreationCommon < ApiModelBase # 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\") attr_accessor :title attr_accessor :privacy - # 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. + # 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. attr_accessor :collection # 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. @@ -58,9 +58,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -87,9 +92,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationCommon`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationCommon`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -174,61 +180,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -245,24 +196,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_creation_file_import.rb b/lib/flat_api/models/score_creation_file_import.rb index 58d133d..9170040 100644 --- a/lib/flat_api/models/score_creation_file_import.rb +++ b/lib/flat_api/models/score_creation_file_import.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,13 +14,13 @@ require 'time' module FlatApi - class ScoreCreationFileImport + class ScoreCreationFileImport < ApiModelBase # 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\") attr_accessor :title attr_accessor :privacy - # 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. + # 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. attr_accessor :collection # 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. @@ -29,12 +29,15 @@ class ScoreCreationFileImport # If this is an imported file, its filename attr_accessor :filename - # 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. + # 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. attr_accessor :data # The optional encoding of the score data. This property must match the encoding used for the `data` property. attr_accessor :data_encoding + # 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}`. + attr_accessor :supports_tasks + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -66,13 +69,19 @@ def self.attribute_map :'google_drive_folder' => :'googleDriveFolder', :'filename' => :'filename', :'data' => :'data', - :'data_encoding' => :'dataEncoding' + :'data_encoding' => :'dataEncoding', + :'supports_tasks' => :'supportsTasks' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -84,7 +93,8 @@ def self.openapi_types :'google_drive_folder' => :'String', :'filename' => :'String', :'data' => :'String', - :'data_encoding' => :'String' + :'data_encoding' => :'String', + :'supports_tasks' => :'Boolean' } end @@ -109,9 +119,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationFileImport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationFileImport`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -147,6 +158,10 @@ def initialize(attributes = {}) if attributes.key?(:'data_encoding') self.data_encoding = attributes[:'data_encoding'] end + + if attributes.key?(:'supports_tasks') + self.supports_tasks = attributes[:'supports_tasks'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -171,6 +186,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] data Value to be assigned + def data=(data) + if data.nil? + fail ArgumentError, 'data cannot be nil' + end + + @data = data + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] data_encoding Object to be assigned def data_encoding=(data_encoding) @@ -192,7 +217,8 @@ def ==(o) google_drive_folder == o.google_drive_folder && filename == o.filename && data == o.data && - data_encoding == o.data_encoding + data_encoding == o.data_encoding && + supports_tasks == o.supports_tasks end # @see the `==` method @@ -204,7 +230,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, privacy, collection, google_drive_folder, filename, data, data_encoding].hash + [title, privacy, collection, google_drive_folder, filename, data, data_encoding, supports_tasks].hash end # Builds the object from hash @@ -230,61 +256,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -301,24 +272,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_creation_google_drive_import.rb b/lib/flat_api/models/score_creation_google_drive_import.rb index 03458c7..5334672 100644 --- a/lib/flat_api/models/score_creation_google_drive_import.rb +++ b/lib/flat_api/models/score_creation_google_drive_import.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,13 +14,13 @@ require 'time' module FlatApi - class ScoreCreationGoogleDriveImport + class ScoreCreationGoogleDriveImport < ApiModelBase # 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\") attr_accessor :title attr_accessor :privacy - # 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. + # 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. attr_accessor :collection # 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. @@ -61,9 +61,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -98,9 +103,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationGoogleDriveImport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreCreationGoogleDriveImport`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -150,6 +156,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] source Value to be assigned + def source=(source) + if source.nil? + fail ArgumentError, 'source cannot be nil' + end + + @source = source + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -197,61 +213,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -268,24 +229,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_creation_type.rb b/lib/flat_api/models/score_creation_type.rb index 6053627..581a05b 100644 --- a/lib/flat_api/models/score_creation_type.rb +++ b/lib/flat_api/models/score_creation_type.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -18,10 +18,9 @@ class ScoreCreationType ORIGINAL = "original".freeze ARRANGEMENT = "arrangement".freeze OTHER = "other".freeze - NULL = "null".freeze def self.all_vars - @all_vars ||= [ORIGINAL, ARRANGEMENT, OTHER, NULL].freeze + @all_vars ||= [ORIGINAL, ARRANGEMENT, OTHER].freeze end # Builds the enum from string diff --git a/lib/flat_api/models/score_details.rb b/lib/flat_api/models/score_details.rb index 3fa0ef1..a0349b1 100644 --- a/lib/flat_api/models/score_details.rb +++ b/lib/flat_api/models/score_details.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # The score and all its details - class ScoreDetails + class ScoreDetails < ApiModelBase # The unique identifier of the score attr_accessor :id @@ -32,6 +32,9 @@ class ScoreDetails # The url where the score can be viewed in a web browser attr_accessor :html_url + # The url where the score can be edited in a web browser + attr_accessor :edit_html_url + # Subtitle of the score attr_accessor :subtitle @@ -83,6 +86,9 @@ class ScoreDetails # The date when the score was published on Flat attr_accessor :publication_date + # 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. + attr_accessor :scheduled_deletion_date + # The date when the score was highlighted (featured) on our community attr_accessor :highlighted_date @@ -95,6 +101,9 @@ class ScoreDetails # 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}`. attr_accessor :instruments + # 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. + attr_accessor :instruments_names + # An array of the audio samples identifiers used the different score parts. The format of the strings is `{instrument-group}.{sample-id}`. attr_accessor :samples @@ -112,6 +121,8 @@ class ScoreDetails # 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. attr_accessor :collections + attr_accessor :me + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -143,6 +154,7 @@ def self.attribute_map :'privacy' => :'privacy', :'user' => :'user', :'html_url' => :'htmlUrl', + :'edit_html_url' => :'editHtmlUrl', :'subtitle' => :'subtitle', :'lyricist' => :'lyricist', :'arranger' => :'arranger', @@ -161,23 +173,31 @@ def self.attribute_map :'creation_date' => :'creationDate', :'modification_date' => :'modificationDate', :'publication_date' => :'publicationDate', + :'scheduled_deletion_date' => :'scheduledDeletionDate', :'highlighted_date' => :'highlightedDate', :'organization' => :'organization', :'parent_score' => :'parentScore', :'instruments' => :'instruments', + :'instruments_names' => :'instrumentsNames', :'samples' => :'samples', :'google_drive_file_id' => :'googleDriveFileId', :'likes' => :'likes', :'comments' => :'comments', :'views' => :'views', :'plays' => :'plays', - :'collections' => :'collections' + :'collections' => :'collections', + :'me' => :'me' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -189,6 +209,7 @@ def self.openapi_types :'privacy' => :'ScorePrivacy', :'user' => :'UserPublic', :'html_url' => :'String', + :'edit_html_url' => :'String', :'subtitle' => :'String', :'lyricist' => :'String', :'arranger' => :'String', @@ -207,17 +228,20 @@ def self.openapi_types :'creation_date' => :'Time', :'modification_date' => :'Time', :'publication_date' => :'Time', + :'scheduled_deletion_date' => :'Time', :'highlighted_date' => :'Time', :'organization' => :'String', :'parent_score' => :'String', :'instruments' => :'Array', + :'instruments_names' => :'Array', :'samples' => :'Array', :'google_drive_file_id' => :'String', :'likes' => :'ScoreLikesCounts', :'comments' => :'ScoreCommentsCounts', :'views' => :'ScoreViewsCounts', :'plays' => :'ScorePlaysCounts', - :'collections' => :'Array' + :'collections' => :'Array', + :'me' => :'ScoreDetailsAllOfMe' } end @@ -244,9 +268,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -285,6 +310,12 @@ def initialize(attributes = {}) self.html_url = nil end + if attributes.key?(:'edit_html_url') + self.edit_html_url = attributes[:'edit_html_url'] + else + self.edit_html_url = nil + end + if attributes.key?(:'subtitle') self.subtitle = attributes[:'subtitle'] end @@ -341,8 +372,6 @@ def initialize(attributes = {}) if attributes.key?(:'rights') self.rights = attributes[:'rights'] - else - self.rights = nil end if attributes.key?(:'collaborators') @@ -367,6 +396,10 @@ def initialize(attributes = {}) self.publication_date = attributes[:'publication_date'] end + if attributes.key?(:'scheduled_deletion_date') + self.scheduled_deletion_date = attributes[:'scheduled_deletion_date'] + end + if attributes.key?(:'highlighted_date') self.highlighted_date = attributes[:'highlighted_date'] end @@ -387,6 +420,14 @@ def initialize(attributes = {}) self.instruments = nil end + if attributes.key?(:'instruments_names') + if (value = attributes[:'instruments_names']).is_a?(Array) + self.instruments_names = value + end + else + self.instruments_names = nil + end + if attributes.key?(:'samples') if (value = attributes[:'samples']).is_a?(Array) self.samples = value @@ -420,6 +461,10 @@ def initialize(attributes = {}) self.collections = value end end + + if attributes.key?(:'me') + self.me = attributes[:'me'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -447,8 +492,8 @@ def list_invalid_properties invalid_properties.push('invalid value for "html_url", html_url cannot be nil.') end - if @rights.nil? - invalid_properties.push('invalid value for "rights", rights cannot be nil.') + if @edit_html_url.nil? + invalid_properties.push('invalid value for "edit_html_url", edit_html_url cannot be nil.') end if @collaborators.nil? @@ -463,6 +508,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "instruments", instruments cannot be nil.') end + if @instruments_names.nil? + invalid_properties.push('invalid value for "instruments_names", instruments_names cannot be nil.') + end + if @samples.nil? invalid_properties.push('invalid value for "samples", samples cannot be nil.') end @@ -479,14 +528,125 @@ def valid? return false if @privacy.nil? return false if @user.nil? return false if @html_url.nil? - return false if @rights.nil? + return false if @edit_html_url.nil? return false if @collaborators.nil? return false if @creation_date.nil? return false if @instruments.nil? + return false if @instruments_names.nil? return false if @samples.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.nil? + fail ArgumentError, 'title cannot be nil' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] privacy Value to be assigned + def privacy=(privacy) + if privacy.nil? + fail ArgumentError, 'privacy cannot be nil' + end + + @privacy = privacy + end + + # Custom attribute writer method with validation + # @param [Object] user Value to be assigned + def user=(user) + if user.nil? + fail ArgumentError, 'user cannot be nil' + end + + @user = user + end + + # Custom attribute writer method with validation + # @param [Object] html_url Value to be assigned + def html_url=(html_url) + if html_url.nil? + fail ArgumentError, 'html_url cannot be nil' + end + + @html_url = html_url + end + + # Custom attribute writer method with validation + # @param [Object] edit_html_url Value to be assigned + def edit_html_url=(edit_html_url) + if edit_html_url.nil? + fail ArgumentError, 'edit_html_url cannot be nil' + end + + @edit_html_url = edit_html_url + end + + # Custom attribute writer method with validation + # @param [Object] collaborators Value to be assigned + def collaborators=(collaborators) + if collaborators.nil? + fail ArgumentError, 'collaborators cannot be nil' + end + + @collaborators = collaborators + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method with validation + # @param [Object] instruments Value to be assigned + def instruments=(instruments) + if instruments.nil? + fail ArgumentError, 'instruments cannot be nil' + end + + @instruments = instruments + end + + # Custom attribute writer method with validation + # @param [Object] instruments_names Value to be assigned + def instruments_names=(instruments_names) + if instruments_names.nil? + fail ArgumentError, 'instruments_names cannot be nil' + end + + @instruments_names = instruments_names + end + + # Custom attribute writer method with validation + # @param [Object] samples Value to be assigned + def samples=(samples) + if samples.nil? + fail ArgumentError, 'samples cannot be nil' + end + + @samples = samples + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -498,6 +658,7 @@ def ==(o) privacy == o.privacy && user == o.user && html_url == o.html_url && + edit_html_url == o.edit_html_url && subtitle == o.subtitle && lyricist == o.lyricist && arranger == o.arranger && @@ -516,17 +677,20 @@ def ==(o) creation_date == o.creation_date && modification_date == o.modification_date && publication_date == o.publication_date && + scheduled_deletion_date == o.scheduled_deletion_date && highlighted_date == o.highlighted_date && organization == o.organization && parent_score == o.parent_score && instruments == o.instruments && + instruments_names == o.instruments_names && samples == o.samples && google_drive_file_id == o.google_drive_file_id && likes == o.likes && comments == o.comments && views == o.views && plays == o.plays && - collections == o.collections + collections == o.collections && + me == o.me end # @see the `==` method @@ -538,7 +702,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, sharing_key, title, privacy, user, html_url, subtitle, lyricist, arranger, composer, description, tags, creation_type, license, license_text, duration_time, number_measures, main_tempo_qpm, main_key_signature, rights, collaborators, creation_date, modification_date, publication_date, highlighted_date, organization, parent_score, instruments, samples, google_drive_file_id, likes, comments, views, plays, collections].hash + [id, sharing_key, title, privacy, user, html_url, edit_html_url, subtitle, lyricist, arranger, composer, description, tags, creation_type, license, license_text, duration_time, number_measures, main_tempo_qpm, main_key_signature, rights, collaborators, creation_date, modification_date, publication_date, scheduled_deletion_date, highlighted_date, organization, parent_score, instruments, instruments_names, samples, google_drive_file_id, likes, comments, views, plays, collections, me].hash end # Builds the object from hash @@ -564,61 +728,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -635,24 +744,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_details_all_of_me.rb b/lib/flat_api/models/score_details_all_of_me.rb new file mode 100644 index 0000000..f7a8ca0 --- /dev/null +++ b/lib/flat_api/models/score_details_all_of_me.rb @@ -0,0 +1,193 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Information about the authenticated user and this score + class ScoreDetailsAllOfMe < ApiModelBase + # True if the current user likes this score + attr_accessor :is_liked + + # True if the score is stored in one of the user's collections + attr_accessor :is_in_library + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'is_liked' => :'isLiked', + :'is_in_library' => :'isInLibrary' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'is_liked' => :'Boolean', + :'is_in_library' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::ScoreDetailsAllOfMe` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreDetailsAllOfMe`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'is_liked') + self.is_liked = attributes[:'is_liked'] + else + self.is_liked = nil + end + + if attributes.key?(:'is_in_library') + self.is_in_library = attributes[:'is_in_library'] + else + self.is_in_library = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @is_liked.nil? + invalid_properties.push('invalid value for "is_liked", is_liked cannot be nil.') + end + + if @is_in_library.nil? + invalid_properties.push('invalid value for "is_in_library", is_in_library cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @is_liked.nil? + return false if @is_in_library.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] is_liked Value to be assigned + def is_liked=(is_liked) + if is_liked.nil? + fail ArgumentError, 'is_liked cannot be nil' + end + + @is_liked = is_liked + end + + # Custom attribute writer method with validation + # @param [Object] is_in_library Value to be assigned + def is_in_library=(is_in_library) + if is_in_library.nil? + fail ArgumentError, 'is_in_library cannot be nil' + end + + @is_in_library = is_in_library + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + is_liked == o.is_liked && + is_in_library == o.is_in_library + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [is_liked, is_in_library].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/score_fork.rb b/lib/flat_api/models/score_fork.rb index dd7d739..36e04e4 100644 --- a/lib/flat_api/models/score_fork.rb +++ b/lib/flat_api/models/score_fork.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,8 +15,8 @@ module FlatApi # Options to fork the score - class ScoreFork - # 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 + class ScoreFork < ApiModelBase + # 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. attr_accessor :collection # If set to `true`, the API won't create the score on Google Drive @@ -34,9 +34,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -63,17 +68,16 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreFork`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreFork`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'collection') self.collection = attributes[:'collection'] - else - self.collection = 'root' end if attributes.key?(:'google_drive_disabled') @@ -147,61 +151,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -218,24 +167,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_license.rb b/lib/flat_api/models/score_license.rb index bef3c84..5e8534e 100644 --- a/lib/flat_api/models/score_license.rb +++ b/lib/flat_api/models/score_license.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -23,10 +23,9 @@ class ScoreLicense CC_BY_NC = "cc-by-nc".freeze CC_BY_NC_SA = "cc-by-nc-sa".freeze CC_BY_NC_ND = "cc-by-nc-nd".freeze - NULL = "null".freeze def self.all_vars - @all_vars ||= [COPYRIGHT, CC0, CC_BY, CC_BY_SA, CC_BY_ND, CC_BY_NC, CC_BY_NC_SA, CC_BY_NC_ND, NULL].freeze + @all_vars ||= [COPYRIGHT, CC0, CC_BY, CC_BY_SA, CC_BY_ND, CC_BY_NC, CC_BY_NC_SA, CC_BY_NC_ND].freeze end # Builds the enum from string diff --git a/lib/flat_api/models/score_likes_counts.rb b/lib/flat_api/models/score_likes_counts.rb index c5e391d..d23faad 100644 --- a/lib/flat_api/models/score_likes_counts.rb +++ b/lib/flat_api/models/score_likes_counts.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,8 +14,8 @@ require 'time' module FlatApi - # A computed version of the weekly, monthly and total of number of likes for a score - class ScoreLikesCounts + # A computed version of the weekly, monthly, yearly and total number of likes for a score + class ScoreLikesCounts < ApiModelBase # The total number of likes of the score attr_accessor :total @@ -25,18 +25,27 @@ class ScoreLikesCounts # The number of new likes during the last month attr_accessor :monthly + # The number of new likes during the last year + attr_accessor :yearly + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'total' => :'total', :'weekly' => :'weekly', - :'monthly' => :'monthly' + :'monthly' => :'monthly', + :'yearly' => :'yearly' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -44,7 +53,8 @@ def self.openapi_types { :'total' => :'Float', :'weekly' => :'Float', - :'monthly' => :'Float' + :'monthly' => :'Float', + :'yearly' => :'Float' } end @@ -62,29 +72,28 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreLikesCounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreLikesCounts`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'total') self.total = attributes[:'total'] - else - self.total = 0 end if attributes.key?(:'weekly') self.weekly = attributes[:'weekly'] - else - self.weekly = 0 end if attributes.key?(:'monthly') self.monthly = attributes[:'monthly'] - else - self.monthly = 0 + end + + if attributes.key?(:'yearly') + self.yearly = attributes[:'yearly'] end end @@ -93,18 +102,6 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new - if @total.nil? - invalid_properties.push('invalid value for "total", total cannot be nil.') - end - - if @weekly.nil? - invalid_properties.push('invalid value for "weekly", weekly cannot be nil.') - end - - if @monthly.nil? - invalid_properties.push('invalid value for "monthly", monthly cannot be nil.') - end - invalid_properties end @@ -112,9 +109,6 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - return false if @total.nil? - return false if @weekly.nil? - return false if @monthly.nil? true end @@ -125,7 +119,8 @@ def ==(o) self.class == o.class && total == o.total && weekly == o.weekly && - monthly == o.monthly + monthly == o.monthly && + yearly == o.yearly end # @see the `==` method @@ -137,7 +132,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [total, weekly, monthly].hash + [total, weekly, monthly, yearly].hash end # Builds the object from hash @@ -163,61 +158,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -234,24 +174,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_modification.rb b/lib/flat_api/models/score_modification.rb index 9b38b3a..4c8d85f 100644 --- a/lib/flat_api/models/score_modification.rb +++ b/lib/flat_api/models/score_modification.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Edit the score metadata - class ScoreModification + class ScoreModification < ApiModelBase # The title of the score attr_accessor :title @@ -89,9 +89,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -134,9 +139,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreModification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreModification`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -299,61 +305,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -370,24 +321,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_plays_counts.rb b/lib/flat_api/models/score_plays_counts.rb index 8664564..fe193b8 100644 --- a/lib/flat_api/models/score_plays_counts.rb +++ b/lib/flat_api/models/score_plays_counts.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,8 +14,8 @@ require 'time' module FlatApi - # A computed version of the total, weekly, and monthly number of plays of the score - class ScorePlaysCounts + # A computed version of the total, weekly, monthly, and yearly number of plays of the score + class ScorePlaysCounts < ApiModelBase # The total number of plays of the score attr_accessor :total @@ -25,18 +25,27 @@ class ScorePlaysCounts # The monthly number of plays of the score attr_accessor :monthly + # The yearly number of plays of the score + attr_accessor :yearly + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'total' => :'total', :'weekly' => :'weekly', - :'monthly' => :'monthly' + :'monthly' => :'monthly', + :'yearly' => :'yearly' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -44,7 +53,8 @@ def self.openapi_types { :'total' => :'Float', :'weekly' => :'Float', - :'monthly' => :'Float' + :'monthly' => :'Float', + :'yearly' => :'Float' } end @@ -62,9 +72,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScorePlaysCounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScorePlaysCounts`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -80,6 +91,10 @@ def initialize(attributes = {}) if attributes.key?(:'monthly') self.monthly = attributes[:'monthly'] end + + if attributes.key?(:'yearly') + self.yearly = attributes[:'yearly'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -104,7 +119,8 @@ def ==(o) self.class == o.class && total == o.total && weekly == o.weekly && - monthly == o.monthly + monthly == o.monthly && + yearly == o.yearly end # @see the `==` method @@ -116,7 +132,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [total, weekly, monthly].hash + [total, weekly, monthly, yearly].hash end # Builds the object from hash @@ -142,61 +158,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -213,24 +174,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_privacy.rb b/lib/flat_api/models/score_privacy.rb index 1577555..2c18d78 100644 --- a/lib/flat_api/models/score_privacy.rb +++ b/lib/flat_api/models/score_privacy.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/score_revision.rb b/lib/flat_api/models/score_revision.rb index 58948f1..cc22681 100644 --- a/lib/flat_api/models/score_revision.rb +++ b/lib/flat_api/models/score_revision.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,17 +15,20 @@ module FlatApi # A score revision metadata - class ScoreRevision + class ScoreRevision < ApiModelBase # The unique identifier of the revision. attr_accessor :id # The user identifier who created the revision attr_accessor :user + # The score identifier + attr_accessor :score + attr_accessor :collaborators # The date when this revision was created - attr_accessor :creation_date + attr_accessor :date # The last event (action id) of the revision attr_accessor :event @@ -43,8 +46,9 @@ def self.attribute_map { :'id' => :'id', :'user' => :'user', + :'score' => :'score', :'collaborators' => :'collaborators', - :'creation_date' => :'creationDate', + :'date' => :'date', :'event' => :'event', :'description' => :'description', :'autosave' => :'autosave', @@ -52,9 +56,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -62,8 +71,9 @@ def self.openapi_types { :'id' => :'String', :'user' => :'String', + :'score' => :'String', :'collaborators' => :'Array', - :'creation_date' => :'Time', + :'date' => :'Time', :'event' => :'String', :'description' => :'String', :'autosave' => :'Boolean', @@ -85,29 +95,40 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreRevision`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreRevision`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] + else + self.id = nil end if attributes.key?(:'user') self.user = attributes[:'user'] end + if attributes.key?(:'score') + self.score = attributes[:'score'] + else + self.score = nil + end + if attributes.key?(:'collaborators') if (value = attributes[:'collaborators']).is_a?(Array) self.collaborators = value end end - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] + if attributes.key?(:'date') + self.date = attributes[:'date'] + else + self.date = nil end if attributes.key?(:'event') @@ -132,6 +153,18 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @score.nil? + invalid_properties.push('invalid value for "score", score cannot be nil.') + end + + if @date.nil? + invalid_properties.push('invalid value for "date", date cannot be nil.') + end + invalid_properties end @@ -139,9 +172,42 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @score.nil? + return false if @date.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] score Value to be assigned + def score=(score) + if score.nil? + fail ArgumentError, 'score cannot be nil' + end + + @score = score + end + + # Custom attribute writer method with validation + # @param [Object] date Value to be assigned + def date=(date) + if date.nil? + fail ArgumentError, 'date cannot be nil' + end + + @date = date + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -149,8 +215,9 @@ def ==(o) self.class == o.class && id == o.id && user == o.user && + score == o.score && collaborators == o.collaborators && - creation_date == o.creation_date && + date == o.date && event == o.event && description == o.description && autosave == o.autosave && @@ -166,7 +233,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, user, collaborators, creation_date, event, description, autosave, statistics].hash + [id, user, score, collaborators, date, event, description, autosave, statistics].hash end # Builds the object from hash @@ -192,61 +259,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -263,24 +275,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_revision_creation.rb b/lib/flat_api/models/score_revision_creation.rb index b4f3fd0..583fce0 100644 --- a/lib/flat_api/models/score_revision_creation.rb +++ b/lib/flat_api/models/score_revision_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A new created revision - class ScoreRevisionCreation + class ScoreRevisionCreation < ApiModelBase # 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. attr_accessor :data @@ -60,9 +60,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -89,9 +94,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreRevisionCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreRevisionCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -137,6 +143,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] data Value to be assigned + def data=(data) + if data.nil? + fail ArgumentError, 'data cannot be nil' + end + + @data = data + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] data_encoding Object to be assigned def data_encoding=(data_encoding) @@ -193,61 +209,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -264,24 +225,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_revision_statistics.rb b/lib/flat_api/models/score_revision_statistics.rb index 804edf5..c9d1c4f 100644 --- a/lib/flat_api/models/score_revision_statistics.rb +++ b/lib/flat_api/models/score_revision_statistics.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # The statistics related to the score revision (additions and deletions) - class ScoreRevisionStatistics + class ScoreRevisionStatistics < ApiModelBase # The number of additions operations in the last revision attr_accessor :additions @@ -38,9 +38,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -67,9 +72,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreRevisionStatistics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreRevisionStatistics`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -152,61 +158,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -223,24 +174,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_source.rb b/lib/flat_api/models/score_source.rb index c4af291..96320d5 100644 --- a/lib/flat_api/models/score_source.rb +++ b/lib/flat_api/models/score_source.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class ScoreSource + class ScoreSource < ApiModelBase # 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. attr_accessor :google_drive @@ -25,9 +25,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -51,9 +56,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreSource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -121,61 +127,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -192,24 +143,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_summary.rb b/lib/flat_api/models/score_summary.rb index c0fdadf..d8a7e4e 100644 --- a/lib/flat_api/models/score_summary.rb +++ b/lib/flat_api/models/score_summary.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A summary of the score details - class ScoreSummary + class ScoreSummary < ApiModelBase # The unique identifier of the score attr_accessor :id @@ -66,9 +66,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -97,9 +102,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -179,6 +185,56 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if title.nil? + fail ArgumentError, 'title cannot be nil' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] privacy Value to be assigned + def privacy=(privacy) + if privacy.nil? + fail ArgumentError, 'privacy cannot be nil' + end + + @privacy = privacy + end + + # Custom attribute writer method with validation + # @param [Object] user Value to be assigned + def user=(user) + if user.nil? + fail ArgumentError, 'user cannot be nil' + end + + @user = user + end + + # Custom attribute writer method with validation + # @param [Object] html_url Value to be assigned + def html_url=(html_url) + if html_url.nil? + fail ArgumentError, 'html_url cannot be nil' + end + + @html_url = html_url + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -227,61 +283,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -298,24 +299,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_track.rb b/lib/flat_api/models/score_track.rb index a277830..a1a9d06 100644 --- a/lib/flat_api/models/score_track.rb +++ b/lib/flat_api/models/score_track.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,14 +15,14 @@ module FlatApi # An audio track for a score - class ScoreTrack + class ScoreTrack < ApiModelBase # The unique identifier of the score track attr_accessor :id # Title of the track attr_accessor :title - # The unique identifier of the score + # The unique identifier of the score. Absent for Free Record performance submissions, which are recorded without an attached score. attr_accessor :score # The unique identifier of the track creator @@ -92,9 +92,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -130,9 +135,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreTrack`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreTrack`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -149,8 +155,6 @@ def initialize(attributes = {}) if attributes.key?(:'score') self.score = attributes[:'score'] - else - self.score = nil end if attributes.key?(:'creator') @@ -219,10 +223,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "id", id cannot be nil.') end - if @score.nil? - invalid_properties.push('invalid value for "score", score cannot be nil.') - end - if @creator.nil? invalid_properties.push('invalid value for "creator", creator cannot be nil.') end @@ -259,7 +259,6 @@ def list_invalid_properties def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? - return false if @score.nil? return false if @creator.nil? return false if @creation_date.nil? return false if @modification_date.nil? @@ -270,6 +269,86 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] creator Value to be assigned + def creator=(creator) + if creator.nil? + fail ArgumentError, 'creator cannot be nil' + end + + @creator = creator + end + + # Custom attribute writer method with validation + # @param [Object] creation_date Value to be assigned + def creation_date=(creation_date) + if creation_date.nil? + fail ArgumentError, 'creation_date cannot be nil' + end + + @creation_date = creation_date + end + + # Custom attribute writer method with validation + # @param [Object] modification_date Value to be assigned + def modification_date=(modification_date) + if modification_date.nil? + fail ArgumentError, 'modification_date cannot be nil' + end + + @modification_date = modification_date + end + + # Custom attribute writer method with validation + # @param [Object] default Value to be assigned + def default=(default) + if default.nil? + fail ArgumentError, 'default cannot be nil' + end + + @default = default + end + + # Custom attribute writer method with validation + # @param [Object] state Value to be assigned + def state=(state) + if state.nil? + fail ArgumentError, 'state cannot be nil' + end + + @state = state + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] purpose Value to be assigned + def purpose=(purpose) + if purpose.nil? + fail ArgumentError, 'purpose cannot be nil' + end + + @purpose = purpose + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -325,61 +404,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -396,24 +420,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_track_creation.rb b/lib/flat_api/models/score_track_creation.rb index 559303a..b960890 100644 --- a/lib/flat_api/models/score_track_creation.rb +++ b/lib/flat_api/models/score_track_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Creation of a new track. This one must contain the URL of the track or the corresponding file - class ScoreTrackCreation + class ScoreTrackCreation < ApiModelBase # Title of the track attr_accessor :title @@ -65,9 +65,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -96,9 +101,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreTrackCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreTrackCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -197,61 +203,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -268,24 +219,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_track_creation_response.rb b/lib/flat_api/models/score_track_creation_response.rb new file mode 100644 index 0000000..08d44bc --- /dev/null +++ b/lib/flat_api/models/score_track_creation_response.rb @@ -0,0 +1,165 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + # Response for track creation including optional upload information + class ScoreTrackCreationResponse < ApiModelBase + attr_accessor :track + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'track' => :'track' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'track' => :'ScoreTrack' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::ScoreTrackCreationResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreTrackCreationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'track') + self.track = attributes[:'track'] + else + self.track = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @track.nil? + invalid_properties.push('invalid value for "track", track cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @track.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] track Value to be assigned + def track=(track) + if track.nil? + fail ArgumentError, 'track cannot be nil' + end + + @track = track + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + track == o.track + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [track].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/flat_api/models/score_track_point.rb b/lib/flat_api/models/score_track_point.rb index f493cc6..3d87ee9 100644 --- a/lib/flat_api/models/score_track_point.rb +++ b/lib/flat_api/models/score_track_point.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # A track synchronization point - class ScoreTrackPoint + class ScoreTrackPoint < ApiModelBase # The type of the synchronization point. If the type is `measure`, the measure uuid must be present in `measureUuid` attr_accessor :type @@ -56,9 +56,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -84,9 +89,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreTrackPoint`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreTrackPoint`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -145,6 +151,16 @@ def type=(type) @type = type end + # Custom attribute writer method with validation + # @param [Object] time Value to be assigned + def time=(time) + if time.nil? + fail ArgumentError, 'time cannot be nil' + end + + @time = time + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -190,61 +206,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -261,24 +222,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_track_purpose.rb b/lib/flat_api/models/score_track_purpose.rb index df6f8b4..c95ce76 100644 --- a/lib/flat_api/models/score_track_purpose.rb +++ b/lib/flat_api/models/score_track_purpose.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/score_track_state.rb b/lib/flat_api/models/score_track_state.rb index 4f430e0..25f9b60 100644 --- a/lib/flat_api/models/score_track_state.rb +++ b/lib/flat_api/models/score_track_state.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/score_track_type.rb b/lib/flat_api/models/score_track_type.rb index b56723f..dbfab27 100644 --- a/lib/flat_api/models/score_track_type.rb +++ b/lib/flat_api/models/score_track_type.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/score_track_update.rb b/lib/flat_api/models/score_track_update.rb index 349ac6f..12c9562 100644 --- a/lib/flat_api/models/score_track_update.rb +++ b/lib/flat_api/models/score_track_update.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Update an existing track. - class ScoreTrackUpdate + class ScoreTrackUpdate < ApiModelBase # Title of the track attr_accessor :title @@ -24,6 +24,8 @@ class ScoreTrackUpdate attr_accessor :state + attr_accessor :purpose + attr_accessor :synchronization_points class EnumAttributeValidator @@ -54,13 +56,19 @@ def self.attribute_map :'title' => :'title', :'default' => :'default', :'state' => :'state', + :'purpose' => :'purpose', :'synchronization_points' => :'synchronizationPoints' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -69,6 +77,7 @@ def self.openapi_types :'title' => :'String', :'default' => :'Boolean', :'state' => :'ScoreTrackState', + :'purpose' => :'ScoreTrackPurpose', :'synchronization_points' => :'Array' } end @@ -87,9 +96,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreTrackUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreTrackUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -108,6 +118,12 @@ def initialize(attributes = {}) self.state = 'draft' end + if attributes.key?(:'purpose') + self.purpose = attributes[:'purpose'] + else + self.purpose = 'common' + end + if attributes.key?(:'synchronization_points') if (value = attributes[:'synchronization_points']).is_a?(Array) self.synchronization_points = value @@ -138,6 +154,7 @@ def ==(o) title == o.title && default == o.default && state == o.state && + purpose == o.purpose && synchronization_points == o.synchronization_points end @@ -150,7 +167,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [title, default, state, synchronization_points].hash + [title, default, state, purpose, synchronization_points].hash end # Builds the object from hash @@ -176,61 +193,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -247,24 +209,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/score_views_counts.rb b/lib/flat_api/models/score_views_counts.rb index 94665f4..7240730 100644 --- a/lib/flat_api/models/score_views_counts.rb +++ b/lib/flat_api/models/score_views_counts.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,8 +14,8 @@ require 'time' module FlatApi - # A computed version of the total, weekly, and monthly number of views of the score - class ScoreViewsCounts + # A computed version of the total, weekly, monthly, and yearly number of views of the score + class ScoreViewsCounts < ApiModelBase # The total number of views of the score attr_accessor :total @@ -25,18 +25,27 @@ class ScoreViewsCounts # The monthly number of views of the score attr_accessor :monthly + # The yearly number of views of the score + attr_accessor :yearly + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'total' => :'total', :'weekly' => :'weekly', - :'monthly' => :'monthly' + :'monthly' => :'monthly', + :'yearly' => :'yearly' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -44,7 +53,8 @@ def self.openapi_types { :'total' => :'Float', :'weekly' => :'Float', - :'monthly' => :'Float' + :'monthly' => :'Float', + :'yearly' => :'Float' } end @@ -62,9 +72,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreViewsCounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::ScoreViewsCounts`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -80,6 +91,10 @@ def initialize(attributes = {}) if attributes.key?(:'monthly') self.monthly = attributes[:'monthly'] end + + if attributes.key?(:'yearly') + self.yearly = attributes[:'yearly'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -104,7 +119,8 @@ def ==(o) self.class == o.class && total == o.total && weekly == o.weekly && - monthly == o.monthly + monthly == o.monthly && + yearly == o.yearly end # @see the `==` method @@ -116,7 +132,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [total, weekly, monthly].hash + [total, weekly, monthly, yearly].hash end # Builds the object from hash @@ -142,61 +158,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -213,24 +174,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/task.rb b/lib/flat_api/models/task.rb index bbcc673..988a370 100644 --- a/lib/flat_api/models/task.rb +++ b/lib/flat_api/models/task.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,11 +15,11 @@ module FlatApi # An asynchronous task - class Task + class Task < ApiModelBase # Unique identifier of the task attr_accessor :id - # Type of the task (e.g. audio-export) + # 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 attr_accessor :type # State of the Task @@ -31,6 +31,9 @@ class Task # The score unique identifier for tasks related to scores attr_accessor :score + # The score revision identifier for tasks related to scores + attr_accessor :revision + attr_accessor :progress # The creation date of the task @@ -47,6 +50,12 @@ class Task # If any errors happened when processing this task, the list of errors identifiers attr_accessor :error_history + # Whether the task can be canceled by the user. Only `true` when the task is in `created` state (waiting to be processed). + attr_accessor :is_cancellable + + # Child tasks for hierarchical task structures (e.g., conversion subtasks) + attr_accessor :children + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -77,18 +86,26 @@ def self.attribute_map :'state' => :'state', :'format' => :'format', :'score' => :'score', + :'revision' => :'revision', :'progress' => :'progress', :'creation_date' => :'creationDate', :'modification_date' => :'modificationDate', :'done_date' => :'doneDate', :'result' => :'result', - :'error_history' => :'errorHistory' + :'error_history' => :'errorHistory', + :'is_cancellable' => :'isCancellable', + :'children' => :'children' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -99,12 +116,15 @@ def self.openapi_types :'state' => :'String', :'format' => :'String', :'score' => :'String', + :'revision' => :'String', :'progress' => :'TaskProgress', :'creation_date' => :'Time', :'modification_date' => :'Time', :'done_date' => :'Time', :'result' => :'TaskResult', - :'error_history' => :'Array' + :'error_history' => :'Array', + :'is_cancellable' => :'Boolean', + :'children' => :'Array' } end @@ -122,9 +142,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::Task`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::Task`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -153,6 +174,10 @@ def initialize(attributes = {}) self.score = attributes[:'score'] end + if attributes.key?(:'revision') + self.revision = attributes[:'revision'] + end + if attributes.key?(:'progress') self.progress = attributes[:'progress'] end @@ -178,6 +203,16 @@ def initialize(attributes = {}) self.error_history = value end end + + if attributes.key?(:'is_cancellable') + self.is_cancellable = attributes[:'is_cancellable'] + end + + if attributes.key?(:'children') + if (value = attributes[:'children']).is_a?(Array) + self.children = value + end + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -202,15 +237,25 @@ def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @state.nil? - state_validator = EnumAttributeValidator.new('String', ["created", "doing", "done", "canceled", "error"]) + state_validator = EnumAttributeValidator.new('String', ["created", "blocked", "doing", "done", "canceled", "error"]) return false unless state_validator.valid?(@state) true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] state Object to be assigned def state=(state) - validator = EnumAttributeValidator.new('String', ["created", "doing", "done", "canceled", "error"]) + validator = EnumAttributeValidator.new('String', ["created", "blocked", "doing", "done", "canceled", "error"]) unless validator.valid?(state) fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}." end @@ -227,12 +272,15 @@ def ==(o) state == o.state && format == o.format && score == o.score && + revision == o.revision && progress == o.progress && creation_date == o.creation_date && modification_date == o.modification_date && done_date == o.done_date && result == o.result && - error_history == o.error_history + error_history == o.error_history && + is_cancellable == o.is_cancellable && + children == o.children end # @see the `==` method @@ -244,7 +292,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, type, state, format, score, progress, creation_date, modification_date, done_date, result, error_history].hash + [id, type, state, format, score, revision, progress, creation_date, modification_date, done_date, result, error_history, is_cancellable, children].hash end # Builds the object from hash @@ -270,61 +318,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -341,24 +334,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/task_export_options.rb b/lib/flat_api/models/task_export_options.rb index 40432a8..b0325da 100644 --- a/lib/flat_api/models/task_export_options.rb +++ b/lib/flat_api/models/task_export_options.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Options for the requested export - class TaskExportOptions + class TaskExportOptions < ApiModelBase # A list of parts to specifically export attr_accessor :parts @@ -26,9 +26,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -52,9 +57,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::TaskExportOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::TaskExportOptions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -124,61 +130,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -195,24 +146,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/task_progress.rb b/lib/flat_api/models/task_progress.rb index 6246998..dc2d32f 100644 --- a/lib/flat_api/models/task_progress.rb +++ b/lib/flat_api/models/task_progress.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Details about the task progression - class TaskProgress + class TaskProgress < ApiModelBase # Percent of the task progression attr_accessor :percent @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::TaskProgress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::TaskProgress`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,61 +138,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -203,24 +154,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/task_result.rb b/lib/flat_api/models/task_result.rb index 57b9a3e..e36274f 100644 --- a/lib/flat_api/models/task_result.rb +++ b/lib/flat_api/models/task_result.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Optional result information about this task - class TaskResult + class TaskResult < ApiModelBase # URL returned by the task worker attr_accessor :url @@ -30,9 +30,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -57,9 +62,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::TaskResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::TaskResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -132,61 +138,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -203,24 +154,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/teaching_theme.rb b/lib/flat_api/models/teaching_theme.rb new file mode 100644 index 0000000..2fbe864 --- /dev/null +++ b/lib/flat_api/models/teaching_theme.rb @@ -0,0 +1,47 @@ +=begin +#Flat API + +#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + +The version of the OpenAPI document: 2.26.1 +Contact: developers@flat.io +Generated by: https://openapi-generator.tech +Generator version: 7.24.0 + +=end + +require 'date' +require 'time' + +module FlatApi + class TeachingTheme + COMPOSITION = "composition".freeze + MUSIC_THEORY = "music-theory".freeze + GENERAL_MUSIC = "general-music".freeze + BAND = "band".freeze + CHOIR = "choir".freeze + ORCHESTRA = "orchestra".freeze + JAZZ_ENSEMBLE = "jazz-ensemble".freeze + MUSIC_TECHNOLOGY = "music-technology".freeze + OTHER = "other".freeze + + def self.all_vars + @all_vars ||= [COMPOSITION, MUSIC_THEORY, GENERAL_MUSIC, BAND, CHOIR, ORCHESTRA, JAZZ_ENSEMBLE, MUSIC_TECHNOLOGY, OTHER].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if TeachingTheme.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #TeachingTheme" + end + end +end diff --git a/lib/flat_api/models/tutteo_product.rb b/lib/flat_api/models/tutteo_product.rb index 52b8a30..283b70e 100644 --- a/lib/flat_api/models/tutteo_product.rb +++ b/lib/flat_api/models/tutteo_product.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end diff --git a/lib/flat_api/models/user_admin_update.rb b/lib/flat_api/models/user_admin_update.rb index 6f34f3c..da88197 100644 --- a/lib/flat_api/models/user_admin_update.rb +++ b/lib/flat_api/models/user_admin_update.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # User update as an organization admin - class UserAdminUpdate + class UserAdminUpdate < ApiModelBase # Password of the account attr_accessor :password @@ -67,9 +67,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -98,9 +103,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserAdminUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserAdminUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -140,7 +146,7 @@ def list_invalid_properties end if !@password.nil? && @password.to_s.length < 6 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 6.') + invalid_properties.push('invalid value for "password", the character length must be greater than or equal to 6.') end if !@username.nil? && @username.to_s.length > 30 @@ -148,12 +154,7 @@ def list_invalid_properties end if !@username.nil? && @username.to_s.length < 1 - invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.') - end - - pattern = Regexp.new(/^[A-Za-z0-9\-_.]+$/) - if !@username.nil? && @username !~ pattern - invalid_properties.push("invalid value for \"username\", must conform to the pattern #{pattern}.") + invalid_properties.push('invalid value for "username", the character length must be greater than or equal to 1.') end if !@firstname.nil? && @firstname.to_s.length > 60 @@ -175,7 +176,6 @@ def valid? return false if !@password.nil? && @password.to_s.length < 6 return false if !@username.nil? && @username.to_s.length > 30 return false if !@username.nil? && @username.to_s.length < 1 - return false if !@username.nil? && @username !~ Regexp.new(/^[A-Za-z0-9\-_.]+$/) return false if !@firstname.nil? && @firstname.to_s.length > 60 return false if !@lastname.nil? && @lastname.to_s.length > 60 true @@ -193,7 +193,7 @@ def password=(password) end if password.to_s.length < 6 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 6.' + fail ArgumentError, 'invalid value for "password", the character length must be greater than or equal to 6.' end @password = password @@ -211,12 +211,7 @@ def username=(username) end if username.to_s.length < 1 - fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.' - end - - pattern = Regexp.new(/^[A-Za-z0-9\-_.]+$/) - if username !~ pattern - fail ArgumentError, "invalid value for \"username\", must conform to the pattern #{pattern}." + fail ArgumentError, 'invalid value for "username", the character length must be greater than or equal to 1.' end @username = username @@ -298,61 +293,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -369,24 +309,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_azure_details.rb b/lib/flat_api/models/user_azure_details.rb index 3f7dbb2..215aee7 100644 --- a/lib/flat_api/models/user_azure_details.rb +++ b/lib/flat_api/models/user_azure_details.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class UserAzureDetails + class UserAzureDetails < ApiModelBase # User object identifier on Azure AD attr_accessor :oid @@ -33,9 +33,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -61,9 +66,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserAzureDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserAzureDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -141,61 +147,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -212,24 +163,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_basics.rb b/lib/flat_api/models/user_basics.rb index 0641c18..51daee7 100644 --- a/lib/flat_api/models/user_basics.rb +++ b/lib/flat_api/models/user_basics.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class UserBasics + class UserBasics < ApiModelBase # The user unique identifier attr_accessor :id @@ -82,9 +82,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -118,9 +123,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserBasics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserBasics`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -215,6 +221,16 @@ def valid? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) @@ -225,6 +241,26 @@ def type=(type) @type = type end + # Custom attribute writer method with validation + # @param [Object] product Value to be assigned + def product=(product) + if product.nil? + fail ArgumentError, 'product cannot be nil' + end + + @product = product + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if username.nil? + fail ArgumentError, 'username cannot be nil' + end + + @username = username + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -277,61 +313,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -348,24 +329,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_community_profile_links.rb b/lib/flat_api/models/user_community_profile_links.rb index 50ed877..1c57d73 100644 --- a/lib/flat_api/models/user_community_profile_links.rb +++ b/lib/flat_api/models/user_community_profile_links.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Social networks links - class UserCommunityProfileLinks + class UserCommunityProfileLinks < ApiModelBase # Spotify Profile URL attr_accessor :spotify_url @@ -46,9 +46,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -83,9 +88,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserCommunityProfileLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserCommunityProfileLinks`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -178,61 +184,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -249,24 +200,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_creation.rb b/lib/flat_api/models/user_creation.rb index 888454d..c47ab1e 100644 --- a/lib/flat_api/models/user_creation.rb +++ b/lib/flat_api/models/user_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # User creation - class UserCreation + class UserCreation < ApiModelBase # Username of the new account attr_accessor :username @@ -31,6 +31,7 @@ class UserCreation # Password of the new account attr_accessor :password + # User language. Input values will be automatically normalized to a supported locale code. attr_accessor :locale # Role of the new account @@ -71,9 +72,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -84,7 +90,7 @@ def self.openapi_types :'lastname' => :'String', :'email' => :'String', :'password' => :'String', - :'locale' => :'FlatLocales', + :'locale' => :'String', :'role' => :'String' } end @@ -103,9 +109,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -161,12 +168,7 @@ def list_invalid_properties end if @username.to_s.length < 1 - invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.') - end - - pattern = Regexp.new(/^[A-Za-z0-9\-_.]+$/) - if @username !~ pattern - invalid_properties.push("invalid value for \"username\", must conform to the pattern #{pattern}.") + invalid_properties.push('invalid value for "username", the character length must be greater than or equal to 1.') end if !@firstname.nil? && @firstname.to_s.length > 60 @@ -186,7 +188,7 @@ def list_invalid_properties end if @password.to_s.length < 6 - invalid_properties.push('invalid value for "password", the character length must be great than or equal to 6.') + invalid_properties.push('invalid value for "password", the character length must be greater than or equal to 6.') end invalid_properties @@ -199,13 +201,12 @@ def valid? return false if @username.nil? return false if @username.to_s.length > 30 return false if @username.to_s.length < 1 - return false if @username !~ Regexp.new(/^[A-Za-z0-9\-_.]+$/) return false if !@firstname.nil? && @firstname.to_s.length > 60 return false if !@lastname.nil? && @lastname.to_s.length > 60 return false if @password.nil? return false if @password.to_s.length > 1000 return false if @password.to_s.length < 6 - role_validator = EnumAttributeValidator.new('String', ["user", "teacher", "admin"]) + role_validator = EnumAttributeValidator.new('String', ["user", "teacher", "admin", "accountAdmin"]) return false unless role_validator.valid?(@role) true end @@ -222,12 +223,7 @@ def username=(username) end if username.to_s.length < 1 - fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.' - end - - pattern = Regexp.new(/^[A-Za-z0-9\-_.]+$/) - if username !~ pattern - fail ArgumentError, "invalid value for \"username\", must conform to the pattern #{pattern}." + fail ArgumentError, 'invalid value for "username", the character length must be greater than or equal to 1.' end @username = username @@ -273,7 +269,7 @@ def password=(password) end if password.to_s.length < 6 - fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 6.' + fail ArgumentError, 'invalid value for "password", the character length must be greater than or equal to 6.' end @password = password @@ -282,7 +278,7 @@ def password=(password) # Custom attribute writer method checking allowed values (enum). # @param [Object] role Object to be assigned def role=(role) - validator = EnumAttributeValidator.new('String', ["user", "teacher", "admin"]) + validator = EnumAttributeValidator.new('String', ["user", "teacher", "admin", "accountAdmin"]) unless validator.valid?(role) fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}." end @@ -338,61 +334,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -409,24 +350,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_details.rb b/lib/flat_api/models/user_details.rb index 223b5b3..e634826 100644 --- a/lib/flat_api/models/user_details.rb +++ b/lib/flat_api/models/user_details.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # User details - class UserDetails + class UserDetails < ApiModelBase # The user unique identifier attr_accessor :id @@ -73,22 +73,32 @@ class UserDetails # Number of public scores the user have attr_accessor :owned_public_scores_count + # Total number of public scores the user participates in (owned + joined) + attr_accessor :all_public_scores_count + + # Number of likes on the user published scores + attr_accessor :likes_count + + # Number of plays on the user published scores + attr_accessor :plays_count + # Cover picture (backgroud) for the profile attr_accessor :cover_picture # Theme (background) for the profile attr_accessor :profile_theme - # An array of the instrument identifiers. The format of the strings is `{instrument-group}.{instrument-id}`. - attr_accessor :instruments - attr_accessor :links + # Whether the user's email address has been verified + attr_accessor :is_email_verified + attr_accessor :azure_details # Tell either this user profile is private or not (individual accounts only) attr_accessor :private_profile + # 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` attr_accessor :locale # For Flat for Education accounts, list of Group identifiers the user is part of. @@ -145,10 +155,13 @@ def self.attribute_map :'followers_count' => :'followersCount', :'following_count' => :'followingCount', :'owned_public_scores_count' => :'ownedPublicScoresCount', + :'all_public_scores_count' => :'allPublicScoresCount', + :'likes_count' => :'likesCount', + :'plays_count' => :'playsCount', :'cover_picture' => :'coverPicture', :'profile_theme' => :'profileTheme', - :'instruments' => :'instruments', :'links' => :'links', + :'is_email_verified' => :'isEmailVerified', :'azure_details' => :'azureDetails', :'private_profile' => :'privateProfile', :'locale' => :'locale', @@ -158,9 +171,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -186,13 +204,16 @@ def self.openapi_types :'followers_count' => :'Integer', :'following_count' => :'Integer', :'owned_public_scores_count' => :'Integer', + :'all_public_scores_count' => :'Integer', + :'likes_count' => :'Integer', + :'plays_count' => :'Integer', :'cover_picture' => :'String', :'profile_theme' => :'String', - :'instruments' => :'Array', :'links' => :'UserCommunityProfileLinks', + :'is_email_verified' => :'Boolean', :'azure_details' => :'UserAzureDetails', :'private_profile' => :'Boolean', - :'locale' => :'FlatLocales', + :'locale' => :'String', :'groups' => :'Array', :'picture_file' => :'String', :'cover_picture_file' => :'String' @@ -202,8 +223,6 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'picture', - :'cover_picture', :'picture_file', :'cover_picture_file' ]) @@ -224,9 +243,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -323,6 +343,18 @@ def initialize(attributes = {}) self.owned_public_scores_count = attributes[:'owned_public_scores_count'] end + if attributes.key?(:'all_public_scores_count') + self.all_public_scores_count = attributes[:'all_public_scores_count'] + end + + if attributes.key?(:'likes_count') + self.likes_count = attributes[:'likes_count'] + end + + if attributes.key?(:'plays_count') + self.plays_count = attributes[:'plays_count'] + end + if attributes.key?(:'cover_picture') self.cover_picture = attributes[:'cover_picture'] end @@ -331,16 +363,14 @@ def initialize(attributes = {}) self.profile_theme = attributes[:'profile_theme'] end - if attributes.key?(:'instruments') - if (value = attributes[:'instruments']).is_a?(Array) - self.instruments = value - end - end - if attributes.key?(:'links') self.links = attributes[:'links'] end + if attributes.key?(:'is_email_verified') + self.is_email_verified = attributes[:'is_email_verified'] + end + if attributes.key?(:'azure_details') self.azure_details = attributes[:'azure_details'] end @@ -391,6 +421,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "username", username cannot be nil.') end + if @picture.nil? + invalid_properties.push('invalid value for "picture", picture cannot be nil.') + end + invalid_properties end @@ -404,9 +438,20 @@ def valid? return false unless type_validator.valid?(@type) return false if @product.nil? return false if @username.nil? + return false if @picture.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) @@ -417,6 +462,36 @@ def type=(type) @type = type end + # Custom attribute writer method with validation + # @param [Object] product Value to be assigned + def product=(product) + if product.nil? + fail ArgumentError, 'product cannot be nil' + end + + @product = product + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if username.nil? + fail ArgumentError, 'username cannot be nil' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] picture Value to be assigned + def picture=(picture) + if picture.nil? + fail ArgumentError, 'picture cannot be nil' + end + + @picture = picture + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -442,10 +517,13 @@ def ==(o) followers_count == o.followers_count && following_count == o.following_count && owned_public_scores_count == o.owned_public_scores_count && + all_public_scores_count == o.all_public_scores_count && + likes_count == o.likes_count && + plays_count == o.plays_count && cover_picture == o.cover_picture && profile_theme == o.profile_theme && - instruments == o.instruments && links == o.links && + is_email_verified == o.is_email_verified && azure_details == o.azure_details && private_profile == o.private_profile && locale == o.locale && @@ -463,7 +541,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, type, product, username, printable_name, firstname, lastname, name, picture, badges, organization, organization_role, class_role, html_url, bio, registration_date, liked_scores_count, followers_count, following_count, owned_public_scores_count, cover_picture, profile_theme, instruments, links, azure_details, private_profile, locale, groups, picture_file, cover_picture_file].hash + [id, type, product, username, printable_name, firstname, lastname, name, picture, badges, organization, organization_role, class_role, html_url, bio, registration_date, liked_scores_count, followers_count, following_count, owned_public_scores_count, all_public_scores_count, likes_count, plays_count, cover_picture, profile_theme, links, is_email_verified, azure_details, private_profile, locale, groups, picture_file, cover_picture_file].hash end # Builds the object from hash @@ -489,61 +567,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -560,24 +583,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_details_admin.rb b/lib/flat_api/models/user_details_admin.rb index 2b19a94..a512241 100644 --- a/lib/flat_api/models/user_details_admin.rb +++ b/lib/flat_api/models/user_details_admin.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # User details (view for organization teacher / admin) - class UserDetailsAdmin + class UserDetailsAdmin < ApiModelBase # The user unique identifier attr_accessor :id @@ -66,6 +66,9 @@ class UserDetailsAdmin # For Flat for Education accounts, list of Group identifiers the user is part of. attr_accessor :groups + # 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. + attr_accessor :is_edu_testing_student + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -108,13 +111,19 @@ def self.attribute_map :'email' => :'email', :'last_activity_date' => :'lastActivityDate', :'license' => :'license', - :'groups' => :'groups' + :'groups' => :'groups', + :'is_edu_testing_student' => :'isEduTestingStudent' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -137,14 +146,14 @@ def self.openapi_types :'email' => :'String', :'last_activity_date' => :'Time', :'license' => :'UserDetailsAdminAllOfLicense', - :'groups' => :'Array' + :'groups' => :'Array', + :'is_edu_testing_student' => :'Boolean' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'picture', ]) end @@ -163,9 +172,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserDetailsAdmin`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserDetailsAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -255,6 +265,10 @@ def initialize(attributes = {}) self.groups = value end end + + if attributes.key?(:'is_edu_testing_student') + self.is_edu_testing_student = attributes[:'is_edu_testing_student'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -278,6 +292,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "username", username cannot be nil.') end + if @picture.nil? + invalid_properties.push('invalid value for "picture", picture cannot be nil.') + end + invalid_properties end @@ -291,9 +309,20 @@ def valid? return false unless type_validator.valid?(@type) return false if @product.nil? return false if @username.nil? + return false if @picture.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) @@ -304,6 +333,36 @@ def type=(type) @type = type end + # Custom attribute writer method with validation + # @param [Object] product Value to be assigned + def product=(product) + if product.nil? + fail ArgumentError, 'product cannot be nil' + end + + @product = product + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if username.nil? + fail ArgumentError, 'username cannot be nil' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] picture Value to be assigned + def picture=(picture) + if picture.nil? + fail ArgumentError, 'picture cannot be nil' + end + + @picture = picture + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -326,7 +385,8 @@ def ==(o) email == o.email && last_activity_date == o.last_activity_date && license == o.license && - groups == o.groups + groups == o.groups && + is_edu_testing_student == o.is_edu_testing_student end # @see the `==` method @@ -338,7 +398,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, type, product, username, printable_name, firstname, lastname, name, picture, badges, organization, organization_role, class_role, html_url, email, last_activity_date, license, groups].hash + [id, type, product, username, printable_name, firstname, lastname, name, picture, badges, organization, organization_role, class_role, html_url, email, last_activity_date, license, groups, is_edu_testing_student].hash end # Builds the object from hash @@ -364,61 +424,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -435,24 +440,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_details_admin_all_of_license.rb b/lib/flat_api/models/user_details_admin_all_of_license.rb index 0964951..ed7ff97 100644 --- a/lib/flat_api/models/user_details_admin_all_of_license.rb +++ b/lib/flat_api/models/user_details_admin_all_of_license.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Current active license of the user - class UserDetailsAdminAllOfLicense + class UserDetailsAdminAllOfLicense < ApiModelBase # ID of the current license attr_accessor :id @@ -62,9 +62,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -92,9 +97,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserDetailsAdminAllOfLicense`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserDetailsAdminAllOfLicense`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -184,61 +190,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -255,24 +206,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_public.rb b/lib/flat_api/models/user_public.rb index 6ef4c11..ed4f259 100644 --- a/lib/flat_api/models/user_public.rb +++ b/lib/flat_api/models/user_public.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Public User details - class UserPublic + class UserPublic < ApiModelBase # The user unique identifier attr_accessor :id @@ -73,15 +73,21 @@ class UserPublic # Number of public scores the user have attr_accessor :owned_public_scores_count + # Total number of public scores the user participates in (owned + joined) + attr_accessor :all_public_scores_count + + # Number of likes on the user published scores + attr_accessor :likes_count + + # Number of plays on the user published scores + attr_accessor :plays_count + # Cover picture (backgroud) for the profile attr_accessor :cover_picture # Theme (background) for the profile attr_accessor :profile_theme - # An array of the instrument identifiers. The format of the strings is `{instrument-group}.{instrument-id}`. - attr_accessor :instruments - attr_accessor :links class EnumAttributeValidator @@ -129,16 +135,23 @@ def self.attribute_map :'followers_count' => :'followersCount', :'following_count' => :'followingCount', :'owned_public_scores_count' => :'ownedPublicScoresCount', + :'all_public_scores_count' => :'allPublicScoresCount', + :'likes_count' => :'likesCount', + :'plays_count' => :'playsCount', :'cover_picture' => :'coverPicture', :'profile_theme' => :'profileTheme', - :'instruments' => :'instruments', :'links' => :'links' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -164,9 +177,11 @@ def self.openapi_types :'followers_count' => :'Integer', :'following_count' => :'Integer', :'owned_public_scores_count' => :'Integer', + :'all_public_scores_count' => :'Integer', + :'likes_count' => :'Integer', + :'plays_count' => :'Integer', :'cover_picture' => :'String', :'profile_theme' => :'String', - :'instruments' => :'Array', :'links' => :'UserCommunityProfileLinks' } end @@ -174,7 +189,6 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'picture', :'cover_picture', ]) end @@ -194,9 +208,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserPublic`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserPublic`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -293,6 +308,18 @@ def initialize(attributes = {}) self.owned_public_scores_count = attributes[:'owned_public_scores_count'] end + if attributes.key?(:'all_public_scores_count') + self.all_public_scores_count = attributes[:'all_public_scores_count'] + end + + if attributes.key?(:'likes_count') + self.likes_count = attributes[:'likes_count'] + end + + if attributes.key?(:'plays_count') + self.plays_count = attributes[:'plays_count'] + end + if attributes.key?(:'cover_picture') self.cover_picture = attributes[:'cover_picture'] end @@ -301,12 +328,6 @@ def initialize(attributes = {}) self.profile_theme = attributes[:'profile_theme'] end - if attributes.key?(:'instruments') - if (value = attributes[:'instruments']).is_a?(Array) - self.instruments = value - end - end - if attributes.key?(:'links') self.links = attributes[:'links'] end @@ -333,6 +354,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "username", username cannot be nil.') end + if @picture.nil? + invalid_properties.push('invalid value for "picture", picture cannot be nil.') + end + invalid_properties end @@ -346,9 +371,20 @@ def valid? return false unless type_validator.valid?(@type) return false if @product.nil? return false if @username.nil? + return false if @picture.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) @@ -359,6 +395,36 @@ def type=(type) @type = type end + # Custom attribute writer method with validation + # @param [Object] product Value to be assigned + def product=(product) + if product.nil? + fail ArgumentError, 'product cannot be nil' + end + + @product = product + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if username.nil? + fail ArgumentError, 'username cannot be nil' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] picture Value to be assigned + def picture=(picture) + if picture.nil? + fail ArgumentError, 'picture cannot be nil' + end + + @picture = picture + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -384,9 +450,11 @@ def ==(o) followers_count == o.followers_count && following_count == o.following_count && owned_public_scores_count == o.owned_public_scores_count && + all_public_scores_count == o.all_public_scores_count && + likes_count == o.likes_count && + plays_count == o.plays_count && cover_picture == o.cover_picture && profile_theme == o.profile_theme && - instruments == o.instruments && links == o.links end @@ -399,7 +467,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, type, product, username, printable_name, firstname, lastname, name, picture, badges, organization, organization_role, class_role, html_url, bio, registration_date, liked_scores_count, followers_count, following_count, owned_public_scores_count, cover_picture, profile_theme, instruments, links].hash + [id, type, product, username, printable_name, firstname, lastname, name, picture, badges, organization, organization_role, class_role, html_url, bio, registration_date, liked_scores_count, followers_count, following_count, owned_public_scores_count, all_public_scores_count, likes_count, plays_count, cover_picture, profile_theme, links].hash end # Builds the object from hash @@ -425,61 +493,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -496,24 +509,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_public_summary.rb b/lib/flat_api/models/user_public_summary.rb index d7d6102..8843ee2 100644 --- a/lib/flat_api/models/user_public_summary.rb +++ b/lib/flat_api/models/user_public_summary.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -15,7 +15,7 @@ module FlatApi # Public User details summary - class UserPublicSummary + class UserPublicSummary < ApiModelBase # The user unique identifier attr_accessor :id @@ -97,9 +97,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -125,7 +130,6 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'picture', ]) end @@ -144,9 +148,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserPublicSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserPublicSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -241,6 +246,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "username", username cannot be nil.') end + if @picture.nil? + invalid_properties.push('invalid value for "picture", picture cannot be nil.') + end + invalid_properties end @@ -254,9 +263,20 @@ def valid? return false unless type_validator.valid?(@type) return false if @product.nil? return false if @username.nil? + return false if @picture.nil? true end + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) @@ -267,6 +287,36 @@ def type=(type) @type = type end + # Custom attribute writer method with validation + # @param [Object] product Value to be assigned + def product=(product) + if product.nil? + fail ArgumentError, 'product cannot be nil' + end + + @product = product + end + + # Custom attribute writer method with validation + # @param [Object] username Value to be assigned + def username=(username) + if username.nil? + fail ArgumentError, 'username cannot be nil' + end + + @username = username + end + + # Custom attribute writer method with validation + # @param [Object] picture Value to be assigned + def picture=(picture) + if picture.nil? + fail ArgumentError, 'picture cannot be nil' + end + + @picture = picture + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -323,61 +373,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -394,24 +389,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_signin_link.rb b/lib/flat_api/models/user_signin_link.rb index 210963a..402e0d3 100644 --- a/lib/flat_api/models/user_signin_link.rb +++ b/lib/flat_api/models/user_signin_link.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,10 +14,13 @@ require 'time' module FlatApi - class UserSigninLink + class UserSigninLink < ApiModelBase # URL to use to sign in to this account attr_accessor :url + # Raw sign-in token, can be used to build custom URLs (e.g. deep links) + attr_accessor :token + # Date when the link expires attr_accessor :expiration_date @@ -25,19 +28,26 @@ class UserSigninLink def self.attribute_map { :'url' => :'url', + :'token' => :'token', :'expiration_date' => :'expirationDate' } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. def self.openapi_types { :'url' => :'String', + :'token' => :'String', :'expiration_date' => :'Time' } end @@ -56,9 +66,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserSigninLink`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserSigninLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -67,6 +78,10 @@ def initialize(attributes = {}) self.url = attributes[:'url'] end + if attributes.key?(:'token') + self.token = attributes[:'token'] + end + if attributes.key?(:'expiration_date') self.expiration_date = attributes[:'expiration_date'] end @@ -93,6 +108,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && url == o.url && + token == o.token && expiration_date == o.expiration_date end @@ -105,7 +121,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [url, expiration_date].hash + [url, token, expiration_date].hash end # Builds the object from hash @@ -131,61 +147,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -202,24 +163,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/models/user_signin_link_creation.rb b/lib/flat_api/models/user_signin_link_creation.rb index 12bb806..99afe28 100644 --- a/lib/flat_api/models/user_signin_link_creation.rb +++ b/lib/flat_api/models/user_signin_link_creation.rb @@ -1,12 +1,12 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end @@ -14,7 +14,7 @@ require 'time' module FlatApi - class UserSigninLinkCreation + class UserSigninLinkCreation < ApiModelBase # Path to redirect to after signin attr_accessor :destination_path @@ -25,9 +25,14 @@ def self.attribute_map } end + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + # Returns all the JSON keys this model knows about def self.acceptable_attributes - attribute_map.values + acceptable_attribute_map.values end # Attribute type mapping. @@ -51,9 +56,10 @@ def initialize(attributes = {}) end # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserSigninLinkCreation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::UserSigninLinkCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } @@ -123,61 +129,6 @@ def self.build_from_hash(attributes) new(transformed_hash) end - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = FlatApi.const_get(type) - klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash @@ -194,24 +145,6 @@ def to_hash hash end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end end diff --git a/lib/flat_api/oauth.rb b/lib/flat_api/oauth.rb new file mode 100644 index 0000000..67bdf41 --- /dev/null +++ b/lib/flat_api/oauth.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +require 'json' +require 'net/http' +require 'uri' +require 'flat_api/errors' + +# OAuth2 support for the Flat API. +# +# The public specification declares one security scheme: OAuth2 authorization-code with 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 refreshed tokens go to a +# callback you supply. +module FlatApi + AUTHORIZE_URL = 'https://flat.io/auth/oauth' + TOKEN_URL = 'https://api.flat.io/oauth/access_token' + # Refresh slightly before nominal expiry, to avoid racing the server clock. + EXPIRY_SKEW = 30 + + Tokens = Struct.new(:access_token, :refresh_token, :expires_at, keyword_init: true) do + def self.from_response(payload) + expires_in = payload['expires_in'] + new( + access_token: payload['access_token'], + refresh_token: payload['refresh_token'], + expires_at: expires_in ? Time.now.to_i + expires_in.to_i : nil + ) + end + + def expired? + !expires_at.nil? && Time.now.to_i >= expires_at - EXPIRY_SKEW + end + end + + # Builds the authorization URL and exchanges codes for tokens. + class OAuth2Helper + def initialize(client_id:, client_secret:, redirect_uri:) + @client_id = client_id + @client_secret = client_secret + @redirect_uri = redirect_uri + end + + # URL to send a user to. +offline+ is what yields a refresh token. + def authorize_url(scopes:, state:, offline: true) + params = { + client_id: @client_id, redirect_uri: @redirect_uri, response_type: 'code', + scope: Array(scopes).join(' '), state: state + } + params[:access_type] = 'offline' if offline + "#{AUTHORIZE_URL}?#{URI.encode_www_form(params)}" + end + + def exchange_code(code) + token_request(grant_type: 'authorization_code', code: code, redirect_uri: @redirect_uri) + end + + def refresh(refresh_token) + token_request(grant_type: 'refresh_token', refresh_token: refresh_token) + end + + private + + def token_request(**payload) + response = Net::HTTP.post_form( + URI(TOKEN_URL), payload.merge(client_id: @client_id, client_secret: @client_secret) + ) + unless response.is_a?(Net::HTTPSuccess) + raise FlatAuthenticationError.new( + 'OAuth2 token request failed; the user must re-authorize', status: response.code.to_i + ) + end + + Tokens.from_response(JSON.parse(response.body)) + end + end + + # 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. + class TokenManager + def initialize(tokens, helper: nil, on_token_refresh: nil) + @tokens = tokens + @helper = helper + @on_token_refresh = on_token_refresh + @mutex = Mutex.new + end + + # Refreshes when the token has expired, which is the whole point of a TokenManager: a caller + # installs this as Configuration#access_token_getter and never thinks about expiry again. + # Returning @tokens.access_token unconditionally made Tokens#expired? dead code, and every + # request after the expiry failed with a 401 that a refresh would have avoided. + def access_token + return @tokens.access_token unless @tokens.expired? + + @mutex.synchronize do + # Checked again inside the lock: a thread that waited here may find the token already + # refreshed, and refreshing twice would spend a second round trip and, with a provider + # that rotates refresh tokens, invalidate the one the first thread just stored. + next @tokens.access_token unless @tokens.expired? + + refresh_locked + end + end + + # Refreshes unconditionally. Use it to force a refresh; access_token already handles expiry. + def refresh + @mutex.synchronize { refresh_locked } + end + + private + + def refresh_locked + if @helper.nil? || @tokens.refresh_token.nil? + raise FlatAuthenticationError, + 'the access token expired and no refresh token is available; re-authorize' + end + + @tokens = @helper.refresh(@tokens.refresh_token) + @on_token_refresh&.call(@tokens) + @tokens.access_token + end + end +end diff --git a/lib/flat_api/pagination.rb b/lib/flat_api/pagination.rb new file mode 100644 index 0000000..b5b16f8 --- /dev/null +++ b/lib/flat_api/pagination.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Cursor pagination for the Flat API. +# +# Eight operations at v2.25.0 are cursor-paginated, identified by a +next+ query parameter. That +# 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 is not in the response body. It arrives in the Link header, which the specification +# does not declare, so it is parsed at runtime. +require 'uri' + +module FlatApi + module Pagination + LINK = /<([^>]+)>\s*;\s*rel="([^"]+)"/.freeze + + module_function + + # Parse an RFC 5988 Link header into { rel => url }. + def parse_link_header(value) + return {} if value.nil? || value.empty? + + value.scan(LINK).to_h { |url, rel| [rel, url] } + end + + # Extract the opaque +next+ cursor from a response's Link header, if any. + # + # Decoded, not captured raw. The cursor arrives percent-encoded inside the Link header's + # URL, and the client encodes whatever it is given when building the next request, so + # passing the encoded form through sends it encoded twice and the server rejects the very + # cursor it issued. URI.decode_www_form applies the rules the server used to write it, so + # an opaque value round-trips exactly. + def next_cursor(headers) + return nil if headers.nil? + + _, link = headers.find { |k, _| k.to_s.downcase == 'link' } + url = parse_link_header(link)['next'] + return nil if url.nil? + + query = begin + URI.parse(url).query + rescue URI::InvalidURIError + nil + end + return nil if query.nil? || query.empty? + + URI.decode_www_form(query).assoc('next')&.last + end + + # Every item across all pages of a cursor-paginated operation, as a lazy Enumerator. + # + # +fetch_page+ is called with a params hash and must return [data, status, headers], which is + # exactly what the generated *_with_http_info methods return. The cursor lives in the headers. + # + # 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. + # + # FlatApi::Pagination.paginate(user: 'me') do |params| + # api.get_user_scores_with_http_info('me', params) + # end.each { |score| puts score.title } + def paginate(**params, &fetch_page) + raise ArgumentError, 'paginate requires a block that fetches one page' unless fetch_page + + Enumerator.new do |yielder| + # +_next+, not +next+. `next` is a Ruby keyword, so the generator names the option + # +:_next+ and maps it back to the +next+ query parameter itself. Passing +:next+ here + # sends nothing: every iteration refetches page one, the loop guard below sees a cursor it + # has already used, and the traversal stops after the first page while looking successful. + cursor = params.delete(:_next) || params.delete(:next) + seen = {} + + loop do + page_params = cursor ? params.merge(_next: cursor) : params + data, _status, headers = fetch_page.call(page_params) + Array(data).each { |item| yielder << item } + + cursor = next_cursor(headers) + break if cursor.nil? + # A server that returns a cursor it already gave us would loop forever. + break if seen[cursor] + + seen[cursor] = true + end + end + end + end +end diff --git a/lib/flat_api/retry.rb b/lib/flat_api/retry.rb new file mode 100644 index 0000000..f0e4c3a --- /dev/null +++ b/lib/flat_api/retry.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +require 'flat_api/errors' + +# 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 is X-RateLimit-Reset, UTC epoch seconds +# * a plain 403 is a genuine authorization failure and must never be retried +module FlatApi + # Methods safe to replay. A non-idempotent request that may already have been applied is not. + IDEMPOTENT_METHODS = %w[GET HEAD OPTIONS PUT DELETE].freeze + MAX_RATE_LIMIT_WAIT = 300.0 + + class RetryPolicy + attr_reader :attempts, :backoff_base, :backoff_max, :jitter, :respect_rate_limit_reset + + def initialize(attempts: 3, backoff_base: 0.5, backoff_max: 30.0, jitter: 0.25, + respect_rate_limit_reset: true) + @attempts = attempts + @backoff_base = backoff_base + @backoff_max = backoff_max + @jitter = jitter + @respect_rate_limit_reset = respect_rate_limit_reset + end + + # No retries. Errors still arrive typed, and a rate-limit error still carries its reset. + def self.disabled + new(attempts: 1) + end + + def enabled? + attempts > 1 + end + + def should_retry?(error, method, attempt) + return false if attempt >= attempts + return false unless IDEMPOTENT_METHODS.include?(method.to_s.upcase) + return true if error.is_a?(FlatRateLimitError) + return true if error.is_a?(FlatServerError) + + # A transport failure before the request was sent is safe to replay. + error.is_a?(IOError) || error.is_a?(SystemCallError) + end + + def delay_for(error, attempt) + if respect_rate_limit_reset && error.is_a?(FlatRateLimitError) && error.reset + wait = error.reset - Time.now.to_i + return [wait + rand * jitter, MAX_RATE_LIMIT_WAIT].min if wait.positive? + end + exponential = [backoff_base * (2**(attempt - 1)), backoff_max].min + exponential + (rand * jitter * exponential) + end + end +end diff --git a/lib/flat_api/version.rb b/lib/flat_api/version.rb index bf1ad04..9c1348d 100644 --- a/lib/flat_api/version.rb +++ b/lib/flat_api/version.rb @@ -1,15 +1,15 @@ =begin #Flat API -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/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.1 Contact: developers@flat.io Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 +Generator version: 7.24.0 =end module FlatApi - VERSION = '0.3.5' + VERSION = '1.0.0' end diff --git a/spec/api/account_api_spec.rb b/spec/api/account_api_spec.rb deleted file mode 100644 index 747724f..0000000 --- a/spec/api/account_api_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for FlatApi::AccountApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AccountApi' do - before do - # run before each test - @api_instance = FlatApi::AccountApi.new - end - - after do - # run after each test - end - - describe 'test an instance of AccountApi' do - it 'should create an instance of AccountApi' do - expect(@api_instance).to be_instance_of(FlatApi::AccountApi) - end - end - - # unit tests for get_authenticated_user - # Get current user account - # Get details about the current authenticated User. - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :only_id Only return the user id - # @return [UserDetails] - describe 'get_authenticated_user test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/api/class_api_spec.rb b/spec/api/class_api_spec.rb deleted file mode 100644 index 83aefef..0000000 --- a/spec/api/class_api_spec.rb +++ /dev/null @@ -1,422 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for FlatApi::ClassApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ClassApi' do - before do - # run before each test - @api_instance = FlatApi::ClassApi.new - end - - after do - # run after each test - end - - describe 'test an instance of ClassApi' do - it 'should create an instance of ClassApi' do - expect(@api_instance).to be_instance_of(FlatApi::ClassApi) - end - end - - # unit tests for activate_class - # 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 _class Unique identifier of the class - # @param [Hash] opts the optional parameters - # @return [ClassDetails] - describe 'activate_class test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for add_class_user - # 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 _class Unique identifier of the class - # @param user Unique identifier of the user - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'add_class_user test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for archive_assignment - # Archive the assignment - # Archive the assignment - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param [Hash] opts the optional parameters - # @return [Assignment] - describe 'archive_assignment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for archive_class - # 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 _class Unique identifier of the class - # @param [Hash] opts the optional parameters - # @return [ClassDetails] - describe 'archive_class test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for copy_assignment - # 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 _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param body - # @param [Hash] opts the optional parameters - # @return [AssignmentCopyResponse] - describe 'copy_assignment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_class - # 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 - # @param [Hash] opts the optional parameters - # @return [ClassDetails] - describe 'create_class test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_class_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 _class Unique identifier of the class - # @param body - # @param [Hash] opts the optional parameters - # @return [Assignment] - describe 'create_class_assignment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_submission - # 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 _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param body - # @param [Hash] opts the optional parameters - # @return [AssignmentSubmission] - describe 'create_submission test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_test_student_account - # 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 _class Unique identifier of the class - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :reset If true, the testing account will be re-created. - # @return [UserDetails] - describe 'create_test_student_account test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for delete_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. - # @param _class Unique identifier of the class - # @param user Unique identifier of the user - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_class_user test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for delete_submission - # Reset a submission - # Use this method as a teacher to reset a submission and allow student to start over the assignment - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param submission Unique identifier of the submission - # @param [Hash] opts the optional parameters - # @return [AssignmentSubmission] - describe 'delete_submission test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for delete_submission_comment - # Delete a feedback comment to a submission - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param submission Unique identifier of the submission - # @param comment Unique identifier of the comment - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_submission_comment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for edit_submission - # 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 _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param submission Unique identifier of the submission - # @param body - # @param [Hash] opts the optional parameters - # @return [AssignmentSubmission] - describe 'edit_submission test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for enroll_class - # 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` - # @param [Hash] opts the optional parameters - # @return [ClassDetails] - describe 'enroll_class test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for export_submissions_reviews_as_csv - # CSV Grades exports - # Export list of submissions grades to a CSV file - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param [Hash] opts the optional parameters - # @return [File] - describe 'export_submissions_reviews_as_csv test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for export_submissions_reviews_as_excel - # Excel Grades exports - # Export list of submissions grades to an Excel file - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param [Hash] opts the optional parameters - # @return [File] - describe 'export_submissions_reviews_as_excel test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_class - # Get the details of a single class - # @param _class Unique identifier of the class - # @param [Hash] opts the optional parameters - # @return [ClassDetails] - describe 'get_class test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score_submissions - # 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`). - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'get_score_submissions test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_submission - # Get a student submission - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param submission Unique identifier of the submission - # @param [Hash] opts the optional parameters - # @return [AssignmentSubmission] - describe 'get_submission test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_submission_comments - # List the feedback comments of a submission - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param submission Unique identifier of the submission - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'get_submission_comments test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_submission_history - # Get the history of the submission - # For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param submission Unique identifier of the submission - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'get_submission_history test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_submissions - # List the students' submissions - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'get_submissions test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_assignments - # Assignments listing - # @param _class Unique identifier of the class - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'list_assignments test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_class_student_submissions - # 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 _class Unique identifier of the class - # @param user Unique identifier of the user - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'list_class_student_submissions test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_classes - # List the classes available for the current user - # @param [Hash] opts the optional parameters - # @option opts [String] :state Filter the classes by state - # @return [Array] - describe 'list_classes test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for post_submission_comment - # Add a feedback comment to a submission - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param submission Unique identifier of the submission - # @param assignment_submission_comment_creation - # @param [Hash] opts the optional parameters - # @return [AssignmentSubmissionComment] - describe 'post_submission_comment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for unarchive_assignment - # Unarchive the assignment. - # Mark the assignment as `active`. - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param [Hash] opts the optional parameters - # @return [Assignment] - describe 'unarchive_assignment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for unarchive_class - # 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 _class Unique identifier of the class - # @param [Hash] opts the optional parameters - # @return [ClassDetails] - describe 'unarchive_class test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for update_class - # Update the class - # Update the meta information of the class - # @param _class Unique identifier of the class - # @param body Details of the Class - # @param [Hash] opts the optional parameters - # @return [ClassDetails] - describe 'update_class test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for update_submission_comment - # Update a feedback comment to a submission - # @param _class Unique identifier of the class - # @param assignment Unique identifier of the assignment - # @param submission Unique identifier of the submission - # @param comment Unique identifier of the comment - # @param assignment_submission_comment_creation - # @param [Hash] opts the optional parameters - # @return [AssignmentSubmissionComment] - describe 'update_submission_comment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/api/collection_api_spec.rb b/spec/api/collection_api_spec.rb deleted file mode 100644 index d217e89..0000000 --- a/spec/api/collection_api_spec.rb +++ /dev/null @@ -1,158 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for FlatApi::CollectionApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'CollectionApi' do - before do - # run before each test - @api_instance = FlatApi::CollectionApi.new - end - - after do - # run after each test - end - - describe 'test an instance of CollectionApi' do - it 'should create an instance of CollectionApi' do - expect(@api_instance).to be_instance_of(FlatApi::CollectionApi) - end - end - - # unit tests for add_score_to_collection - # 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 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 - # @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`). - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [ScoreDetails] - describe 'add_score_to_collection test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_collection - # Create a new collection - # This method will create a new collection and add it to your `root` collection. - # @param body - # @param [Hash] opts the optional parameters - # @return [Collection] - describe 'create_collection test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for delete_collection - # 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 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 - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_collection test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for delete_score_from_collection - # 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 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 - # @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`). - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [nil] - describe 'delete_score_from_collection test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for 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 - # @param body - # @param [Hash] opts the optional parameters - # @return [Collection] - describe 'edit_collection test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for 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 - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [Collection] - describe 'get_collection test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_collection_scores - # 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 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 - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @option opts [String] :sort Sort - # @option opts [String] :direction Sort direction - # @option opts [Integer] :limit This is the maximum number of objects that may be returned - # @option opts [String] :_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. - # @option opts [String] :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. - # @return [Array] - describe 'list_collection_scores test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_collections - # 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`. - # @param [Hash] opts the optional parameters - # @option opts [String] :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`. - # @option opts [String] :sort Sort - # @option opts [String] :direction Sort direction - # @option opts [Integer] :limit This is the maximum number of objects that may be returned - # @option opts [String] :_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. - # @option opts [String] :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. - # @return [Array] - describe 'list_collections test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for untrash_collection - # Untrash a collection - # 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 - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'untrash_collection test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/api/edu_resources_api_spec.rb b/spec/api/edu_resources_api_spec.rb deleted file mode 100644 index af9ec87..0000000 --- a/spec/api/edu_resources_api_spec.rb +++ /dev/null @@ -1,181 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for FlatApi::EduResourcesApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'EduResourcesApi' do - before do - # run before each test - @api_instance = FlatApi::EduResourcesApi.new - end - - after do - # run after each test - end - - describe 'test an instance of EduResourcesApi' do - it 'should create an instance of EduResourcesApi' do - expect(@api_instance).to be_instance_of(FlatApi::EduResourcesApi) - end - end - - # unit tests for copy_edu_resource - # Copy an education resource to a Resource Library - # @param resource Unique identifier of the resource - # @param edu_resource_copy - # @param [Hash] opts the optional parameters - # @return [EduResource] - describe 'copy_edu_resource test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for copy_edu_resource_to_demo_class - # 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 - # @param [Hash] opts the optional parameters - # @return [ClassAssignment] - describe 'copy_edu_resource_to_demo_class test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_edu_resource - # Create a new education resource - # @param edu_resource_creation - # @param [Hash] opts the optional parameters - # @return [EduResource] - describe 'create_edu_resource test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_edu_resource_lti_link - # 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 - # @param [Hash] opts the optional parameters - # @return [EduResourceLtiLink] - describe 'create_edu_resource_lti_link test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for delete_edu_resource - # Delete an education resource - # @param resource Unique identifier of the resource - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_edu_resource test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_edu_resource - # Get an education resource - # @param resource Unique identifier of the resource - # @param [Hash] opts the optional parameters - # @return [EduResource] - describe 'get_edu_resource test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_edu_libraries - # List the education libraries - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'list_edu_libraries test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_edu_resources - # List education resources in a library or folder - # @param [Hash] opts the optional parameters - # @option opts [String] :parent List the resources contained in this `parent` library or folder - # @option opts [String] :type Filter the returned resources by type - # @option opts [String] :sort Sort - # @option opts [String] :direction Sort direction - # @option opts [Integer] :limit This is the maximum number of resources that may be returned - # @option opts [String] :_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. - # @option opts [String] :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. - # @return [Array] - describe 'list_edu_resources test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for move_edu_resource - # Move an education resource - # @param resource Unique identifier of the resource - # @param edu_resource_move - # @param [Hash] opts the optional parameters - # @return [EduResource] - describe 'move_edu_resource test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for update_edu_resource - # 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 - # @param edu_resource_update - # @param [Hash] opts the optional parameters - # @return [EduResource] - describe 'update_edu_resource test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for update_edu_resource_assignment - # Update an education resource assignment - # @param resource Unique identifier of the resource - # @param assignment_update - # @param [Hash] opts the optional parameters - # @return [Assignment] - describe 'update_edu_resource_assignment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for use_edu_resource_in_class - # 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 - # @param edu_resource_use_in_class - # @param [Hash] opts the optional parameters - # @return [ClassAssignment] - describe 'use_edu_resource_in_class test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/api/group_api_spec.rb b/spec/api/group_api_spec.rb deleted file mode 100644 index a50b7fb..0000000 --- a/spec/api/group_api_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for FlatApi::GroupApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'GroupApi' do - before do - # run before each test - @api_instance = FlatApi::GroupApi.new - end - - after do - # run after each test - end - - describe 'test an instance of GroupApi' do - it 'should create an instance of GroupApi' do - expect(@api_instance).to be_instance_of(FlatApi::GroupApi) - end - end - - # unit tests for get_group_details - # Get group information - # @param group Unique identifier of a Flat group - # @param [Hash] opts the optional parameters - # @return [GroupDetails] - describe 'get_group_details test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_group_scores - # List group's scores - # Get the list of scores shared with a group. - # @param group Unique identifier of a Flat group - # @param [Hash] opts the optional parameters - # @option opts [String] :parent Filter the score forked from the score id `parent` - # @return [Array] - describe 'get_group_scores test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_group_users - # List group's users - # @param group Unique identifier of a Flat group - # @param [Hash] opts the optional parameters - # @option opts [String] :source Filter the users by their source - # @return [Array] - describe 'list_group_users test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/api/organization_api_spec.rb b/spec/api/organization_api_spec.rb deleted file mode 100644 index 250b418..0000000 --- a/spec/api/organization_api_spec.rb +++ /dev/null @@ -1,201 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for FlatApi::OrganizationApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'OrganizationApi' do - before do - # run before each test - @api_instance = FlatApi::OrganizationApi.new - end - - after do - # run after each test - end - - describe 'test an instance of OrganizationApi' do - it 'should create an instance of OrganizationApi' do - expect(@api_instance).to be_instance_of(FlatApi::OrganizationApi) - end - end - - # unit tests for count_orga_users - # Count the organization users using the provided filters - # @param [Hash] opts the optional parameters - # @option opts [Array] :role Filter users by role - # @option opts [String] :q The query to search - # @option opts [Array] :group Filter users by group - # @option opts [Boolean] :no_active_license Filter users who don't have an active license - # @return [Array] - describe 'count_orga_users test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_lti_credentials - # 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/). - # @param body - # @param [Hash] opts the optional parameters - # @return [LtiCredentials] - describe 'create_lti_credentials test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_organization_invitation - # 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 - # @param [Hash] opts the optional parameters - # @return [OrganizationInvitation] - describe 'create_organization_invitation test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_organization_user - # Create a new user account - # @param body - # @param [Hash] opts the optional parameters - # @return [UserDetailsAdmin] - describe 'create_organization_user test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_organization_user_access_token - # 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 - # @param organization_user_access_token_creation - # @param [Hash] opts the optional parameters - # @return [ApiAccessToken] - describe 'create_organization_user_access_token test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_organization_user_signin_link - # Create a sign in link for an organization user - # @param user Unique identifier of the Flat account - # @param user_signin_link_creation - # @param [Hash] opts the optional parameters - # @return [UserSigninLink] - describe 'create_organization_user_signin_link test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_lti_credentials - # List LTI 1.x credentials - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'list_lti_credentials test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_organization_invitations - # List the organization invitations - # @param [Hash] opts the optional parameters - # @option opts [String] :role Filter users by role - # @option opts [Integer] :limit This is the maximum number of objects that may be returned - # @option opts [String] :_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. - # @option opts [String] :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. - # @return [Array] - describe 'list_organization_invitations test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_organization_users - # List the organization users - # @param [Hash] opts the optional parameters - # @option opts [Array] :sort The order to sort the user list - # @option opts [String] :direction Sort direction - # @option opts [String] :_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. - # @option opts [String] :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. - # @option opts [Array] :role Filter users by role - # @option opts [String] :q The query to search - # @option opts [Array] :group Filter users by group - # @option opts [Boolean] :no_active_license Filter users who don't have an active license - # @option opts [Array] :license_expiration_date Filter users by license expiration date or `active` / `notActive` - # @option opts [Boolean] :only_ids Return only user ids - # @option opts [Integer] :limit This is the maximum number of objects that may be returned - # @return [Array] - describe 'list_organization_users test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for remove_organization_invitation - # Remove an organization invitation - # @param invitation Unique identifier of the invitation - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'remove_organization_invitation test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for remove_organization_user - # 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 - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :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. - # @return [nil] - describe 'remove_organization_user test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for revoke_lti_credentials - # Revoke LTI 1.x credentials - # @param credentials Credentials unique identifier - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'revoke_lti_credentials test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for update_organization_user - # Update account information - # @param user Unique identifier of the Flat account - # @param body - # @param [Hash] opts the optional parameters - # @return [UserDetailsAdmin] - describe 'update_organization_user test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/api/score_api_spec.rb b/spec/api/score_api_spec.rb deleted file mode 100644 index 550a0c9..0000000 --- a/spec/api/score_api_spec.rb +++ /dev/null @@ -1,440 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for FlatApi::ScoreApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'ScoreApi' do - before do - # run before each test - @api_instance = FlatApi::ScoreApi.new - end - - after do - # run after each test - end - - describe 'test an instance of ScoreApi' do - it 'should create an instance of ScoreApi' do - expect(@api_instance).to be_instance_of(FlatApi::ScoreApi) - end - end - - # unit tests for add_score_collaborator - # 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`). - # @param body - # @param [Hash] opts the optional parameters - # @return [ResourceCollaborator] - describe 'add_score_collaborator test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for add_score_track - # 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`). - # @param body - # @param [Hash] opts the optional parameters - # @return [ScoreTrack] - describe 'add_score_track test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_export_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`). - # @param revision Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. - # @param format The format of the file that will be generated or the target service name where the file will be exported - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @option opts [TaskExportOptions] :body - # @return [Task] - describe 'create_export_task test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_score - # 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}`. - # @param body - # @param [Hash] opts the optional parameters - # @return [ScoreDetails] - describe 'create_score test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for create_score_revision - # 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`). - # @param body - # @param [Hash] opts the optional parameters - # @return [ScoreRevision] - describe 'create_score_revision test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for delete_score - # 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). - # @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`). - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :now If `true`, the score deletion will be scheduled to be done ASAP - # @return [nil] - describe 'delete_score test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for delete_score_comment - # 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`). - # @param comment Unique identifier of a sheet music comment - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [nil] - describe 'delete_score_comment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for delete_score_track - # 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`). - # @param track Unique identifier of a score audio track - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'delete_score_track test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for edit_score - # 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`). - # @param body - # @param [Hash] opts the optional parameters - # @return [ScoreDetails] - describe 'edit_score test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for fork_score - # 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`). - # @param body - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [ScoreDetails] - describe 'fork_score test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_group_scores - # List group's scores - # Get the list of scores shared with a group. - # @param group Unique identifier of a Flat group - # @param [Hash] opts the optional parameters - # @option opts [String] :parent Filter the score forked from the score id `parent` - # @return [Array] - describe 'get_group_scores test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score - # 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`). - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [ScoreDetails] - describe 'get_score test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score_collaborator - # 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`). - # @param collaborator Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [ResourceCollaborator] - describe 'get_score_collaborator test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score_collaborators - # 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`). - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [Array] - describe 'get_score_collaborators test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score_comments - # 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`). - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @option opts [String] :type Filter the comments by type - # @option opts [String] :sort Sort - # @option opts [String] :direction Sort direction - # @return [Array] - describe 'get_score_comments test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score_revision - # 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`). - # @param revision Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [ScoreRevision] - describe 'get_score_revision test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score_revision_data - # 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`. - # @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`). - # @param revision Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. - # @param format The format of the file you will retrieve - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @option opts [String] :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\". - # @option opts [Boolean] :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. - # @option opts [Boolean] :url Returns a json with the `url` in it instead of redirecting - # @return [File] - describe 'get_score_revision_data test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score_revisions - # 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`). - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [Array] - describe 'get_score_revisions test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score_submissions - # 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`). - # @param [Hash] opts the optional parameters - # @return [Array] - describe 'get_score_submissions test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_score_track - # 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`). - # @param track Unique identifier of a score audio track - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [ScoreTrack] - describe 'get_score_track test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_user_likes - # List liked scores - # @param user Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. - # @param [Hash] opts the optional parameters - # @option opts [String] :_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. - # @option opts [String] :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. - # @option opts [Integer] :limit This is the maximum number of objects that may be returned - # @option opts [Boolean] :ids Return only the identifiers of the scores - # @return [Array] - describe 'get_user_likes test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_user_scores - # 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. - # @param user Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. - # @param [Hash] opts the optional parameters - # @option opts [String] :parent Filter the score forked from the score id `parent` - # @return [Array] - describe 'get_user_scores test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for list_score_tracks - # List the audio or video tracks 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`). - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @option opts [String] :assignment An assignment id with which all the tracks returned will be related to - # @option opts [Boolean] :list_auto_track If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track - # @return [Array] - describe 'list_score_tracks test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for mark_score_comment_resolved - # 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`). - # @param comment Unique identifier of a sheet music comment - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [nil] - describe 'mark_score_comment_resolved test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for mark_score_comment_unresolved - # 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`). - # @param comment Unique identifier of a sheet music comment - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [nil] - describe 'mark_score_comment_unresolved test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for post_score_comment - # 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`). - # @param body - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [ScoreComment] - describe 'post_score_comment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for remove_score_collaborator - # 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`). - # @param collaborator Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'remove_score_collaborator test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for untrash_score - # 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`). - # @param [Hash] opts the optional parameters - # @return [nil] - describe 'untrash_score test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for update_score_comment - # 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`). - # @param comment Unique identifier of a sheet music comment - # @param body - # @param [Hash] opts the optional parameters - # @option opts [String] :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. - # @return [ScoreComment] - describe 'update_score_comment test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for update_score_track - # 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`). - # @param track Unique identifier of a score audio track - # @param body - # @param [Hash] opts the optional parameters - # @return [ScoreTrack] - describe 'update_score_track test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/api/task_api_spec.rb b/spec/api/task_api_spec.rb deleted file mode 100644 index 865ec48..0000000 --- a/spec/api/task_api_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for FlatApi::TaskApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'TaskApi' do - before do - # run before each test - @api_instance = FlatApi::TaskApi.new - end - - after do - # run after each test - end - - describe 'test an instance of TaskApi' do - it 'should create an instance of TaskApi' do - expect(@api_instance).to be_instance_of(FlatApi::TaskApi) - end - end - - # unit tests for get_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 - # @param [Hash] opts the optional parameters - # @return [Task] - describe 'get_task test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/api/user_api_spec.rb b/spec/api/user_api_spec.rb deleted file mode 100644 index dc733d1..0000000 --- a/spec/api/user_api_spec.rb +++ /dev/null @@ -1,75 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' - -# Unit tests for FlatApi::UserApi -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'UserApi' do - before do - # run before each test - @api_instance = FlatApi::UserApi.new - end - - after do - # run after each test - end - - describe 'test an instance of UserApi' do - it 'should create an instance of UserApi' do - expect(@api_instance).to be_instance_of(FlatApi::UserApi) - end - end - - # unit tests for get_user - # 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. - # @param [Hash] opts the optional parameters - # @return [UserPublic] - describe 'get_user test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_user_likes - # List liked scores - # @param user Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. - # @param [Hash] opts the optional parameters - # @option opts [String] :_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. - # @option opts [String] :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. - # @option opts [Integer] :limit This is the maximum number of objects that may be returned - # @option opts [Boolean] :ids Return only the identifiers of the scores - # @return [Array] - describe 'get_user_likes test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - # unit tests for get_user_scores - # 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. - # @param user Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. - # @param [Hash] opts the optional parameters - # @option opts [String] :parent Filter the score forked from the score id `parent` - # @return [Array] - describe 'get_user_scores test' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/api_access_token_spec.rb b/spec/models/api_access_token_spec.rb deleted file mode 100644 index e4bd73a..0000000 --- a/spec/models/api_access_token_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ApiAccessToken -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ApiAccessToken do - let(:instance) { FlatApi::ApiAccessToken.new } - - describe 'test an instance of ApiAccessToken' do - it 'should create an instance of ApiAccessToken' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ApiAccessToken) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "token"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "issued_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "expiration_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "scopes"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/app_scopes_spec.rb b/spec/models/app_scopes_spec.rb deleted file mode 100644 index f97dbf3..0000000 --- a/spec/models/app_scopes_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AppScopes -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AppScopes do - let(:instance) { FlatApi::AppScopes.new } - - describe 'test an instance of AppScopes' do - it 'should create an instance of AppScopes' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AppScopes) - end - end - -end diff --git a/spec/models/assignment_capabilities_can_publish_in_class_error_spec.rb b/spec/models/assignment_capabilities_can_publish_in_class_error_spec.rb deleted file mode 100644 index f7b22e7..0000000 --- a/spec/models/assignment_capabilities_can_publish_in_class_error_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentCapabilitiesCanPublishInClassError -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentCapabilitiesCanPublishInClassError do - let(:instance) { FlatApi::AssignmentCapabilitiesCanPublishInClassError.new } - - describe 'test an instance of AssignmentCapabilitiesCanPublishInClassError' do - it 'should create an instance of AssignmentCapabilitiesCanPublishInClassError' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentCapabilitiesCanPublishInClassError) - end - end - - describe 'test attribute "code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_capabilities_spec.rb b/spec/models/assignment_capabilities_spec.rb deleted file mode 100644 index 415d543..0000000 --- a/spec/models/assignment_capabilities_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentCapabilities -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentCapabilities do - let(:instance) { FlatApi::AssignmentCapabilities.new } - - describe 'test an instance of AssignmentCapabilities' do - it 'should create an instance of AssignmentCapabilities' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentCapabilities) - end - end - - describe 'test attribute "can_edit"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_publish_in_class"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_publish_in_class_error"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_archive"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_unarchive"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_copy_response_spec.rb b/spec/models/assignment_copy_response_spec.rb deleted file mode 100644 index 5fbe249..0000000 --- a/spec/models/assignment_copy_response_spec.rb +++ /dev/null @@ -1,124 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentCopyResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentCopyResponse do - let(:instance) { FlatApi::AssignmentCopyResponse.new } - - describe 'test an instance of AssignmentCopyResponse' do - it 'should create an instance of AssignmentCopyResponse' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentCopyResponse) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "capabilities"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover_file"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "use_dedicated_attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "max_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "release_grades"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["auto", "manual"]) - # validator.allowable_values.each do |value| - # expect { instance.release_grades = value }.not_to raise_error - # end - end - end - - describe 'test attribute "shuffle_exercises"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "toolset"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "nb_playback_authorized"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "resource"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_copy_spec.rb b/spec/models/assignment_copy_spec.rb deleted file mode 100644 index 4168b25..0000000 --- a/spec/models/assignment_copy_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentCopy -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentCopy do - describe '.openapi_one_of' do - it 'lists the items referenced in the oneOf array' do - expect(described_class.openapi_one_of).to_not be_empty - end - end - - describe '.build' do - it 'returns the correct model' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end -end diff --git a/spec/models/assignment_copy_to_class_spec.rb b/spec/models/assignment_copy_to_class_spec.rb deleted file mode 100644 index d98aa8d..0000000 --- a/spec/models/assignment_copy_to_class_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentCopyToClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentCopyToClass do - let(:instance) { FlatApi::AssignmentCopyToClass.new } - - describe 'test an instance of AssignmentCopyToClass' do - it 'should create an instance of AssignmentCopyToClass' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentCopyToClass) - end - end - - describe 'test attribute "classroom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "assignment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "scheduled_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_copy_to_resource_library_spec.rb b/spec/models/assignment_copy_to_resource_library_spec.rb deleted file mode 100644 index 6e80eae..0000000 --- a/spec/models/assignment_copy_to_resource_library_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentCopyToResourceLibrary -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentCopyToResourceLibrary do - let(:instance) { FlatApi::AssignmentCopyToResourceLibrary.new } - - describe 'test an instance of AssignmentCopyToResourceLibrary' do - it 'should create an instance of AssignmentCopyToResourceLibrary' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentCopyToResourceLibrary) - end - end - - describe 'test attribute "library_parent"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "verify_if_not_already_in_resource_library"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_spec.rb b/spec/models/assignment_spec.rb deleted file mode 100644 index 9b97e11..0000000 --- a/spec/models/assignment_spec.rb +++ /dev/null @@ -1,118 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::Assignment -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::Assignment do - let(:instance) { FlatApi::Assignment.new } - - describe 'test an instance of Assignment' do - it 'should create an instance of Assignment' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::Assignment) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "capabilities"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover_file"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "use_dedicated_attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "max_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "release_grades"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["auto", "manual"]) - # validator.allowable_values.each do |value| - # expect { instance.release_grades = value }.not_to raise_error - # end - end - end - - describe 'test attribute "shuffle_exercises"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "toolset"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "nb_playback_authorized"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_submission_comment_creation_spec.rb b/spec/models/assignment_submission_comment_creation_spec.rb deleted file mode 100644 index 8c8c9d5..0000000 --- a/spec/models/assignment_submission_comment_creation_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionCommentCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionCommentCreation do - let(:instance) { FlatApi::AssignmentSubmissionCommentCreation.new } - - describe 'test an instance of AssignmentSubmissionCommentCreation' do - it 'should create an instance of AssignmentSubmissionCommentCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionCommentCreation) - end - end - - describe 'test attribute "comment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_submission_comment_spec.rb b/spec/models/assignment_submission_comment_spec.rb deleted file mode 100644 index 51bf7c2..0000000 --- a/spec/models/assignment_submission_comment_spec.rb +++ /dev/null @@ -1,72 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionComment -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionComment do - let(:instance) { FlatApi::AssignmentSubmissionComment.new } - - describe 'test an instance of AssignmentSubmissionComment' do - it 'should create an instance of AssignmentSubmissionComment' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionComment) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "user"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "submission"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "modification_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "comment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "unread"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_submission_comments_spec.rb b/spec/models/assignment_submission_comments_spec.rb deleted file mode 100644 index 46ab825..0000000 --- a/spec/models/assignment_submission_comments_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionComments -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionComments do - let(:instance) { FlatApi::AssignmentSubmissionComments.new } - - describe 'test an instance of AssignmentSubmissionComments' do - it 'should create an instance of AssignmentSubmissionComments' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionComments) - end - end - - describe 'test attribute "total"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "unread"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_submission_history_attachment_spec.rb b/spec/models/assignment_submission_history_attachment_spec.rb deleted file mode 100644 index 21f2db6..0000000 --- a/spec/models/assignment_submission_history_attachment_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionHistoryAttachment -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionHistoryAttachment do - let(:instance) { FlatApi::AssignmentSubmissionHistoryAttachment.new } - - describe 'test an instance of AssignmentSubmissionHistoryAttachment' do - it 'should create an instance of AssignmentSubmissionHistoryAttachment' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionHistoryAttachment) - end - end - - describe 'test attribute "score"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "revision"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_submission_history_spec.rb b/spec/models/assignment_submission_history_spec.rb deleted file mode 100644 index 0d3b5e6..0000000 --- a/spec/models/assignment_submission_history_spec.rb +++ /dev/null @@ -1,112 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionHistory -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionHistory do - let(:instance) { FlatApi::AssignmentSubmissionHistory.new } - - describe 'test an instance of AssignmentSubmissionHistory' do - it 'should create an instance of AssignmentSubmissionHistory' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionHistory) - end - end - - describe 'test attribute "date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "classroom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "assignment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "submission"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "users"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "source"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["lti", "googleClassroom", "microsoftGraph"]) - # validator.allowable_values.each do |value| - # expect { instance.source = value }.not_to raise_error - # end - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "draft_grade"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "grade"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "max_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "comment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "due_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "attachment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_submission_history_state_spec.rb b/spec/models/assignment_submission_history_state_spec.rb deleted file mode 100644 index 741e137..0000000 --- a/spec/models/assignment_submission_history_state_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionHistoryState -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionHistoryState do - let(:instance) { FlatApi::AssignmentSubmissionHistoryState.new } - - describe 'test an instance of AssignmentSubmissionHistoryState' do - it 'should create an instance of AssignmentSubmissionHistoryState' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionHistoryState) - end - end - -end diff --git a/spec/models/assignment_submission_lti_spec.rb b/spec/models/assignment_submission_lti_spec.rb deleted file mode 100644 index c08e801..0000000 --- a/spec/models/assignment_submission_lti_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionLti -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionLti do - let(:instance) { FlatApi::AssignmentSubmissionLti.new } - - describe 'test an instance of AssignmentSubmissionLti' do - it 'should create an instance of AssignmentSubmissionLti' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionLti) - end - end - - describe 'test attribute "sourcedid"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_submission_playback_inner_spec.rb b/spec/models/assignment_submission_playback_inner_spec.rb deleted file mode 100644 index 256ed9b..0000000 --- a/spec/models/assignment_submission_playback_inner_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionPlaybackInner -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionPlaybackInner do - let(:instance) { FlatApi::AssignmentSubmissionPlaybackInner.new } - - describe 'test an instance of AssignmentSubmissionPlaybackInner' do - it 'should create an instance of AssignmentSubmissionPlaybackInner' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionPlaybackInner) - end - end - - describe 'test attribute "score"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "nb_play_attempt"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_submission_spec.rb b/spec/models/assignment_submission_spec.rb deleted file mode 100644 index 85361a8..0000000 --- a/spec/models/assignment_submission_spec.rb +++ /dev/null @@ -1,144 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmission -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmission do - let(:instance) { FlatApi::AssignmentSubmission.new } - - describe 'test an instance of AssignmentSubmission' do - it 'should create an instance of AssignmentSubmission' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmission) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "classroom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "assignment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creator"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "submission_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "return_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "return_creator"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "grade"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "draft_grade"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "max_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "exercises_ids"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "playback"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "comments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_classroom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "microsoft_graph"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lti"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_submission_state_spec.rb b/spec/models/assignment_submission_state_spec.rb deleted file mode 100644 index 6afe91f..0000000 --- a/spec/models/assignment_submission_state_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionState -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionState do - let(:instance) { FlatApi::AssignmentSubmissionState.new } - - describe 'test an instance of AssignmentSubmissionState' do - it 'should create an instance of AssignmentSubmissionState' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionState) - end - end - -end diff --git a/spec/models/assignment_submission_update_spec.rb b/spec/models/assignment_submission_update_spec.rb deleted file mode 100644 index 67d92c7..0000000 --- a/spec/models/assignment_submission_update_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentSubmissionUpdate -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentSubmissionUpdate do - let(:instance) { FlatApi::AssignmentSubmissionUpdate.new } - - describe 'test an instance of AssignmentSubmissionUpdate' do - it 'should create an instance of AssignmentSubmissionUpdate' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentSubmissionUpdate) - end - end - - describe 'test attribute "attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "submit"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "draft_grade"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "grade"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "exercises_ids"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "_return"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/assignment_type_spec.rb b/spec/models/assignment_type_spec.rb deleted file mode 100644 index 0f580bf..0000000 --- a/spec/models/assignment_type_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentType -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentType do - let(:instance) { FlatApi::AssignmentType.new } - - describe 'test an instance of AssignmentType' do - it 'should create an instance of AssignmentType' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentType) - end - end - -end diff --git a/spec/models/assignment_update_spec.rb b/spec/models/assignment_update_spec.rb deleted file mode 100644 index c14f244..0000000 --- a/spec/models/assignment_update_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::AssignmentUpdate -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::AssignmentUpdate do - let(:instance) { FlatApi::AssignmentUpdate.new } - - describe 'test an instance of AssignmentUpdate' do - it 'should create an instance of AssignmentUpdate' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::AssignmentUpdate) - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "nb_playback_authorized"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "toolset"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover_file"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "max_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "release_grades"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["auto", "manual"]) - # validator.allowable_values.each do |value| - # expect { instance.release_grades = value }.not_to raise_error - # end - end - end - - describe 'test attribute "shuffle_exercises"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_assignment_all_of_canvas_spec.rb b/spec/models/class_assignment_all_of_canvas_spec.rb deleted file mode 100644 index 2923438..0000000 --- a/spec/models/class_assignment_all_of_canvas_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassAssignmentAllOfCanvas -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassAssignmentAllOfCanvas do - let(:instance) { FlatApi::ClassAssignmentAllOfCanvas.new } - - describe 'test an instance of ClassAssignmentAllOfCanvas' do - it 'should create an instance of ClassAssignmentAllOfCanvas' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassAssignmentAllOfCanvas) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "alternate_link"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_assignment_all_of_lti_spec.rb b/spec/models/class_assignment_all_of_lti_spec.rb deleted file mode 100644 index 804aa88..0000000 --- a/spec/models/class_assignment_all_of_lti_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassAssignmentAllOfLti -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassAssignmentAllOfLti do - let(:instance) { FlatApi::ClassAssignmentAllOfLti.new } - - describe 'test an instance of ClassAssignmentAllOfLti' do - it 'should create an instance of ClassAssignmentAllOfLti' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassAssignmentAllOfLti) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_assignment_all_of_mfc_spec.rb b/spec/models/class_assignment_all_of_mfc_spec.rb deleted file mode 100644 index c97279c..0000000 --- a/spec/models/class_assignment_all_of_mfc_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassAssignmentAllOfMfc -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassAssignmentAllOfMfc do - let(:instance) { FlatApi::ClassAssignmentAllOfMfc.new } - - describe 'test an instance of ClassAssignmentAllOfMfc' do - it 'should create an instance of ClassAssignmentAllOfMfc' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassAssignmentAllOfMfc) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "alternate_link"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_assignment_spec.rb b/spec/models/class_assignment_spec.rb deleted file mode 100644 index 8626823..0000000 --- a/spec/models/class_assignment_spec.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassAssignment -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassAssignment do - let(:instance) { FlatApi::ClassAssignment.new } - - describe 'test an instance of ClassAssignment' do - it 'should create an instance of ClassAssignment' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassAssignment) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "capabilities"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover_file"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "use_dedicated_attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "max_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "release_grades"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["auto", "manual"]) - # validator.allowable_values.each do |value| - # expect { instance.release_grades = value }.not_to raise_error - # end - end - end - - describe 'test attribute "shuffle_exercises"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "toolset"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "nb_playback_authorized"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creator"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["draft", "active", "archived"]) - # validator.allowable_values.each do |value| - # expect { instance.state = value }.not_to raise_error - # end - end - end - - describe 'test attribute "classroom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "scheduled_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "due_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "assignee_mode"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["everyone", "selected"]) - # validator.allowable_values.each do |value| - # expect { instance.assignee_mode = value }.not_to raise_error - # end - end - end - - describe 'test attribute "assigned_students"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "submissions"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_classroom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "microsoft_graph"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "mfc"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "canvas"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lti"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "issue"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_assignment_update_all_of_google_classroom_spec.rb b/spec/models/class_assignment_update_all_of_google_classroom_spec.rb deleted file mode 100644 index 2c41161..0000000 --- a/spec/models/class_assignment_update_all_of_google_classroom_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassAssignmentUpdateAllOfGoogleClassroom -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassAssignmentUpdateAllOfGoogleClassroom do - let(:instance) { FlatApi::ClassAssignmentUpdateAllOfGoogleClassroom.new } - - describe 'test an instance of ClassAssignmentUpdateAllOfGoogleClassroom' do - it 'should create an instance of ClassAssignmentUpdateAllOfGoogleClassroom' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassAssignmentUpdateAllOfGoogleClassroom) - end - end - - describe 'test attribute "topic_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_assignment_update_all_of_microsoft_graph_spec.rb b/spec/models/class_assignment_update_all_of_microsoft_graph_spec.rb deleted file mode 100644 index 6dbabb3..0000000 --- a/spec/models/class_assignment_update_all_of_microsoft_graph_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassAssignmentUpdateAllOfMicrosoftGraph -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassAssignmentUpdateAllOfMicrosoftGraph do - let(:instance) { FlatApi::ClassAssignmentUpdateAllOfMicrosoftGraph.new } - - describe 'test an instance of ClassAssignmentUpdateAllOfMicrosoftGraph' do - it 'should create an instance of ClassAssignmentUpdateAllOfMicrosoftGraph' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassAssignmentUpdateAllOfMicrosoftGraph) - end - end - - describe 'test attribute "categories"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_assignment_update_spec.rb b/spec/models/class_assignment_update_spec.rb deleted file mode 100644 index f5b4181..0000000 --- a/spec/models/class_assignment_update_spec.rb +++ /dev/null @@ -1,150 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassAssignmentUpdate -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassAssignmentUpdate do - let(:instance) { FlatApi::ClassAssignmentUpdate.new } - - describe 'test an instance of ClassAssignmentUpdate' do - it 'should create an instance of ClassAssignmentUpdate' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassAssignmentUpdate) - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "attachments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "nb_playback_authorized"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "toolset"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover_file"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "max_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "release_grades"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["auto", "manual"]) - # validator.allowable_values.each do |value| - # expect { instance.release_grades = value }.not_to raise_error - # end - end - end - - describe 'test attribute "shuffle_exercises"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["draft", "active"]) - # validator.allowable_values.each do |value| - # expect { instance.state = value }.not_to raise_error - # end - end - end - - describe 'test attribute "due_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "scheduled_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_classroom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "microsoft_graph"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "assignee_mode"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["everyone", "selected"]) - # validator.allowable_values.each do |value| - # expect { instance.assignee_mode = value }.not_to raise_error - # end - end - end - - describe 'test attribute "assigned_students"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_attachment_creation_spec.rb b/spec/models/class_attachment_creation_spec.rb deleted file mode 100644 index 45ed00e..0000000 --- a/spec/models/class_attachment_creation_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassAttachmentCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassAttachmentCreation do - let(:instance) { FlatApi::ClassAttachmentCreation.new } - - describe 'test an instance of ClassAttachmentCreation' do - it 'should create an instance of ClassAttachmentCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassAttachmentCreation) - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet", "performance"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "score"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "worksheet"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "sharing_mode"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lock_score_template"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_drive_file_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_creation_spec.rb b/spec/models/class_creation_spec.rb deleted file mode 100644 index cafc681..0000000 --- a/spec/models/class_creation_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassCreation do - let(:instance) { FlatApi::ClassCreation.new } - - describe 'test an instance of ClassCreation' do - it 'should create an instance of ClassCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassCreation) - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "section"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "level"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "skills_focused"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["notation", "sight-reading", "performance-instrumental", "ear-training", "music-theory", "composition", "jazz-ensemble", "music-technology", "other"]) - # validator.allowable_values.each do |value| - # expect { instance.skills_focused = value }.not_to raise_error - # end - end - end - - describe 'test attribute "size"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_details_canvas_spec.rb b/spec/models/class_details_canvas_spec.rb deleted file mode 100644 index 77b2453..0000000 --- a/spec/models/class_details_canvas_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetailsCanvas -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetailsCanvas do - let(:instance) { FlatApi::ClassDetailsCanvas.new } - - describe 'test an instance of ClassDetailsCanvas' do - it 'should create an instance of ClassDetailsCanvas' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetailsCanvas) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "domain"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_details_clever_spec.rb b/spec/models/class_details_clever_spec.rb deleted file mode 100644 index d5bf52c..0000000 --- a/spec/models/class_details_clever_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetailsClever -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetailsClever do - let(:instance) { FlatApi::ClassDetailsClever.new } - - describe 'test an instance of ClassDetailsClever' do - it 'should create an instance of ClassDetailsClever' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetailsClever) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "modification_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "subject"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["english/language arts", "math", "science", "social studies", "language", "homeroom/advisory", "interventions/online learning", "technology and engineering", "PE and health", "arts and music", "other"]) - # validator.allowable_values.each do |value| - # expect { instance.subject = value }.not_to raise_error - # end - end - end - - describe 'test attribute "term_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "term_start_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "term_end_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_details_google_classroom_spec.rb b/spec/models/class_details_google_classroom_spec.rb deleted file mode 100644 index 307a5ad..0000000 --- a/spec/models/class_details_google_classroom_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetailsGoogleClassroom -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetailsGoogleClassroom do - let(:instance) { FlatApi::ClassDetailsGoogleClassroom.new } - - describe 'test an instance of ClassDetailsGoogleClassroom' do - it 'should create an instance of ClassDetailsGoogleClassroom' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetailsGoogleClassroom) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "alternate_link"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_details_google_drive_spec.rb b/spec/models/class_details_google_drive_spec.rb deleted file mode 100644 index a14086a..0000000 --- a/spec/models/class_details_google_drive_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetailsGoogleDrive -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetailsGoogleDrive do - let(:instance) { FlatApi::ClassDetailsGoogleDrive.new } - - describe 'test an instance of ClassDetailsGoogleDrive' do - it 'should create an instance of ClassDetailsGoogleDrive' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetailsGoogleDrive) - end - end - - describe 'test attribute "teacher_folder_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "teacher_folder_alternate_link"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_details_issues_spec.rb b/spec/models/class_details_issues_spec.rb deleted file mode 100644 index dc43956..0000000 --- a/spec/models/class_details_issues_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetailsIssues -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetailsIssues do - let(:instance) { FlatApi::ClassDetailsIssues.new } - - describe 'test an instance of ClassDetailsIssues' do - it 'should create an instance of ClassDetailsIssues' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetailsIssues) - end - end - - describe 'test attribute "sync"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_details_issues_sync_inner_spec.rb b/spec/models/class_details_issues_sync_inner_spec.rb deleted file mode 100644 index 23ed693..0000000 --- a/spec/models/class_details_issues_sync_inner_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetailsIssuesSyncInner -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetailsIssuesSyncInner do - let(:instance) { FlatApi::ClassDetailsIssuesSyncInner.new } - - describe 'test an instance of ClassDetailsIssuesSyncInner' do - it 'should create an instance of ClassDetailsIssuesSyncInner' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetailsIssuesSyncInner) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "email"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "reason"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["otherOrgnanization", "personalSubscription"]) - # validator.allowable_values.each do |value| - # expect { instance.reason = value }.not_to raise_error - # end - end - end - -end diff --git a/spec/models/class_details_lti_spec.rb b/spec/models/class_details_lti_spec.rb deleted file mode 100644 index 2f1922c..0000000 --- a/spec/models/class_details_lti_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetailsLti -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetailsLti do - let(:instance) { FlatApi::ClassDetailsLti.new } - - describe 'test an instance of ClassDetailsLti' do - it 'should create an instance of ClassDetailsLti' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetailsLti) - end - end - - describe 'test attribute "context_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "context_title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "context_label"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_details_mfc_spec.rb b/spec/models/class_details_mfc_spec.rb deleted file mode 100644 index 547770c..0000000 --- a/spec/models/class_details_mfc_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetailsMfc -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetailsMfc do - let(:instance) { FlatApi::ClassDetailsMfc.new } - - describe 'test an instance of ClassDetailsMfc' do - it 'should create an instance of ClassDetailsMfc' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetailsMfc) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "alternate_link"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_details_microsoft_graph_spec.rb b/spec/models/class_details_microsoft_graph_spec.rb deleted file mode 100644 index bedbf8b..0000000 --- a/spec/models/class_details_microsoft_graph_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetailsMicrosoftGraph -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetailsMicrosoftGraph do - let(:instance) { FlatApi::ClassDetailsMicrosoftGraph.new } - - describe 'test an instance of ClassDetailsMicrosoftGraph' do - it 'should create an instance of ClassDetailsMicrosoftGraph' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetailsMicrosoftGraph) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_details_spec.rb b/spec/models/class_details_spec.rb deleted file mode 100644 index 78bbe0e..0000000 --- a/spec/models/class_details_spec.rb +++ /dev/null @@ -1,178 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassDetails -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassDetails do - let(:instance) { FlatApi::ClassDetails.new } - - describe 'test an instance of ClassDetails' do - it 'should create an instance of ClassDetails' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassDetails) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "section"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "owner"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "enrollment_code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "theme"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "assignments_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "students_group"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "teachers_group"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "issues"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_classroom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_drive"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "microsoft_graph"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lti"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "canvas"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "mfc"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "clever"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "level"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "skills_focused"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["notation", "sight-reading", "performance-instrumental", "ear-training", "music-theory", "composition", "jazz-ensemble", "music-technology", "other"]) - # validator.allowable_values.each do |value| - # expect { instance.skills_focused = value }.not_to raise_error - # end - end - end - - describe 'test attribute "size"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/class_grade_level_spec.rb b/spec/models/class_grade_level_spec.rb deleted file mode 100644 index b1535dd..0000000 --- a/spec/models/class_grade_level_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassGradeLevel -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassGradeLevel do - let(:instance) { FlatApi::ClassGradeLevel.new } - - describe 'test an instance of ClassGradeLevel' do - it 'should create an instance of ClassGradeLevel' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassGradeLevel) - end - end - -end diff --git a/spec/models/class_roles_spec.rb b/spec/models/class_roles_spec.rb deleted file mode 100644 index dd5438a..0000000 --- a/spec/models/class_roles_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassRoles -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassRoles do - let(:instance) { FlatApi::ClassRoles.new } - - describe 'test an instance of ClassRoles' do - it 'should create an instance of ClassRoles' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassRoles) - end - end - -end diff --git a/spec/models/class_state_spec.rb b/spec/models/class_state_spec.rb deleted file mode 100644 index d28f379..0000000 --- a/spec/models/class_state_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassState -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassState do - let(:instance) { FlatApi::ClassState.new } - - describe 'test an instance of ClassState' do - it 'should create an instance of ClassState' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassState) - end - end - -end diff --git a/spec/models/class_update_spec.rb b/spec/models/class_update_spec.rb deleted file mode 100644 index eb5f485..0000000 --- a/spec/models/class_update_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ClassUpdate -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ClassUpdate do - let(:instance) { FlatApi::ClassUpdate.new } - - describe 'test an instance of ClassUpdate' do - it 'should create an instance of ClassUpdate' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ClassUpdate) - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "section"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "level"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "skills_focused"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["notation", "sight-reading", "performance-instrumental", "ear-training", "music-theory", "composition", "jazz-ensemble", "music-technology", "other"]) - # validator.allowable_values.each do |value| - # expect { instance.skills_focused = value }.not_to raise_error - # end - end - end - - describe 'test attribute "size"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/collection_app_spec.rb b/spec/models/collection_app_spec.rb deleted file mode 100644 index 1b1b185..0000000 --- a/spec/models/collection_app_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::CollectionApp -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::CollectionApp do - let(:instance) { FlatApi::CollectionApp.new } - - describe 'test an instance of CollectionApp' do - it 'should create an instance of CollectionApp' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::CollectionApp) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "logo"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/collection_capabilities_spec.rb b/spec/models/collection_capabilities_spec.rb deleted file mode 100644 index 113ceab..0000000 --- a/spec/models/collection_capabilities_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::CollectionCapabilities -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::CollectionCapabilities do - let(:instance) { FlatApi::CollectionCapabilities.new } - - describe 'test an instance of CollectionCapabilities' do - it 'should create an instance of CollectionCapabilities' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::CollectionCapabilities) - end - end - - describe 'test attribute "can_edit"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_share"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_delete"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_add_scores"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_delete_scores"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/collection_creation_spec.rb b/spec/models/collection_creation_spec.rb deleted file mode 100644 index 4178291..0000000 --- a/spec/models/collection_creation_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::CollectionCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::CollectionCreation do - let(:instance) { FlatApi::CollectionCreation.new } - - describe 'test an instance of CollectionCreation' do - it 'should create an instance of CollectionCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::CollectionCreation) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/collection_modification_spec.rb b/spec/models/collection_modification_spec.rb deleted file mode 100644 index 7d14c0a..0000000 --- a/spec/models/collection_modification_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::CollectionModification -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::CollectionModification do - let(:instance) { FlatApi::CollectionModification.new } - - describe 'test an instance of CollectionModification' do - it 'should create an instance of CollectionModification' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::CollectionModification) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/collection_privacy_spec.rb b/spec/models/collection_privacy_spec.rb deleted file mode 100644 index cae0fd2..0000000 --- a/spec/models/collection_privacy_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::CollectionPrivacy -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::CollectionPrivacy do - let(:instance) { FlatApi::CollectionPrivacy.new } - - describe 'test an instance of CollectionPrivacy' do - it 'should create an instance of CollectionPrivacy' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::CollectionPrivacy) - end - end - -end diff --git a/spec/models/collection_spec.rb b/spec/models/collection_spec.rb deleted file mode 100644 index 40e85cb..0000000 --- a/spec/models/collection_spec.rb +++ /dev/null @@ -1,114 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::Collection -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::Collection do - let(:instance) { FlatApi::Collection.new } - - describe 'test an instance of Collection' do - it 'should create an instance of Collection' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::Collection) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "sharing_key"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "app"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "user"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "rights"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collaborators"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "capabilities"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collections"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/collection_type_spec.rb b/spec/models/collection_type_spec.rb deleted file mode 100644 index 4ba6d25..0000000 --- a/spec/models/collection_type_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::CollectionType -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::CollectionType do - let(:instance) { FlatApi::CollectionType.new } - - describe 'test an instance of CollectionType' do - it 'should create an instance of CollectionType' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::CollectionType) - end - end - -end diff --git a/spec/models/edu_library_spec.rb b/spec/models/edu_library_spec.rb deleted file mode 100644 index 0e6d627..0000000 --- a/spec/models/edu_library_spec.rb +++ /dev/null @@ -1,62 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduLibrary -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduLibrary do - let(:instance) { FlatApi::EduLibrary.new } - - describe 'test an instance of EduLibrary' do - it 'should create an instance of EduLibrary' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduLibrary) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["myResources", "organizationResources", "flatEduSamples"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "visibility"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["private", "organization", "public"]) - # validator.allowable_values.each do |value| - # expect { instance.visibility = value }.not_to raise_error - # end - end - end - -end diff --git a/spec/models/edu_resource_capabilities_spec.rb b/spec/models/edu_resource_capabilities_spec.rb deleted file mode 100644 index 3c67746..0000000 --- a/spec/models/edu_resource_capabilities_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceCapabilities -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceCapabilities do - let(:instance) { FlatApi::EduResourceCapabilities.new } - - describe 'test an instance of EduResourceCapabilities' do - it 'should create an instance of EduResourceCapabilities' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourceCapabilities) - end - end - - describe 'test attribute "can_edit"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_add_resources"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "can_add_folders"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/edu_resource_copy_spec.rb b/spec/models/edu_resource_copy_spec.rb deleted file mode 100644 index 15be448..0000000 --- a/spec/models/edu_resource_copy_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceCopy -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceCopy do - let(:instance) { FlatApi::EduResourceCopy.new } - - describe 'test an instance of EduResourceCopy' do - it 'should create an instance of EduResourceCopy' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourceCopy) - end - end - - describe 'test attribute "destination"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/edu_resource_creation_spec.rb b/spec/models/edu_resource_creation_spec.rb deleted file mode 100644 index c55556e..0000000 --- a/spec/models/edu_resource_creation_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceCreation do - let(:instance) { FlatApi::EduResourceCreation.new } - - describe 'test an instance of EduResourceCreation' do - it 'should create an instance of EduResourceCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourceCreation) - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/edu_resource_folder_spec.rb b/spec/models/edu_resource_folder_spec.rb deleted file mode 100644 index 179c96f..0000000 --- a/spec/models/edu_resource_folder_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceFolder -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceFolder do - let(:instance) { FlatApi::EduResourceFolder.new } - - describe 'test an instance of EduResourceFolder' do - it 'should create an instance of EduResourceFolder' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourceFolder) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/edu_resource_lti_link_spec.rb b/spec/models/edu_resource_lti_link_spec.rb deleted file mode 100644 index 545dc68..0000000 --- a/spec/models/edu_resource_lti_link_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceLtiLink -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceLtiLink do - let(:instance) { FlatApi::EduResourceLtiLink.new } - - describe 'test an instance of EduResourceLtiLink' do - it 'should create an instance of EduResourceLtiLink' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourceLtiLink) - end - end - - describe 'test attribute "lti_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/edu_resource_move_spec.rb b/spec/models/edu_resource_move_spec.rb deleted file mode 100644 index 99ffbbb..0000000 --- a/spec/models/edu_resource_move_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceMove -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceMove do - let(:instance) { FlatApi::EduResourceMove.new } - - describe 'test an instance of EduResourceMove' do - it 'should create an instance of EduResourceMove' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourceMove) - end - end - - describe 'test attribute "destination"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/edu_resource_privacy_spec.rb b/spec/models/edu_resource_privacy_spec.rb deleted file mode 100644 index 414d22c..0000000 --- a/spec/models/edu_resource_privacy_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourcePrivacy -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourcePrivacy do - let(:instance) { FlatApi::EduResourcePrivacy.new } - - describe 'test an instance of EduResourcePrivacy' do - it 'should create an instance of EduResourcePrivacy' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourcePrivacy) - end - end - -end diff --git a/spec/models/edu_resource_resource_spec.rb b/spec/models/edu_resource_resource_spec.rb deleted file mode 100644 index 2f9dfb9..0000000 --- a/spec/models/edu_resource_resource_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceResource -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceResource do - describe '.openapi_one_of' do - it 'lists the items referenced in the oneOf array' do - expect(described_class.openapi_one_of).to_not be_empty - end - end - - describe '.build' do - it 'returns the correct model' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end -end diff --git a/spec/models/edu_resource_spec.rb b/spec/models/edu_resource_spec.rb deleted file mode 100644 index 96f8006..0000000 --- a/spec/models/edu_resource_spec.rb +++ /dev/null @@ -1,96 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResource -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResource do - let(:instance) { FlatApi::EduResource.new } - - describe 'test an instance of EduResource' do - it 'should create an instance of EduResource' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResource) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creator"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tags"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "update_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "resource"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "capabilities"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/edu_resource_type_spec.rb b/spec/models/edu_resource_type_spec.rb deleted file mode 100644 index 5a46494..0000000 --- a/spec/models/edu_resource_type_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceType -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceType do - let(:instance) { FlatApi::EduResourceType.new } - - describe 'test an instance of EduResourceType' do - it 'should create an instance of EduResourceType' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourceType) - end - end - -end diff --git a/spec/models/edu_resource_update_spec.rb b/spec/models/edu_resource_update_spec.rb deleted file mode 100644 index b2cf021..0000000 --- a/spec/models/edu_resource_update_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceUpdate -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceUpdate do - let(:instance) { FlatApi::EduResourceUpdate.new } - - describe 'test an instance of EduResourceUpdate' do - it 'should create an instance of EduResourceUpdate' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourceUpdate) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/edu_resource_use_in_class_spec.rb b/spec/models/edu_resource_use_in_class_spec.rb deleted file mode 100644 index 4883a5f..0000000 --- a/spec/models/edu_resource_use_in_class_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::EduResourceUseInClass -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::EduResourceUseInClass do - let(:instance) { FlatApi::EduResourceUseInClass.new } - - describe 'test an instance of EduResourceUseInClass' do - it 'should create an instance of EduResourceUseInClass' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::EduResourceUseInClass) - end - end - - describe 'test attribute "classroom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "assignment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/flat_error_response_spec.rb b/spec/models/flat_error_response_spec.rb deleted file mode 100644 index 5f417ca..0000000 --- a/spec/models/flat_error_response_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::FlatErrorResponse -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::FlatErrorResponse do - let(:instance) { FlatApi::FlatErrorResponse.new } - - describe 'test an instance of FlatErrorResponse' do - it 'should create an instance of FlatErrorResponse' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::FlatErrorResponse) - end - end - - describe 'test attribute "code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "message"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "param"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/flat_locales_spec.rb b/spec/models/flat_locales_spec.rb deleted file mode 100644 index b6dc12c..0000000 --- a/spec/models/flat_locales_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::FlatLocales -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::FlatLocales do - let(:instance) { FlatApi::FlatLocales.new } - - describe 'test an instance of FlatLocales' do - it 'should create an instance of FlatLocales' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::FlatLocales) - end - end - -end diff --git a/spec/models/google_classroom_coursework_spec.rb b/spec/models/google_classroom_coursework_spec.rb deleted file mode 100644 index a7e9052..0000000 --- a/spec/models/google_classroom_coursework_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::GoogleClassroomCoursework -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::GoogleClassroomCoursework do - let(:instance) { FlatApi::GoogleClassroomCoursework.new } - - describe 'test an instance of GoogleClassroomCoursework' do - it 'should create an instance of GoogleClassroomCoursework' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::GoogleClassroomCoursework) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "alternate_link"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "topic_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/google_classroom_submission_spec.rb b/spec/models/google_classroom_submission_spec.rb deleted file mode 100644 index 8597dea..0000000 --- a/spec/models/google_classroom_submission_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::GoogleClassroomSubmission -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::GoogleClassroomSubmission do - let(:instance) { FlatApi::GoogleClassroomSubmission.new } - - describe 'test an instance of GoogleClassroomSubmission' do - it 'should create an instance of GoogleClassroomSubmission' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::GoogleClassroomSubmission) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "alternate_link"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/group_details_spec.rb b/spec/models/group_details_spec.rb deleted file mode 100644 index b627e49..0000000 --- a/spec/models/group_details_spec.rb +++ /dev/null @@ -1,72 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::GroupDetails -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::GroupDetails do - let(:instance) { FlatApi::GroupDetails.new } - - describe 'test an instance of GroupDetails' do - it 'should create an instance of GroupDetails' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::GroupDetails) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "users_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "read_only"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb deleted file mode 100644 index fa3fdc9..0000000 --- a/spec/models/group_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::Group -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::Group do - let(:instance) { FlatApi::Group.new } - - describe 'test an instance of Group' do - it 'should create an instance of Group' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::Group) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["generic", "classTeachers", "classStudents"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "users_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "read_only"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/group_type_spec.rb b/spec/models/group_type_spec.rb deleted file mode 100644 index f974c05..0000000 --- a/spec/models/group_type_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::GroupType -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::GroupType do - let(:instance) { FlatApi::GroupType.new } - - describe 'test an instance of GroupType' do - it 'should create an instance of GroupType' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::GroupType) - end - end - -end diff --git a/spec/models/license_mode_spec.rb b/spec/models/license_mode_spec.rb deleted file mode 100644 index ab47a32..0000000 --- a/spec/models/license_mode_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::LicenseMode -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::LicenseMode do - let(:instance) { FlatApi::LicenseMode.new } - - describe 'test an instance of LicenseMode' do - it 'should create an instance of LicenseMode' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::LicenseMode) - end - end - -end diff --git a/spec/models/license_sources_spec.rb b/spec/models/license_sources_spec.rb deleted file mode 100644 index 158a308..0000000 --- a/spec/models/license_sources_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::LicenseSources -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::LicenseSources do - let(:instance) { FlatApi::LicenseSources.new } - - describe 'test an instance of LicenseSources' do - it 'should create an instance of LicenseSources' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::LicenseSources) - end - end - -end diff --git a/spec/models/lms_name_spec.rb b/spec/models/lms_name_spec.rb deleted file mode 100644 index 521314b..0000000 --- a/spec/models/lms_name_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::LmsName -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::LmsName do - let(:instance) { FlatApi::LmsName.new } - - describe 'test an instance of LmsName' do - it 'should create an instance of LmsName' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::LmsName) - end - end - -end diff --git a/spec/models/lti_credentials_creation_spec.rb b/spec/models/lti_credentials_creation_spec.rb deleted file mode 100644 index 08fd498..0000000 --- a/spec/models/lti_credentials_creation_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::LtiCredentialsCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::LtiCredentialsCreation do - let(:instance) { FlatApi::LtiCredentialsCreation.new } - - describe 'test an instance of LtiCredentialsCreation' do - it 'should create an instance of LtiCredentialsCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::LtiCredentialsCreation) - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lms"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/lti_credentials_spec.rb b/spec/models/lti_credentials_spec.rb deleted file mode 100644 index 40f904e..0000000 --- a/spec/models/lti_credentials_spec.rb +++ /dev/null @@ -1,84 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::LtiCredentials -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::LtiCredentials do - let(:instance) { FlatApi::LtiCredentials.new } - - describe 'test an instance of LtiCredentials' do - it 'should create an instance of LtiCredentials' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::LtiCredentials) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lms"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creator"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "last_usage"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "consumer_key"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "consumer_secret"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/media_attachment_spec.rb b/spec/models/media_attachment_spec.rb deleted file mode 100644 index 6d5ef46..0000000 --- a/spec/models/media_attachment_spec.rb +++ /dev/null @@ -1,166 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::MediaAttachment -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::MediaAttachment do - let(:instance) { FlatApi::MediaAttachment.new } - - describe 'test an instance of MediaAttachment' do - it 'should create an instance of MediaAttachment' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::MediaAttachment) - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["rich", "photo", "video", "link", "flat", "googleDrive", "worksheet", "performance"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "score"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "revision"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "worksheet"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "dedicated"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "track"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "sharing_mode"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lock_score_template"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html_width"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html_height"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "thumbnail_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "thumbnail_width"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "thumbnail_height"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "author_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "author_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "icon_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "mime_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_drive_file_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/media_score_sharing_mode_spec.rb b/spec/models/media_score_sharing_mode_spec.rb deleted file mode 100644 index e584943..0000000 --- a/spec/models/media_score_sharing_mode_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::MediaScoreSharingMode -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::MediaScoreSharingMode do - let(:instance) { FlatApi::MediaScoreSharingMode.new } - - describe 'test an instance of MediaScoreSharingMode' do - it 'should create an instance of MediaScoreSharingMode' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::MediaScoreSharingMode) - end - end - -end diff --git a/spec/models/microsoft_graph_assignment_spec.rb b/spec/models/microsoft_graph_assignment_spec.rb deleted file mode 100644 index 1798aad..0000000 --- a/spec/models/microsoft_graph_assignment_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::MicrosoftGraphAssignment -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::MicrosoftGraphAssignment do - let(:instance) { FlatApi::MicrosoftGraphAssignment.new } - - describe 'test an instance of MicrosoftGraphAssignment' do - it 'should create an instance of MicrosoftGraphAssignment' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::MicrosoftGraphAssignment) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "alternate_link"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "categories"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/microsoft_graph_submission_spec.rb b/spec/models/microsoft_graph_submission_spec.rb deleted file mode 100644 index 631222b..0000000 --- a/spec/models/microsoft_graph_submission_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::MicrosoftGraphSubmission -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::MicrosoftGraphSubmission do - let(:instance) { FlatApi::MicrosoftGraphSubmission.new } - - describe 'test an instance of MicrosoftGraphSubmission' do - it 'should create an instance of MicrosoftGraphSubmission' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::MicrosoftGraphSubmission) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/organization_invitation_creation_spec.rb b/spec/models/organization_invitation_creation_spec.rb deleted file mode 100644 index fd09c23..0000000 --- a/spec/models/organization_invitation_creation_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::OrganizationInvitationCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::OrganizationInvitationCreation do - let(:instance) { FlatApi::OrganizationInvitationCreation.new } - - describe 'test an instance of OrganizationInvitationCreation' do - it 'should create an instance of OrganizationInvitationCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::OrganizationInvitationCreation) - end - end - - describe 'test attribute "email"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["admin", "teacher"]) - # validator.allowable_values.each do |value| - # expect { instance.organization_role = value }.not_to raise_error - # end - end - end - -end diff --git a/spec/models/organization_invitation_spec.rb b/spec/models/organization_invitation_spec.rb deleted file mode 100644 index 32d06eb..0000000 --- a/spec/models/organization_invitation_spec.rb +++ /dev/null @@ -1,84 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::OrganizationInvitation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::OrganizationInvitation do - let(:instance) { FlatApi::OrganizationInvitation.new } - - describe 'test an instance of OrganizationInvitation' do - it 'should create an instance of OrganizationInvitation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::OrganizationInvitation) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "custom_code"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "email"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "invited_by"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "allow_multiple_use"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "used_by"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/organization_roles_spec.rb b/spec/models/organization_roles_spec.rb deleted file mode 100644 index b3a4d96..0000000 --- a/spec/models/organization_roles_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::OrganizationRoles -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::OrganizationRoles do - let(:instance) { FlatApi::OrganizationRoles.new } - - describe 'test an instance of OrganizationRoles' do - it 'should create an instance of OrganizationRoles' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::OrganizationRoles) - end - end - -end diff --git a/spec/models/organization_user_access_token_creation_spec.rb b/spec/models/organization_user_access_token_creation_spec.rb deleted file mode 100644 index 1990c6c..0000000 --- a/spec/models/organization_user_access_token_creation_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::OrganizationUserAccessTokenCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::OrganizationUserAccessTokenCreation do - let(:instance) { FlatApi::OrganizationUserAccessTokenCreation.new } - - describe 'test an instance of OrganizationUserAccessTokenCreation' do - it 'should create an instance of OrganizationUserAccessTokenCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::OrganizationUserAccessTokenCreation) - end - end - - describe 'test attribute "scopes"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/resource_collaborator_creation_spec.rb b/spec/models/resource_collaborator_creation_spec.rb deleted file mode 100644 index eca9990..0000000 --- a/spec/models/resource_collaborator_creation_spec.rb +++ /dev/null @@ -1,72 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ResourceCollaboratorCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ResourceCollaboratorCreation do - let(:instance) { FlatApi::ResourceCollaboratorCreation.new } - - describe 'test an instance of ResourceCollaboratorCreation' do - it 'should create an instance of ResourceCollaboratorCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ResourceCollaboratorCreation) - end - end - - describe 'test attribute "user"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "group"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "user_email"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "user_token"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "acl_read"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "acl_write"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "acl_admin"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/resource_collaborator_spec.rb b/spec/models/resource_collaborator_spec.rb deleted file mode 100644 index d704df5..0000000 --- a/spec/models/resource_collaborator_spec.rb +++ /dev/null @@ -1,112 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ResourceCollaborator -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ResourceCollaborator do - let(:instance) { FlatApi::ResourceCollaborator.new } - - describe 'test an instance of ResourceCollaborator' do - it 'should create an instance of ResourceCollaborator' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ResourceCollaborator) - end - end - - describe 'test attribute "acl_read"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "acl_write"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "acl_admin"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "is_collaborator"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collaborator_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["owner", "user", "group"]) - # validator.allowable_values.each do |value| - # expect { instance.collaborator_type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "score"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collection"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "user"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "group"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "user_email"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "invited"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/resource_rights_spec.rb b/spec/models/resource_rights_spec.rb deleted file mode 100644 index 651f548..0000000 --- a/spec/models/resource_rights_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ResourceRights -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ResourceRights do - let(:instance) { FlatApi::ResourceRights.new } - - describe 'test an instance of ResourceRights' do - it 'should create an instance of ResourceRights' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ResourceRights) - end - end - - describe 'test attribute "acl_read"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "acl_write"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "acl_admin"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "is_collaborator"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collaborator_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["owner", "user", "group"]) - # validator.allowable_values.each do |value| - # expect { instance.collaborator_type = value }.not_to raise_error - # end - end - end - -end diff --git a/spec/models/score_comment_context_spec.rb b/spec/models/score_comment_context_spec.rb deleted file mode 100644 index 57985e1..0000000 --- a/spec/models/score_comment_context_spec.rb +++ /dev/null @@ -1,78 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCommentContext -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCommentContext do - let(:instance) { FlatApi::ScoreCommentContext.new } - - describe 'test an instance of ScoreCommentContext' do - it 'should create an instance of ScoreCommentContext' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCommentContext) - end - end - - describe 'test attribute "part_uuid"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "staff_idx"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "staff_uuid"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "measure_uuids"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_time_pos"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "stop_time_pos"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_dpq"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "stop_dpq"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_comment_creation_spec.rb b/spec/models/score_comment_creation_spec.rb deleted file mode 100644 index 29039c1..0000000 --- a/spec/models/score_comment_creation_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCommentCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCommentCreation do - let(:instance) { FlatApi::ScoreCommentCreation.new } - - describe 'test an instance of ScoreCommentCreation' do - it 'should create an instance of ScoreCommentCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCommentCreation) - end - end - - describe 'test attribute "revision"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "comment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "raw_comment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "mentions"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "reply_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "context"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_comment_moderation_spec.rb b/spec/models/score_comment_moderation_spec.rb deleted file mode 100644 index 98aacda..0000000 --- a/spec/models/score_comment_moderation_spec.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCommentModeration -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCommentModeration do - let(:instance) { FlatApi::ScoreCommentModeration.new } - - describe 'test an instance of ScoreCommentModeration' do - it 'should create an instance of ScoreCommentModeration' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCommentModeration) - end - end - - describe 'test attribute "hidden"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "reason"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["spam", "inappropriate"]) - # validator.allowable_values.each do |value| - # expect { instance.reason = value }.not_to raise_error - # end - end - end - -end diff --git a/spec/models/score_comment_spec.rb b/spec/models/score_comment_spec.rb deleted file mode 100644 index f61ea1b..0000000 --- a/spec/models/score_comment_spec.rb +++ /dev/null @@ -1,130 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreComment -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreComment do - let(:instance) { FlatApi::ScoreComment.new } - - describe 'test an instance of ScoreComment' do - it 'should create an instance of ScoreComment' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreComment) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["document", "inline"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "user"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "score"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "revision"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "reply_to"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "modification_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "comment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "raw_comment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "context"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "mentions"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "resolved"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "resolved_by"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "moderation"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "spam"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_comment_update_spec.rb b/spec/models/score_comment_update_spec.rb deleted file mode 100644 index 460ca8b..0000000 --- a/spec/models/score_comment_update_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCommentUpdate -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCommentUpdate do - let(:instance) { FlatApi::ScoreCommentUpdate.new } - - describe 'test an instance of ScoreCommentUpdate' do - it 'should create an instance of ScoreCommentUpdate' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCommentUpdate) - end - end - - describe 'test attribute "revision"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "comment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "raw_comment"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "context"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_comments_counts_spec.rb b/spec/models/score_comments_counts_spec.rb deleted file mode 100644 index f5ec1b0..0000000 --- a/spec/models/score_comments_counts_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCommentsCounts -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCommentsCounts do - let(:instance) { FlatApi::ScoreCommentsCounts.new } - - describe 'test an instance of ScoreCommentsCounts' do - it 'should create an instance of ScoreCommentsCounts' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCommentsCounts) - end - end - - describe 'test attribute "total"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "unique"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "weekly"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "monthly"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_creation_builder_data_all_of_builder_data_layout_data_spec.rb b/spec/models/score_creation_builder_data_all_of_builder_data_layout_data_spec.rb deleted file mode 100644 index e6f93ac..0000000 --- a/spec/models/score_creation_builder_data_all_of_builder_data_layout_data_spec.rb +++ /dev/null @@ -1,82 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreationBuilderDataAllOfBuilderDataLayoutData -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreationBuilderDataAllOfBuilderDataLayoutData do - let(:instance) { FlatApi::ScoreCreationBuilderDataAllOfBuilderDataLayoutData.new } - - describe 'test an instance of ScoreCreationBuilderDataAllOfBuilderDataLayoutData' do - it 'should create an instance of ScoreCreationBuilderDataAllOfBuilderDataLayoutData' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCreationBuilderDataAllOfBuilderDataLayoutData) - end - end - - describe 'test attribute "notes_spacing_coeff"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "length_unit"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["cm", "inch"]) - # validator.allowable_values.each do |value| - # expect { instance.length_unit = value }.not_to raise_error - # end - end - end - - describe 'test attribute "page_height"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "page_width"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "page_margin_top"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "page_margin_bottom"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "page_margin_left"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "page_margin_right"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_creation_builder_data_all_of_builder_data_score_data_instruments_spec.rb b/spec/models/score_creation_builder_data_all_of_builder_data_score_data_instruments_spec.rb deleted file mode 100644 index cc45401..0000000 --- a/spec/models/score_creation_builder_data_all_of_builder_data_score_data_instruments_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments do - let(:instance) { FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.new } - - describe 'test an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments' do - it 'should create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments) - end - end - - describe 'test attribute "group"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "instrument"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "long_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "short_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "has_quarter_tone"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_creation_builder_data_all_of_builder_data_score_data_spec.rb b/spec/models/score_creation_builder_data_all_of_builder_data_score_data_spec.rb deleted file mode 100644 index 51b6ad6..0000000 --- a/spec/models/score_creation_builder_data_all_of_builder_data_score_data_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData do - let(:instance) { FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData.new } - - describe 'test an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreData' do - it 'should create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreData' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCreationBuilderDataAllOfBuilderDataScoreData) - end - end - - describe 'test attribute "use_tab_staff"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "use_chord_grid"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "fifths"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "nb_beats"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "beat_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "instruments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_creation_builder_data_all_of_builder_data_spec.rb b/spec/models/score_creation_builder_data_all_of_builder_data_spec.rb deleted file mode 100644 index e508f2d..0000000 --- a/spec/models/score_creation_builder_data_all_of_builder_data_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreationBuilderDataAllOfBuilderData -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreationBuilderDataAllOfBuilderData do - let(:instance) { FlatApi::ScoreCreationBuilderDataAllOfBuilderData.new } - - describe 'test an instance of ScoreCreationBuilderDataAllOfBuilderData' do - it 'should create an instance of ScoreCreationBuilderDataAllOfBuilderData' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCreationBuilderDataAllOfBuilderData) - end - end - - describe 'test attribute "score_data"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "layout_data"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_creation_builder_data_spec.rb b/spec/models/score_creation_builder_data_spec.rb deleted file mode 100644 index 0c7fd57..0000000 --- a/spec/models/score_creation_builder_data_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreationBuilderData -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreationBuilderData do - let(:instance) { FlatApi::ScoreCreationBuilderData.new } - - describe 'test an instance of ScoreCreationBuilderData' do - it 'should create an instance of ScoreCreationBuilderData' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCreationBuilderData) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collection"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_drive_folder"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "builder_data"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_creation_common_spec.rb b/spec/models/score_creation_common_spec.rb deleted file mode 100644 index 74e8ff1..0000000 --- a/spec/models/score_creation_common_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreationCommon -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreationCommon do - let(:instance) { FlatApi::ScoreCreationCommon.new } - - describe 'test an instance of ScoreCreationCommon' do - it 'should create an instance of ScoreCreationCommon' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCreationCommon) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collection"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_drive_folder"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_creation_file_import_spec.rb b/spec/models/score_creation_file_import_spec.rb deleted file mode 100644 index 1c655ee..0000000 --- a/spec/models/score_creation_file_import_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreationFileImport -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreationFileImport do - let(:instance) { FlatApi::ScoreCreationFileImport.new } - - describe 'test an instance of ScoreCreationFileImport' do - it 'should create an instance of ScoreCreationFileImport' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCreationFileImport) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collection"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_drive_folder"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "filename"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "data"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "data_encoding"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["base64"]) - # validator.allowable_values.each do |value| - # expect { instance.data_encoding = value }.not_to raise_error - # end - end - end - -end diff --git a/spec/models/score_creation_google_drive_import_spec.rb b/spec/models/score_creation_google_drive_import_spec.rb deleted file mode 100644 index 012da82..0000000 --- a/spec/models/score_creation_google_drive_import_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreationGoogleDriveImport -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreationGoogleDriveImport do - let(:instance) { FlatApi::ScoreCreationGoogleDriveImport.new } - - describe 'test an instance of ScoreCreationGoogleDriveImport' do - it 'should create an instance of ScoreCreationGoogleDriveImport' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCreationGoogleDriveImport) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collection"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_drive_folder"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "source"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_creation_spec.rb b/spec/models/score_creation_spec.rb deleted file mode 100644 index 1623d48..0000000 --- a/spec/models/score_creation_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreation do - describe '.openapi_one_of' do - it 'lists the items referenced in the oneOf array' do - expect(described_class.openapi_one_of).to_not be_empty - end - end - - describe '.build' do - it 'returns the correct model' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end -end diff --git a/spec/models/score_creation_type_spec.rb b/spec/models/score_creation_type_spec.rb deleted file mode 100644 index bf789fc..0000000 --- a/spec/models/score_creation_type_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreCreationType -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreCreationType do - let(:instance) { FlatApi::ScoreCreationType.new } - - describe 'test an instance of ScoreCreationType' do - it 'should create an instance of ScoreCreationType' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreCreationType) - end - end - -end diff --git a/spec/models/score_details_spec.rb b/spec/models/score_details_spec.rb deleted file mode 100644 index 1ad96a8..0000000 --- a/spec/models/score_details_spec.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreDetails -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreDetails do - let(:instance) { FlatApi::ScoreDetails.new } - - describe 'test an instance of ScoreDetails' do - it 'should create an instance of ScoreDetails' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreDetails) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "sharing_key"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "user"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "subtitle"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lyricist"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "arranger"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "composer"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tags"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "license"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "license_text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "duration_time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "number_measures"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "main_tempo_qpm"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "main_key_signature"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "rights"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collaborators"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "modification_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "publication_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "highlighted_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "parent_score"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "instruments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "samples"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_drive_file_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "likes"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "comments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "views"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "plays"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collections"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_fork_spec.rb b/spec/models/score_fork_spec.rb deleted file mode 100644 index b9c87a6..0000000 --- a/spec/models/score_fork_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreFork -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreFork do - let(:instance) { FlatApi::ScoreFork.new } - - describe 'test an instance of ScoreFork' do - it 'should create an instance of ScoreFork' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreFork) - end - end - - describe 'test attribute "collection"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "google_drive_disabled"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "keep_original_title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_license_spec.rb b/spec/models/score_license_spec.rb deleted file mode 100644 index 79ab63b..0000000 --- a/spec/models/score_license_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreLicense -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreLicense do - let(:instance) { FlatApi::ScoreLicense.new } - - describe 'test an instance of ScoreLicense' do - it 'should create an instance of ScoreLicense' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreLicense) - end - end - -end diff --git a/spec/models/score_likes_counts_spec.rb b/spec/models/score_likes_counts_spec.rb deleted file mode 100644 index 1f3bef4..0000000 --- a/spec/models/score_likes_counts_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreLikesCounts -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreLikesCounts do - let(:instance) { FlatApi::ScoreLikesCounts.new } - - describe 'test an instance of ScoreLikesCounts' do - it 'should create an instance of ScoreLikesCounts' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreLikesCounts) - end - end - - describe 'test attribute "total"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "weekly"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "monthly"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_modification_spec.rb b/spec/models/score_modification_spec.rb deleted file mode 100644 index b2cc6aa..0000000 --- a/spec/models/score_modification_spec.rb +++ /dev/null @@ -1,102 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreModification -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreModification do - let(:instance) { FlatApi::ScoreModification.new } - - describe 'test an instance of ScoreModification' do - it 'should create an instance of ScoreModification' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreModification) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "subtitle"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "composer"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lyricist"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "arranger"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "sharing_key"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tags"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "license"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "license_text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_plays_counts_spec.rb b/spec/models/score_plays_counts_spec.rb deleted file mode 100644 index 928fcdd..0000000 --- a/spec/models/score_plays_counts_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScorePlaysCounts -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScorePlaysCounts do - let(:instance) { FlatApi::ScorePlaysCounts.new } - - describe 'test an instance of ScorePlaysCounts' do - it 'should create an instance of ScorePlaysCounts' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScorePlaysCounts) - end - end - - describe 'test attribute "total"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "weekly"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "monthly"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_privacy_spec.rb b/spec/models/score_privacy_spec.rb deleted file mode 100644 index 8716f69..0000000 --- a/spec/models/score_privacy_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScorePrivacy -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScorePrivacy do - let(:instance) { FlatApi::ScorePrivacy.new } - - describe 'test an instance of ScorePrivacy' do - it 'should create an instance of ScorePrivacy' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScorePrivacy) - end - end - -end diff --git a/spec/models/score_revision_creation_spec.rb b/spec/models/score_revision_creation_spec.rb deleted file mode 100644 index a792ce7..0000000 --- a/spec/models/score_revision_creation_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreRevisionCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreRevisionCreation do - let(:instance) { FlatApi::ScoreRevisionCreation.new } - - describe 'test an instance of ScoreRevisionCreation' do - it 'should create an instance of ScoreRevisionCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreRevisionCreation) - end - end - - describe 'test attribute "data"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "data_encoding"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["base64"]) - # validator.allowable_values.each do |value| - # expect { instance.data_encoding = value }.not_to raise_error - # end - end - end - - describe 'test attribute "autosave"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_revision_spec.rb b/spec/models/score_revision_spec.rb deleted file mode 100644 index f02288f..0000000 --- a/spec/models/score_revision_spec.rb +++ /dev/null @@ -1,78 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreRevision -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreRevision do - let(:instance) { FlatApi::ScoreRevision.new } - - describe 'test an instance of ScoreRevision' do - it 'should create an instance of ScoreRevision' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreRevision) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "user"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "collaborators"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "event"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "description"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "autosave"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "statistics"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_revision_statistics_spec.rb b/spec/models/score_revision_statistics_spec.rb deleted file mode 100644 index 187950f..0000000 --- a/spec/models/score_revision_statistics_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreRevisionStatistics -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreRevisionStatistics do - let(:instance) { FlatApi::ScoreRevisionStatistics.new } - - describe 'test an instance of ScoreRevisionStatistics' do - it 'should create an instance of ScoreRevisionStatistics' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreRevisionStatistics) - end - end - - describe 'test attribute "additions"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "deletions"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "start_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "end_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_source_spec.rb b/spec/models/score_source_spec.rb deleted file mode 100644 index 520aaf5..0000000 --- a/spec/models/score_source_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreSource -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreSource do - let(:instance) { FlatApi::ScoreSource.new } - - describe 'test an instance of ScoreSource' do - it 'should create an instance of ScoreSource' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreSource) - end - end - - describe 'test attribute "google_drive"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_summary_spec.rb b/spec/models/score_summary_spec.rb deleted file mode 100644 index c7fa591..0000000 --- a/spec/models/score_summary_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreSummary -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreSummary do - let(:instance) { FlatApi::ScoreSummary.new } - - describe 'test an instance of ScoreSummary' do - it 'should create an instance of ScoreSummary' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreSummary) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "sharing_key"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "privacy"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "user"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_track_creation_spec.rb b/spec/models/score_track_creation_spec.rb deleted file mode 100644 index f005128..0000000 --- a/spec/models/score_track_creation_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreTrackCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreTrackCreation do - let(:instance) { FlatApi::ScoreTrackCreation.new } - - describe 'test an instance of ScoreTrackCreation' do - it 'should create an instance of ScoreTrackCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreTrackCreation) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "default"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "purpose"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "synchronization_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_track_point_spec.rb b/spec/models/score_track_point_spec.rb deleted file mode 100644 index ea3dea2..0000000 --- a/spec/models/score_track_point_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreTrackPoint -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreTrackPoint do - let(:instance) { FlatApi::ScoreTrackPoint.new } - - describe 'test an instance of ScoreTrackPoint' do - it 'should create an instance of ScoreTrackPoint' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreTrackPoint) - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["measure", "end"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "measure_uuid"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "time"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_track_purpose_spec.rb b/spec/models/score_track_purpose_spec.rb deleted file mode 100644 index 8bfd059..0000000 --- a/spec/models/score_track_purpose_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreTrackPurpose -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreTrackPurpose do - let(:instance) { FlatApi::ScoreTrackPurpose.new } - - describe 'test an instance of ScoreTrackPurpose' do - it 'should create an instance of ScoreTrackPurpose' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreTrackPurpose) - end - end - -end diff --git a/spec/models/score_track_spec.rb b/spec/models/score_track_spec.rb deleted file mode 100644 index 7692a83..0000000 --- a/spec/models/score_track_spec.rb +++ /dev/null @@ -1,108 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreTrack -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreTrack do - let(:instance) { FlatApi::ScoreTrack.new } - - describe 'test an instance of ScoreTrack' do - it 'should create an instance of ScoreTrack' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreTrack) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "score"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creator"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "modification_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "default"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "purpose"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "media_id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "synchronization_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_track_state_spec.rb b/spec/models/score_track_state_spec.rb deleted file mode 100644 index 27466d1..0000000 --- a/spec/models/score_track_state_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreTrackState -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreTrackState do - let(:instance) { FlatApi::ScoreTrackState.new } - - describe 'test an instance of ScoreTrackState' do - it 'should create an instance of ScoreTrackState' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreTrackState) - end - end - -end diff --git a/spec/models/score_track_type_spec.rb b/spec/models/score_track_type_spec.rb deleted file mode 100644 index 5deeb85..0000000 --- a/spec/models/score_track_type_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreTrackType -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreTrackType do - let(:instance) { FlatApi::ScoreTrackType.new } - - describe 'test an instance of ScoreTrackType' do - it 'should create an instance of ScoreTrackType' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreTrackType) - end - end - -end diff --git a/spec/models/score_track_update_spec.rb b/spec/models/score_track_update_spec.rb deleted file mode 100644 index 986fdcd..0000000 --- a/spec/models/score_track_update_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreTrackUpdate -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreTrackUpdate do - let(:instance) { FlatApi::ScoreTrackUpdate.new } - - describe 'test an instance of ScoreTrackUpdate' do - it 'should create an instance of ScoreTrackUpdate' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreTrackUpdate) - end - end - - describe 'test attribute "title"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "default"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "synchronization_points"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/score_views_counts_spec.rb b/spec/models/score_views_counts_spec.rb deleted file mode 100644 index 9498957..0000000 --- a/spec/models/score_views_counts_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::ScoreViewsCounts -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::ScoreViewsCounts do - let(:instance) { FlatApi::ScoreViewsCounts.new } - - describe 'test an instance of ScoreViewsCounts' do - it 'should create an instance of ScoreViewsCounts' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::ScoreViewsCounts) - end - end - - describe 'test attribute "total"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "weekly"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "monthly"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/task_export_options_spec.rb b/spec/models/task_export_options_spec.rb deleted file mode 100644 index b847132..0000000 --- a/spec/models/task_export_options_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::TaskExportOptions -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::TaskExportOptions do - let(:instance) { FlatApi::TaskExportOptions.new } - - describe 'test an instance of TaskExportOptions' do - it 'should create an instance of TaskExportOptions' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::TaskExportOptions) - end - end - - describe 'test attribute "parts"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/task_progress_spec.rb b/spec/models/task_progress_spec.rb deleted file mode 100644 index 18ba071..0000000 --- a/spec/models/task_progress_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::TaskProgress -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::TaskProgress do - let(:instance) { FlatApi::TaskProgress.new } - - describe 'test an instance of TaskProgress' do - it 'should create an instance of TaskProgress' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::TaskProgress) - end - end - - describe 'test attribute "percent"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "text"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/task_result_spec.rb b/spec/models/task_result_spec.rb deleted file mode 100644 index ad1f25e..0000000 --- a/spec/models/task_result_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::TaskResult -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::TaskResult do - let(:instance) { FlatApi::TaskResult.new } - - describe 'test an instance of TaskResult' do - it 'should create an instance of TaskResult' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::TaskResult) - end - end - - describe 'test attribute "url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/task_spec.rb b/spec/models/task_spec.rb deleted file mode 100644 index 1bc7c7b..0000000 --- a/spec/models/task_spec.rb +++ /dev/null @@ -1,100 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::Task -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::Task do - let(:instance) { FlatApi::Task.new } - - describe 'test an instance of Task' do - it 'should create an instance of Task' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::Task) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "state"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["created", "doing", "done", "canceled", "error"]) - # validator.allowable_values.each do |value| - # expect { instance.state = value }.not_to raise_error - # end - end - end - - describe 'test attribute "format"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "score"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "progress"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "creation_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "modification_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "done_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "result"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "error_history"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/tutteo_product_spec.rb b/spec/models/tutteo_product_spec.rb deleted file mode 100644 index cd9e4b7..0000000 --- a/spec/models/tutteo_product_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::TutteoProduct -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::TutteoProduct do - let(:instance) { FlatApi::TutteoProduct.new } - - describe 'test an instance of TutteoProduct' do - it 'should create an instance of TutteoProduct' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::TutteoProduct) - end - end - -end diff --git a/spec/models/user_admin_update_spec.rb b/spec/models/user_admin_update_spec.rb deleted file mode 100644 index ab7450c..0000000 --- a/spec/models/user_admin_update_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserAdminUpdate -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserAdminUpdate do - let(:instance) { FlatApi::UserAdminUpdate.new } - - describe 'test an instance of UserAdminUpdate' do - it 'should create an instance of UserAdminUpdate' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserAdminUpdate) - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "firstname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lastname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "email"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_azure_details_spec.rb b/spec/models/user_azure_details_spec.rb deleted file mode 100644 index 066b84f..0000000 --- a/spec/models/user_azure_details_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserAzureDetails -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserAzureDetails do - let(:instance) { FlatApi::UserAzureDetails.new } - - describe 'test an instance of UserAzureDetails' do - it 'should create an instance of UserAzureDetails' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserAzureDetails) - end - end - - describe 'test attribute "oid"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "hd"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "preferred_username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_basics_spec.rb b/spec/models/user_basics_spec.rb deleted file mode 100644 index ab0f4aa..0000000 --- a/spec/models/user_basics_spec.rb +++ /dev/null @@ -1,94 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserBasics -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserBasics do - let(:instance) { FlatApi::UserBasics.new } - - describe 'test an instance of UserBasics' do - it 'should create an instance of UserBasics' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserBasics) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["user", "guest"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "product"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "printable_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "firstname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lastname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "picture"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "badges"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_community_profile_links_spec.rb b/spec/models/user_community_profile_links_spec.rb deleted file mode 100644 index 936a5ad..0000000 --- a/spec/models/user_community_profile_links_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserCommunityProfileLinks -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserCommunityProfileLinks do - let(:instance) { FlatApi::UserCommunityProfileLinks.new } - - describe 'test an instance of UserCommunityProfileLinks' do - it 'should create an instance of UserCommunityProfileLinks' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserCommunityProfileLinks) - end - end - - describe 'test attribute "spotify_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "youtube_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "soundcloud_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "tiktok_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "instagram_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "website_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_creation_spec.rb b/spec/models/user_creation_spec.rb deleted file mode 100644 index 3aeff31..0000000 --- a/spec/models/user_creation_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserCreation do - let(:instance) { FlatApi::UserCreation.new } - - describe 'test an instance of UserCreation' do - it 'should create an instance of UserCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserCreation) - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "firstname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lastname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "email"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "password"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "locale"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["user", "teacher", "admin"]) - # validator.allowable_values.each do |value| - # expect { instance.role = value }.not_to raise_error - # end - end - end - -end diff --git a/spec/models/user_details_admin_all_of_license_spec.rb b/spec/models/user_details_admin_all_of_license_spec.rb deleted file mode 100644 index 40fa09e..0000000 --- a/spec/models/user_details_admin_all_of_license_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserDetailsAdminAllOfLicense -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserDetailsAdminAllOfLicense do - let(:instance) { FlatApi::UserDetailsAdminAllOfLicense.new } - - describe 'test an instance of UserDetailsAdminAllOfLicense' do - it 'should create an instance of UserDetailsAdminAllOfLicense' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserDetailsAdminAllOfLicense) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "expiration_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "source"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "mode"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "active"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_details_admin_spec.rb b/spec/models/user_details_admin_spec.rb deleted file mode 100644 index 985dff7..0000000 --- a/spec/models/user_details_admin_spec.rb +++ /dev/null @@ -1,142 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserDetailsAdmin -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserDetailsAdmin do - let(:instance) { FlatApi::UserDetailsAdmin.new } - - describe 'test an instance of UserDetailsAdmin' do - it 'should create an instance of UserDetailsAdmin' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserDetailsAdmin) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["user", "guest"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "product"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "printable_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "firstname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lastname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "picture"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "badges"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "class_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "email"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "last_activity_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "license"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "groups"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_details_spec.rb b/spec/models/user_details_spec.rb deleted file mode 100644 index 7462414..0000000 --- a/spec/models/user_details_spec.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserDetails -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserDetails do - let(:instance) { FlatApi::UserDetails.new } - - describe 'test an instance of UserDetails' do - it 'should create an instance of UserDetails' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserDetails) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["user", "guest"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "product"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "printable_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "firstname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lastname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "picture"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "badges"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "class_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "bio"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "registration_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "liked_scores_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "followers_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "following_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "owned_public_scores_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover_picture"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "profile_theme"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "instruments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "links"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "azure_details"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "private_profile"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "locale"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "groups"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "picture_file"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover_picture_file"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_public_spec.rb b/spec/models/user_public_spec.rb deleted file mode 100644 index 33f913f..0000000 --- a/spec/models/user_public_spec.rb +++ /dev/null @@ -1,178 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserPublic -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserPublic do - let(:instance) { FlatApi::UserPublic.new } - - describe 'test an instance of UserPublic' do - it 'should create an instance of UserPublic' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserPublic) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["user", "guest"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "product"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "printable_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "firstname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lastname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "picture"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "badges"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "class_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "bio"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "registration_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "liked_scores_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "followers_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "following_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "owned_public_scores_count"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "cover_picture"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "profile_theme"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "instruments"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "links"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_public_summary_spec.rb b/spec/models/user_public_summary_spec.rb deleted file mode 100644 index e6d41e8..0000000 --- a/spec/models/user_public_summary_spec.rb +++ /dev/null @@ -1,118 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserPublicSummary -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserPublicSummary do - let(:instance) { FlatApi::UserPublicSummary.new } - - describe 'test an instance of UserPublicSummary' do - it 'should create an instance of UserPublicSummary' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserPublicSummary) - end - end - - describe 'test attribute "id"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "type"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["user", "guest"]) - # validator.allowable_values.each do |value| - # expect { instance.type = value }.not_to raise_error - # end - end - end - - describe 'test attribute "product"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "username"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "printable_name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "firstname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "lastname"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "name"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "picture"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "badges"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "organization_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "class_role"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "html_url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_signin_link_creation_spec.rb b/spec/models/user_signin_link_creation_spec.rb deleted file mode 100644 index 3d8a0d8..0000000 --- a/spec/models/user_signin_link_creation_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserSigninLinkCreation -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserSigninLinkCreation do - let(:instance) { FlatApi::UserSigninLinkCreation.new } - - describe 'test an instance of UserSigninLinkCreation' do - it 'should create an instance of UserSigninLinkCreation' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserSigninLinkCreation) - end - end - - describe 'test attribute "destination_path"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/models/user_signin_link_spec.rb b/spec/models/user_signin_link_spec.rb deleted file mode 100644 index a21f20a..0000000 --- a/spec/models/user_signin_link_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for FlatApi::UserSigninLink -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe FlatApi::UserSigninLink do - let(:instance) { FlatApi::UserSigninLink.new } - - describe 'test an instance of UserSigninLink' do - it 'should create an instance of UserSigninLink' do - # uncomment below to test the instance creation - #expect(instance).to be_instance_of(FlatApi::UserSigninLink) - end - end - - describe 'test attribute "url"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - - describe 'test attribute "expiration_date"' do - it 'should work' do - # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ - end - end - -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index 93173d2..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,111 +0,0 @@ -=begin -#Flat API - -#The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/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: https://openapi-generator.tech -OpenAPI Generator version: 7.3.0 - -=end - -# load the gem -require 'flat_api' - -# The following was generated by the `rspec --init` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause -# this file to always be loaded, without a need to explicitly require it in any -# files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need -# it. -# -# The `.rspec` file also contains a few flags that are not defaults but that -# users commonly want. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. - config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. - config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. - mocks.verify_partial_doubles = true - end - -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # These two settings work together to allow you to limit a spec run - # to individual examples or groups you care about by tagging them with - # `:focus` metadata. When nothing is tagged with `:focus`, all examples - # get run. - config.filter_run :focus - config.run_all_when_everything_filtered = true - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode - config.disable_monkey_patching! - - # This setting enables warnings. It's recommended, but in some cases may - # be too noisy due to issues in dependencies. - config.warnings = true - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = 'doc' - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end -end diff --git a/tools/emit_inventory.py b/tools/emit_inventory.py new file mode 100755 index 0000000..14dce23 --- /dev/null +++ b/tools/emit_inventory.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python3 +"""Emit OPERATIONS.json for the ruby 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 / "lib" / "flat_api" / "api").glob("*.rb"): + for match in re.finditer(r"^ def ([a-z0-9_]+)\(", path.read_text(), re.M): + name = match.group(1) + if not name.endswith("_with_http_info"): + symbols.setdefault(name, path.stem) + + models = set() + for path in (ROOT / "lib" / "flat_api" / "models").glob("*.rb"): + text = path.read_text() + models |= set(re.findall(r"^ (?:class|module) (\w+)\b", 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": "ruby", "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..66051e8 --- /dev/null +++ b/tools/generate.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# Regenerate the Flat Ruby 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, applies patches, emits the inventory, bumps. +# +# Generating into a scratch tree and copying selectively makes FR-025d structural: the generator +# cannot write outside the declared zone, so protected files can never be clobbered. +# +# SPEC_REF api-reference release tag (default: latest release) +# SPEC_LOCAL_FILE use this local spec instead +# BUMP patch | minor | major | none (default: patch) +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 + +# VERSION is the durable source of truth, outside the generated zone. +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=".sdkgen-scratch" +rm -rf "$SCRATCH" +trap 'rm -rf "$SCRATCH"; cleanup_spec' EXIT + +log "Generating" +run_generator "$(manifest_get 'generator.name')" "tools/openapi-config.json" "$SCRATCH/out" + +log "Wiping the generated zone" +zone_wipe + +log "Installing the generated zone" +mkdir -p lib docs/reference .openapi-generator +cp -R "$SCRATCH/out/lib/." lib/ +[ -d "$SCRATCH/out/docs" ] && cp -R "$SCRATCH/out/docs/." docs/reference/ +[ -d "$SCRATCH/out/.openapi-generator" ] && cp -R "$SCRATCH/out/.openapi-generator/." .openapi-generator/ + +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" <<'VW' +import pathlib, re, sys +p = pathlib.Path("lib/flat_api/version.rb") +p.parent.mkdir(parents=True, exist_ok=True) +t = p.read_text() if p.is_file() else "module FlatApi\n VERSION = '0.0.0'\nend\n" +p.write_text(re.sub(r"VERSION = '[0-9.]+'", f"VERSION = '{sys.argv[1]}'", t)) +VW +echo "$NEW_VERSION" > VERSION + +log "Done. Version $NEW_VERSION" diff --git a/tools/lib/generate-common.sh b/tools/lib/generate-common.sh new file mode 100644 index 0000000..f6f0089 --- /dev/null +++ b/tools/lib/generate-common.sh @@ -0,0 +1,128 @@ +#!/usr/bin/env bash +# Shared generation helpers. Vendored per SDK on purpose: each repository must be able to +# regenerate itself with no orchestrator and no sibling checkout (FR-023). + +SPEC_FILE="${SPEC_FILE:-$REPO_ROOT/.openapi-spec.yaml}" +BUMP="${BUMP:-patch}" +API_REFERENCE_RAW="https://raw.githubusercontent.com/FlatIO/api-reference" + +log() { printf '\033[1;34m==>\033[0m %s\n' "$*"; } +die() { printf '\033[1;31merror:\033[0m %s\n' "$*" >&2; exit 1; } + +cleanup_spec() { rm -f "$SPEC_FILE"; } +trap cleanup_spec EXIT + +manifest_get() { + python3 - "$1" <<'PY' +import sys, yaml, functools, operator +key = sys.argv[1].split(".") +doc = yaml.safe_load(open(".sdkgen.yaml")) +print(functools.reduce(operator.getitem, key, doc)) +PY +} + +latest_release_tag() { + python3 - <<'PY' +import json, urllib.request +url = "https://api.github.com/repos/FlatIO/api-reference/releases/latest" +with urllib.request.urlopen(url, timeout=30) as r: + print(json.load(r)["tag_name"]) +PY +} + +resolve_spec() { + if [ -n "${SPEC_LOCAL_FILE:-}" ]; then + log "Using local spec: $SPEC_LOCAL_FILE" + cp "$SPEC_LOCAL_FILE" "$SPEC_FILE" + else + local ref="${SPEC_REF:-$(latest_release_tag)}" + log "Fetching FlatIO/api-reference@$ref" + curl -fsSL "$API_REFERENCE_RAW/$ref/spec/openapi.yaml" -o "$SPEC_FILE" \ + || die "could not fetch the specification at $ref" + local declared expected + declared="$(python3 -c "import yaml,sys;print(yaml.safe_load(open('$SPEC_FILE'))['info']['version'])")" + expected="${ref#v}" + [ "$declared" = "$expected" ] \ + || die "tag/version mismatch: tag $ref implies $expected, spec declares $declared" + fi + log "Specification version $(python3 -c "import yaml;print(yaml.safe_load(open('$SPEC_FILE'))['info']['version'])")" +} + +# Remove everything .sdkgen.yaml declares generated, so a removed operation leaves no orphan. +zone_wipe() { + python3 - <<'PY' +import pathlib, shutil, yaml +doc = yaml.safe_load(open(".sdkgen.yaml")) +root = pathlib.Path(".") +n = 0 +for glob in doc["generated_paths"]: + for path in sorted(root.glob(glob), reverse=True): + if path.is_file(): + path.unlink(); n += 1 + elif path.is_dir(): + shutil.rmtree(path, ignore_errors=True) +print(f" removed {n} file(s)") +PY +} + +have_java() { command -v java >/dev/null 2>&1 && java -version >/dev/null 2>&1; } + +# run_generator +# MUST be relative to the repository root: the docker backend mounts the repo at +# /local, so an absolute path outside it lands inside the repository instead. +run_generator() { + local gen="$1" config="$2" out="$3" + case "$out" in + /*) die "run_generator: output must be repo-relative, got $out" ;; + esac + local version; version="$(manifest_get 'generator.version')" + if have_java; then + local cache="${OPENAPI_GENERATOR_CACHE:-$HOME/.cache/openapi-generator}" + local jar="$cache/openapi-generator-cli-$version.jar" + if [ ! -f "$jar" ]; then + mkdir -p "$cache" + curl -fsSL -o "$jar" \ + "https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/$version/openapi-generator-cli-$version.jar" + fi + java -jar "$jar" generate -i "$SPEC_FILE" -g "$gen" -o "$out" -c "$config" --skip-validate-spec + elif command -v docker >/dev/null 2>&1; then + docker run --rm -v "$REPO_ROOT":/local -w /local \ + "openapitools/openapi-generator-cli:v$version" \ + generate -i "/local/$(basename "$SPEC_FILE")" -g "$gen" -o "/local/$out" \ + -c "/local/$config" --skip-validate-spec + else + die "need a working java (JDK) or docker to run openapi-generator" + fi +} + +# Reads the current version through the manifest pattern. Non-zero exit when unavailable. +read_version() { + python3 - <<'RV' +import re, yaml, pathlib +doc = yaml.safe_load(open(".sdkgen.yaml")) +vf = doc["version_file"] +path = pathlib.Path(vf["path"]) +if not path.is_file(): + raise SystemExit(1) +m = re.search(vf["pattern"], path.read_text()) +if not m or m.group("version") == "0.0.0": + raise SystemExit(1) +print(m.group("version")) +RV +} + +# apply_bump -> the next version per $BUMP +apply_bump() { + python3 - "$1" "$BUMP" <<'AB' +import sys +current, bump = sys.argv[1], sys.argv[2] +major, minor, patch = (int(x) for x in current.split(".")) +match bump: + case "major": major, minor, patch = major + 1, 0, 0 + case "minor": minor, patch = minor + 1, 0 + case "patch": patch += 1 + case "none": pass + case _: raise SystemExit(f"error: invalid BUMP={bump}") +print(f"{major}.{minor}.{patch}") +AB +} diff --git a/tools/openapi-config.json b/tools/openapi-config.json new file mode 100644 index 0000000..00fd7d4 --- /dev/null +++ b/tools/openapi-config.json @@ -0,0 +1,11 @@ +{ + "gemName": "flat_api", + "gemVersion": "1.0.0", + "moduleName": "FlatApi", + "library": "faraday", + "gemLicense": "Apache-2.0", + "gemHomepage": "https://github.com/FlatIO/api-client-ruby", + "gemAuthor": "Flat Team", + "gemAuthorEmail": "developers@flat.io", + "hideGenerationTimestamp": true +} diff --git a/tools/patches/20_errors.py b/tools/patches/20_errors.py new file mode 100644 index 0000000..9f62056 --- /dev/null +++ b/tools/patches/20_errors.py @@ -0,0 +1,349 @@ +#!/usr/bin/env python3 +"""Typed errors, retry and pagination for the Ruby SDK (FR-006d to FR-006h). Idempotent.""" + +from __future__ import annotations + +import pathlib +import sys + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +LIB = ROOT / "lib" / "flat_api" +LIB.mkdir(parents=True, exist_ok=True) + +(LIB / "errors.rb").write_text('''# frozen_string_literal: true + +# Typed errors for the Flat API. +# +# Rescue the error class, not the status code: rate limiting and authorization failures both return +# HTTP 403 and are separated only by the response body's +code+. +module FlatApi + RATE_LIMIT_CODE = 'API_RATE_LIMIT_EXCEEDED' + QUOTA_CODES = %w[QUOTA_EXCEEDED CREDITS_EXHAUSTED OMR_CREDITS_EXHAUSTED].freeze + + class FlatError < StandardError + attr_reader :status, :code, :request_id, :headers, :body + + def initialize(message, status: nil, code: nil, request_id: nil, headers: nil, body: nil) + super(message) + @status = status + @code = code + # Present only for internal and backend errors, so treat it as optional. + @request_id = request_id + @headers = headers || {} + @body = body + end + + def to_s + parts = [super] + parts << "code=#{code}" if code + parts << "status=#{status}" if status + parts << "id=#{request_id}" if request_id + parts.join(' ') + end + end + + # The token is missing, invalid or expired, or a refresh failed. Re-authorize. + class FlatAuthenticationError < FlatError; end + # Authenticated but not permitted: a missing scope or insufficient permission. + class FlatAuthorizationError < FlatError; end + # The request body or parameters failed validation. + class FlatValidationError < FlatError; end + # The resource does not exist, or is not visible to this token. + class FlatNotFoundError < FlatError; end + # A metered resource, such as OMR credits, is exhausted. + class FlatQuotaError < FlatError; end + # An internal or backend error. +request_id+ is normally set here. + class FlatServerError < FlatError; end + + # The account or IP exceeded its request quota. Returned as HTTP 403, not 429. + class FlatRateLimitError < FlatError + attr_reader :limit, :remaining, :reset + + def initialize(message, **kwargs) + super + @limit = int_header('X-RateLimit-Limit') + @remaining = int_header('X-RateLimit-Remaining') + # UTC epoch seconds at which the window resets. Flat sends no Retry-After header. + @reset = int_header('X-RateLimit-Reset') + end + + private + + def int_header(name) + pair = headers.find { |k, _| k.to_s.downcase == name.downcase } + pair && Integer(pair[1], exception: false) + end + end + + # Build the right error for a non-2xx response. + def self.error_from_response(status, body, headers = {}) + payload = body.is_a?(Hash) ? body : {} + code = payload['code'] || payload[:code] + message = payload['message'] || payload[:message] || "HTTP #{status}" + opts = { + status: status, code: code, request_id: payload['id'] || payload[:id], + headers: headers, body: body + } + + return FlatRateLimitError.new(message, **opts) if status == 403 && code == RATE_LIMIT_CODE + return FlatQuotaError.new(message, **opts) if QUOTA_CODES.include?(code) + return FlatAuthenticationError.new(message, **opts) if status == 401 + return FlatAuthorizationError.new(message, **opts) if status == 403 + return FlatNotFoundError.new(message, **opts) if status == 404 + return FlatValidationError.new(message, **opts) if [400, 422].include?(status) + return FlatServerError.new(message, **opts) if status >= 500 + + FlatError.new(message, **opts) + end +end +''') + +(LIB / "retry.rb").write_text('''# frozen_string_literal: true + +require 'flat_api/errors' + +# 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 is X-RateLimit-Reset, UTC epoch seconds +# * a plain 403 is a genuine authorization failure and must never be retried +module FlatApi + # Methods safe to replay. A non-idempotent request that may already have been applied is not. + IDEMPOTENT_METHODS = %w[GET HEAD OPTIONS PUT DELETE].freeze + MAX_RATE_LIMIT_WAIT = 300.0 + + class RetryPolicy + attr_reader :attempts, :backoff_base, :backoff_max, :jitter, :respect_rate_limit_reset + + def initialize(attempts: 3, backoff_base: 0.5, backoff_max: 30.0, jitter: 0.25, + respect_rate_limit_reset: true) + @attempts = attempts + @backoff_base = backoff_base + @backoff_max = backoff_max + @jitter = jitter + @respect_rate_limit_reset = respect_rate_limit_reset + end + + # No retries. Errors still arrive typed, and a rate-limit error still carries its reset. + def self.disabled + new(attempts: 1) + end + + def enabled? + attempts > 1 + end + + def should_retry?(error, method, attempt) + return false if attempt >= attempts + return false unless IDEMPOTENT_METHODS.include?(method.to_s.upcase) + return true if error.is_a?(FlatRateLimitError) + return true if error.is_a?(FlatServerError) + + # A transport failure before the request was sent is safe to replay. + error.is_a?(IOError) || error.is_a?(SystemCallError) + end + + def delay_for(error, attempt) + if respect_rate_limit_reset && error.is_a?(FlatRateLimitError) && error.reset + wait = error.reset - Time.now.to_i + return [wait + rand * jitter, MAX_RATE_LIMIT_WAIT].min if wait.positive? + end + exponential = [backoff_base * (2**(attempt - 1)), backoff_max].min + exponential + (rand * jitter * exponential) + end + end +end +''') + +(LIB / "pagination.rb").write_text('''# frozen_string_literal: true + +# Cursor pagination for the Flat API. +# +# Eight operations at v2.25.0 are cursor-paginated, identified by a +next+ query parameter. That +# 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 is not in the response body. It arrives in the Link header, which the specification +# does not declare, so it is parsed at runtime. +require 'uri' + +module FlatApi + module Pagination + LINK = /<([^>]+)>\\s*;\\s*rel="([^"]+)"/.freeze + + module_function + + # Parse an RFC 5988 Link header into { rel => url }. + def parse_link_header(value) + return {} if value.nil? || value.empty? + + value.scan(LINK).to_h { |url, rel| [rel, url] } + end + + # Extract the opaque +next+ cursor from a response's Link header, if any. + # + # Decoded, not captured raw. The cursor arrives percent-encoded inside the Link header's + # URL, and the client encodes whatever it is given when building the next request, so + # passing the encoded form through sends it encoded twice and the server rejects the very + # cursor it issued. URI.decode_www_form applies the rules the server used to write it, so + # an opaque value round-trips exactly. + def next_cursor(headers) + return nil if headers.nil? + + _, link = headers.find { |k, _| k.to_s.downcase == 'link' } + url = parse_link_header(link)['next'] + return nil if url.nil? + + query = begin + URI.parse(url).query + rescue URI::InvalidURIError + nil + end + return nil if query.nil? || query.empty? + + URI.decode_www_form(query).assoc('next')&.last + end + + # Every item across all pages of a cursor-paginated operation, as a lazy Enumerator. + # + # +fetch_page+ is called with a params hash and must return [data, status, headers], which is + # exactly what the generated *_with_http_info methods return. The cursor lives in the headers. + # + # 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. + # + # FlatApi::Pagination.paginate(user: 'me') do |params| + # api.get_user_scores_with_http_info('me', params) + # end.each { |score| puts score.title } + def paginate(**params, &fetch_page) + raise ArgumentError, 'paginate requires a block that fetches one page' unless fetch_page + + Enumerator.new do |yielder| + # +_next+, not +next+. `next` is a Ruby keyword, so the generator names the option + # +:_next+ and maps it back to the +next+ query parameter itself. Passing +:next+ here + # sends nothing: every iteration refetches page one, the loop guard below sees a cursor it + # has already used, and the traversal stops after the first page while looking successful. + cursor = params.delete(:_next) || params.delete(:next) + seen = {} + + loop do + page_params = cursor ? params.merge(_next: cursor) : params + data, _status, headers = fetch_page.call(page_params) + Array(data).each { |item| yielder << item } + + cursor = next_cursor(headers) + break if cursor.nil? + # A server that returns a cursor it already gave us would loop forever. + break if seen[cursor] + + seen[cursor] = true + end + end + end + end +end +''') + +# Writing errors.rb is not enough: nothing raises those classes unless the request path is taught +# to. The generated client raises its own ApiError, so a caller who follows the README and rescues +# FlatNotFoundError rescues nothing. Rewire the one raise site that carries a real HTTP status. +CLIENT = LIB / "api_client.rb" +client = CLIENT.read_text() + +generated = """ fail ApiError.new(code: response.status, + response_headers: response.headers, + response_body: response.body), + response.reason_phrase""" +flat = """ fail FlatApi.error_from_response( + response.status, + (begin + JSON.parse(response.body) + rescue StandardError + response.body + end), + response.headers || {} + )""" + +if generated not in client and "error_from_response" not in client: + sys.exit("20_errors: could not find the raise site in api_client.rb (FR-025)") + +if generated in client: + client = client.replace(generated, flat, 1) + +# errors.rb is required from flat_api.rb before api_client, so no extra require is needed here, +# but JSON is: the generated client parses bodies elsewhere through its own deserializer. +if "require 'json'" not in client: + client = client.replace("require 'time'\n", "require 'time'\nrequire 'json'\n", 1) + +# Nothing called RetryPolicy. It was defined, documented and advertised in the README, and every +# request went straight past it: the first 403 from a rate limit, or the first 502, reached the +# caller as a failure. Wrap the single request path rather than each of the 127 generated methods. +generated_entry = " def call_api(http_method, path, opts = {})" +retried_entry = " def call_api_once(http_method, path, opts = {})" +# A marker, not the presence of call_api: after patching, call_api is the wrapper, so a test on +# the entry point alone re-wraps the wrapper on every run. Re-applied twice that produced a +# call_api_once that called itself. check_idempotency.sh is what caught it. +RETRY_MARKER = "# BEGIN retry wrapper (tools/patches/20_errors.py)" + +if generated_entry not in client and RETRY_MARKER not in client: + sys.exit("20_errors: could not find call_api in api_client.rb (FR-025)") + +if RETRY_MARKER not in client: + client = client.replace(generated_entry, retried_entry, 1) + wrapper = """ # BEGIN retry wrapper (tools/patches/20_errors.py) + # Every request goes through the retry policy, which is why it wraps call_api_once rather + # than living in each of the generated methods. The decision needs the typed error and not the + # status code: Flat returns 403 both for rate limiting and for a genuine authorization failure, + # and only the response body's +code+ separates them. See RetryPolicy. + def call_api(http_method, path, opts = {}) + policy = @config.retry_policy || RetryPolicy.disabled + attempt = 0 + + begin + attempt += 1 + call_api_once(http_method, path, opts) + rescue StandardError => e + raise unless policy.should_retry?(e, http_method, attempt) + + sleep(policy.delay_for(e, attempt)) + retry + end + end + # END retry wrapper (tools/patches/20_errors.py) + +""" + client = client.replace(retried_entry, wrapper + retried_entry, 1) + +CLIENT.write_text(client) + +# RetryPolicy has to be reachable from configuration, or it cannot be turned off or tuned. +CONFIG = LIB / "configuration.rb" +config_src = CONFIG.read_text() +config_anchor = " attr_accessor :timeout\n" +if "retry_policy" not in config_src: + if config_anchor not in config_src: + sys.exit("20_errors: could not find the timeout accessor in configuration.rb (FR-025)") + config_src = config_src.replace( + config_anchor, + config_anchor + + """ + # The retry policy applied to every request. Set RetryPolicy.disabled to turn retries off; + # errors still arrive typed and a rate-limit error still carries its reset. + attr_accessor :retry_policy +""", + 1, + ) + # Default it in the constructor, next to the other defaults. + ctor_anchor = " @timeout = " + if ctor_anchor in config_src: + line_end = config_src.index("\n", config_src.index(ctor_anchor)) + 1 + config_src = ( + config_src[:line_end] + " @retry_policy = RetryPolicy.new\n" + config_src[line_end:] + ) + else: + sys.exit("20_errors: could not find the timeout default in configuration.rb (FR-025)") + CONFIG.write_text(config_src) + +print(" errors: wrote errors.rb, retry.rb, pagination.rb, raised typed errors and applied the retry policy in api_client.rb") diff --git a/tools/patches/30_client.py b/tools/patches/30_client.py new file mode 100755 index 0000000..99cff49 --- /dev/null +++ b/tools/patches/30_client.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 +"""A single entry point for the Ruby SDK (FR-006c). Idempotent. + +The generator emits ten *Api classes and no facade, so the README's first example, and every +caller who follows it, needed to know which class owns an operation before making one call. This +writes FlatClient, which holds the ApiClient, exposes each generated API by a short name, and +traverses a cursor-paginated operation without the caller ever seeing a cursor. +""" + +from __future__ import annotations + +import pathlib +import re +import sys + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +LIB = ROOT / "lib" / "flat_api" + +# Short name to generated class. Checked against what the generator actually emitted rather than +# trusted: the class name does not always follow the file name (omr_api.rb declares OMRApi), and a +# wrong entry here is a NameError raised only on the call that happens to reach it. +SHORT_NAMES = { + "account": "AccountApi", + "classes": "ClassApi", + "collections": "CollectionApi", + "edu_resources": "EduResourcesApi", + "groups": "GroupApi", + "omr": "OMRApi", + "organization": "OrganizationApi", + "scores": "ScoreApi", + "tasks": "TaskApi", + "users": "UserApi", +} + +emitted = { + match.group(1) + for path in sorted((LIB / "api").glob("*.rb")) + for match in re.finditer(r"^\s*class (\w+Api)\b", path.read_text(), re.M) +} +if not emitted: + sys.exit("30_client: no generated *Api classes found (FR-025)") + +unknown = sorted(set(SHORT_NAMES.values()) - emitted) +missing = sorted(emitted - set(SHORT_NAMES.values())) +if unknown: + sys.exit(f"30_client: SHORT_NAMES names classes the generator did not emit: {', '.join(unknown)}") +if missing: + sys.exit(f"30_client: the generator emitted APIs with no short name: {', '.join(missing)}") + +APIS_RUBY = "\n".join( + f" {short}: '{klass}'," for short, klass in SHORT_NAMES.items() +).rstrip(",") + +(LIB / "client.rb").write_text('''# frozen_string_literal: true + +module FlatApi + # One object to start from. + # + # client = FlatApi::FlatClient.new(access_token: 'YOUR_TOKEN') + # client.account.get_authenticated_user + # client.paginate(:list_collections, parent: 'user').each { |c| puts c.title } + # + # It owns one ApiClient, so every API reached through it shares a connection and a + # configuration. Constructing the generated classes directly still works and is equivalent. + class FlatClient + # Short name to generated class. The order matters: paginate resolves an operation by asking + # each API in turn, and two of them define get_user_scores, so scores wins over users. + APIS = { +__APIS__ + }.freeze + + attr_reader :api_client, :config + + # +config+ defaults to a fresh Configuration rather than Configuration.default: a client built + # with its own token must not overwrite the token every other client is using. + def initialize(access_token: nil, config: nil, retry_policy: nil) + @config = config || Configuration.new + @config.access_token = access_token unless access_token.nil? + @config.retry_policy = retry_policy unless retry_policy.nil? + @api_client = ApiClient.new(@config) + @apis = {} + end + + APIS.each_key { |name| define_method(name) { api(name) } } + + # One generated API by short name, memoised. + def api(name) + klass = APIS[name.to_sym] + raise ArgumentError, "unknown API #{name}, expected one of: #{APIS.keys.join(', ')}" if klass.nil? + + @apis[name.to_sym] ||= FlatApi.const_get(klass).new(@api_client) + end + + # Every item across every page of a cursor-paginated operation, as a lazy Enumerator. + # Positional arguments are the operation's path parameters; keywords are its query parameters. + # + # client.paginate(:list_collections, parent: 'user').each { |c| puts c.title } + # client.paginate(:get_user_scores, 'me') { |score| puts score.title } + # + # An operation that does not paginate yields its single page, so this is always safe to use. + def paginate(operation, *args, **params, &block) + method = "#{operation}_with_http_info" + owner = APIS.keys.find { |name| api(name).respond_to?(method) } + raise ArgumentError, "no operation #{operation} on any Flat API" if owner.nil? + + target = api(owner) + enum = Pagination.paginate(**params) do |page_params| + target.public_send(method, *args, page_params) + end + block ? enum.each(&block) : enum + end + end +end +'''.replace("__APIS__", APIS_RUBY)) + +print(" client: wrote client.rb (FlatClient over the 10 generated APIs)") diff --git a/tools/patches/50_oauth.py b/tools/patches/50_oauth.py new file mode 100644 index 0000000..ba1fa22 --- /dev/null +++ b/tools/patches/50_oauth.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python3 +"""OAuth2 helpers and single-flight refresh for the Ruby SDK (FR-006i to FR-006l). Idempotent.""" + +from __future__ import annotations + +import pathlib + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +LIB = ROOT / "lib" / "flat_api" +LIB.mkdir(parents=True, exist_ok=True) + +(LIB / "oauth.rb").write_text('''# frozen_string_literal: true + +require 'json' +require 'net/http' +require 'uri' +require 'flat_api/errors' + +# OAuth2 support for the Flat API. +# +# The public specification declares one security scheme: OAuth2 authorization-code with 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 refreshed tokens go to a +# callback you supply. +module FlatApi + AUTHORIZE_URL = 'https://flat.io/auth/oauth' + TOKEN_URL = 'https://api.flat.io/oauth/access_token' + # Refresh slightly before nominal expiry, to avoid racing the server clock. + EXPIRY_SKEW = 30 + + Tokens = Struct.new(:access_token, :refresh_token, :expires_at, keyword_init: true) do + def self.from_response(payload) + expires_in = payload['expires_in'] + new( + access_token: payload['access_token'], + refresh_token: payload['refresh_token'], + expires_at: expires_in ? Time.now.to_i + expires_in.to_i : nil + ) + end + + def expired? + !expires_at.nil? && Time.now.to_i >= expires_at - EXPIRY_SKEW + end + end + + # Builds the authorization URL and exchanges codes for tokens. + class OAuth2Helper + def initialize(client_id:, client_secret:, redirect_uri:) + @client_id = client_id + @client_secret = client_secret + @redirect_uri = redirect_uri + end + + # URL to send a user to. +offline+ is what yields a refresh token. + def authorize_url(scopes:, state:, offline: true) + params = { + client_id: @client_id, redirect_uri: @redirect_uri, response_type: 'code', + scope: Array(scopes).join(' '), state: state + } + params[:access_type] = 'offline' if offline + "#{AUTHORIZE_URL}?#{URI.encode_www_form(params)}" + end + + def exchange_code(code) + token_request(grant_type: 'authorization_code', code: code, redirect_uri: @redirect_uri) + end + + def refresh(refresh_token) + token_request(grant_type: 'refresh_token', refresh_token: refresh_token) + end + + private + + def token_request(**payload) + response = Net::HTTP.post_form( + URI(TOKEN_URL), payload.merge(client_id: @client_id, client_secret: @client_secret) + ) + unless response.is_a?(Net::HTTPSuccess) + raise FlatAuthenticationError.new( + 'OAuth2 token request failed; the user must re-authorize', status: response.code.to_i + ) + end + + Tokens.from_response(JSON.parse(response.body)) + end + end + + # 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. + class TokenManager + def initialize(tokens, helper: nil, on_token_refresh: nil) + @tokens = tokens + @helper = helper + @on_token_refresh = on_token_refresh + @mutex = Mutex.new + end + + # Refreshes when the token has expired, which is the whole point of a TokenManager: a caller + # installs this as Configuration#access_token_getter and never thinks about expiry again. + # Returning @tokens.access_token unconditionally made Tokens#expired? dead code, and every + # request after the expiry failed with a 401 that a refresh would have avoided. + def access_token + return @tokens.access_token unless @tokens.expired? + + @mutex.synchronize do + # Checked again inside the lock: a thread that waited here may find the token already + # refreshed, and refreshing twice would spend a second round trip and, with a provider + # that rotates refresh tokens, invalidate the one the first thread just stored. + next @tokens.access_token unless @tokens.expired? + + refresh_locked + end + end + + # Refreshes unconditionally. Use it to force a refresh; access_token already handles expiry. + def refresh + @mutex.synchronize { refresh_locked } + end + + private + + def refresh_locked + if @helper.nil? || @tokens.refresh_token.nil? + raise FlatAuthenticationError, + 'the access token expired and no refresh token is available; re-authorize' + end + + @tokens = @helper.refresh(@tokens.refresh_token) + @on_token_refresh&.call(@tokens) + @tokens.access_token + end + end +end +''') +print(" ruby: oauth.rb") diff --git a/tools/patches/70_docs.py b/tools/patches/70_docs.py new file mode 100644 index 0000000..0aa5e92 --- /dev/null +++ b/tools/patches/70_docs.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +"""Verify the generated Ruby code carries the specification's documentation (FR-004). + +Ruby uses leading `#` comment lines rather than block comments, so this counts the contiguous +comment block immediately above each public operation. + +Idempotent: it inspects and reports, it does not rewrite. +""" + +from __future__ import annotations + +import pathlib +import re +import sys + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +API_DIR = ROOT / "lib" / "flat_api" / "api" + +THRESHOLD = 0.95 +OPERATION = re.compile(r"^ def ([a-z0-9_]+)\(", re.M) + + +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("*.rb")): + lines = path.read_text().splitlines() + for index, line in enumerate(lines): + match = OPERATION.match(line) + name = match.group(1) if match else "" + # initialize is the constructor, not an API operation. + if not match or name.endswith("_with_http_info") or name == "initialize": + continue + total += 1 + # Walk back over the contiguous comment block directly above the definition. + comment: list[str] = [] + cursor = index - 1 + while cursor >= 0 and lines[cursor].strip().startswith("#"): + comment.append(lines[cursor].strip().lstrip("#").strip()) + cursor -= 1 + if len(" ".join(comment)) > 20: + documented += 1 + else: + undocumented.append(f"{path.name}:{match.group(1)}") + + 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..f61c8d8 --- /dev/null +++ b/tools/patches/80_user_agent.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +"""Flat-branded User-Agent that tracks the gem version. Idempotent.""" + +from __future__ import annotations + +import pathlib +import re +import sys + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +TARGET = ROOT / "lib" / "flat_api" / "api_client.rb" + +text = TARGET.read_text() +pattern = re.compile(r'@user_agent = "[^"]*"') +if not pattern.search(text): + sys.exit("80_user_agent: could not find the @user_agent assignment (FR-025)") + +# VERSION already tracks the gem version, so this cannot drift. +text = pattern.sub( + '@user_agent = "Flat-SDK-Ruby/#{FlatApi::VERSION} (ruby/#{RUBY_VERSION})"', + text, + count=1, +) +TARGET.write_text(text) +print(" user-agent: Flat-SDK-Ruby/") diff --git a/tools/patches/95_requires.py b/tools/patches/95_requires.py new file mode 100755 index 0000000..41e0b0a --- /dev/null +++ b/tools/patches/95_requires.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +"""Require the hand-written modules from the gem entrypoint (FR-025). + +The patches write errors.rb, retry.rb, pagination.rb and oauth.rb, and the generator's own +lib/flat_api.rb knows nothing about them. So `require 'flat_api'` loaded the generated client and +none of the surface built on top of it: FlatNotFoundError and the other typed errors, the retry +policy that understands Flat's 403 rate limiting, the Link-header pagination helper, and +OAuth2Helper. A caller following the README got `uninitialized constant FlatApi::FlatNotFoundError`. + +Worse once the errors patch rewired api_client.rb, which calls FlatApi.error_from_response: without +the require that raises NameError at the moment an API error is being reported, replacing a useful +message with a confusing one. + +Idempotent: inserts each require once, in a marked block, and rebuilds it on every run. +""" + +from __future__ import annotations + +import pathlib +import sys + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +ENTRY = ROOT / "lib" / "flat_api.rb" + +BEGIN = "# BEGIN generated by tools/patches/95_requires.py" +END = "# END generated by tools/patches/95_requires.py" + +# Order matters: errors is required before api_client, which raises from it. client comes last, +# since FlatClient names ApiClient, Configuration, Pagination and every generated *Api class. +MODULES = ["errors", "retry", "pagination", "oauth", "client"] + +if not ENTRY.is_file(): + sys.exit("95_requires: lib/flat_api.rb is missing (FR-025)") + +text = ENTRY.read_text() + +# Drop any previous block, so this rebuilds rather than appends. +if BEGIN in text: + head, rest = text.split(BEGIN, 1) + text = head + rest.split(END, 1)[1].lstrip("\n") + +missing = [m for m in MODULES if not (ROOT / "lib" / "flat_api" / f"{m}.rb").is_file()] +if missing: + sys.exit(f"95_requires: patches did not write {', '.join(missing)} (FR-025)") + +anchor = "require 'flat_api/api_client'\n" +if anchor not in text: + sys.exit("95_requires: could not find the api_client require to anchor to (FR-025)") + +block = "\n".join( + [ + BEGIN, + "# The ergonomic surface the patches add. errors comes first: api_client raises from it.", + *[f"require 'flat_api/{m}'" for m in MODULES], + END, + "", + ] +) +ENTRY.write_text(text.replace(anchor, block + anchor, 1)) +print(f" requires: {', '.join(MODULES)} wired into lib/flat_api.rb") diff --git a/tools/patches/__pycache__/20_errors.cpython-314.pyc b/tools/patches/__pycache__/20_errors.cpython-314.pyc new file mode 100644 index 0000000..b3609b9 Binary files /dev/null and b/tools/patches/__pycache__/20_errors.cpython-314.pyc differ diff --git a/tools/smoke.rb b/tools/smoke.rb new file mode 100644 index 0000000..f266954 --- /dev/null +++ b/tools/smoke.rb @@ -0,0 +1,229 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# Ruby smoke entrypoint (FR-016). +# +# Drives the shared scenarios against production. Score lifecycle only: no OMR conversion, nothing +# metered (FR-016a). +# +# Any account can run this, so a contributor can point it at their own. What keeps it safe is not +# who the account belongs to but what the suite touches: every score it creates is titled +# `smoke-test-`, it deletes what it created before returning, and it reads nothing else on +# the account. +# +# Never prints a response body, token or account identifier (FR-016d). + +$LOAD_PATH.unshift(File.expand_path('../lib', __dir__)) + +require 'securerandom' +require 'yaml' +require 'flat_api' + +REDACT = ENV['FLAT_SMOKE_REDACT'] == '1' +TITLE_PREFIX = 'smoke-test' + +def redact(text) + REDACT ? '' : text +end + +$failures = [] + +def check(name, condition, detail = '') + if condition + puts " #{name} ... ok" + else + puts " #{name} ... FAIL" + $failures << (detail.empty? ? name : "#{name}: #{detail}") + end +end + +scenarios_path = ARGV[0] or abort 'usage: smoke.rb ' +scenarios = YAML.safe_load_file(scenarios_path) + +forbidden = scenarios.fetch('forbidden_operations', []) +scenarios.fetch('scenarios', []).each do |scenario| + next unless forbidden.include?(scenario['operation']) + + abort "refusing to run #{scenario['id']}: #{scenario['operation']} is metered" +end + +token = ENV['FLAT_TEST_TOKEN'] or abort 'FLAT_TEST_TOKEN is required' + +fixture = File.join(File.dirname(scenarios_path), 'fixtures', 'minimal.musicxml') +abort "missing fixture: #{fixture}" unless File.file?(fixture) + +# Through FlatClient, deliberately: it is the entry point the README and QUICKSTART document, so +# the path a new user takes is the path this suite proves. Building the *Api classes directly is +# equivalent and also supported, but it is not what the docs tell people to do. +client = FlatApi::FlatClient.new(access_token: token) + +account = client.account +scores = client.scores +collections = client.collections + +created = [] +created_collections = [] + +begin + # The token authenticates and identifies an account. + me = account.get_authenticated_user + check('whoami', !me.id.nil?, 'no id on the authenticated user') + + # Create a score from MusicXML, the most common write path. + title = "#{TITLE_PREFIX}-#{SecureRandom.hex(4)}" + # ScoreCreation is a oneOf, which this generator emits as a module rather than a class, so the + # variant goes to create_score directly. Attributes are snake_case here, unlike the wire. + score = scores.create_score( + FlatApi::ScoreCreationFileImport.new( + title: title, + privacy: 'private', + filename: 'minimal.musicxml', + # base64 is the only encoding the API declares. pack('m0') rather than Base64: base64 became + # a bundled gem in Ruby 3.4, and bundler excludes bundled gems absent from the Gemfile, so + # requiring it raises LoadError under bundle exec on 3.4 while working fine on 3.3. + data: [File.binread(fixture)].pack('m0'), + data_encoding: 'base64' + ) + ) + # Registered before anything else can fail, so the ensure block always reclaims it. + created << score.id if score.respond_to?(:id) && score.id + check('create-score', !created.empty?, 'no id on the created score') + raise 'create-score returned no id' if created.empty? + + score_id = created.first + + # Read it back. + fetched = scores.get_score(score_id) + check('read-score', fetched.id == score_id, 'the score read back is not the one created') + + # Rename it, exercising a PUT path. + renamed = "#{title}-renamed" + updated = scores.edit_score(score_id, { 'title' => renamed }) + check('update-score-metadata', updated.title == renamed, 'the title did not change') + + # Export to MusicXML, exercising a binary response. + exported = scores.get_score_revision_data(score_id, 'last', 'mxl') + check('export-score', !exported.nil?, 'the export returned nothing') + + # Traverse across a real page boundary. This is the only check that proves the Link-header cursor + # works end to end, and it has to force more than one page to prove anything: an earlier version + # asked for ten items on an account holding fewer, so it never requested a second page and passed + # for a year while paginate sent the cursor under the wrong parameter name and silently returned + # page one forever. + # + # listCollections rather than getUserScores: the latter returns only public scores, and the score + # this run creates is private. + 3.times do |index| + collection = collections.create_collection( + FlatApi::CollectionCreation.new(title: "#{title}-collection-#{index}", privacy: 'private') + ) + created_collections << collection.id if collection.respond_to?(:id) && collection.id + end + check('create-collections', created_collections.length == 3, 'could not create three collections') + + # limit: 1 forces one request per item, so the traversal cannot succeed without following the + # cursor. Every id we created must come back exactly once. + seen = client.paginate(:list_collections, parent: 'user', limit: 1).map do |item| + item.respond_to?(:id) ? item.id : nil + end + missing = created_collections - seen + duplicated = seen.compact.tally.select { |_, count| count > 1 }.keys + check('paginate-across-pages', + seen.length > 1 && missing.empty? && duplicated.empty?, + "pages=#{seen.length} missing=#{missing.length} duplicated=#{duplicated.length}") + + # A missing score raises the typed error, not a generic failure. This is what makes the SDK + # usable under failure rather than merely correct under success. + begin + scores.get_score('000000000000000000000000') + check('typed-not-found', false, 'no error raised for a missing score') + rescue FlatApi::FlatNotFoundError + check('typed-not-found', true) + rescue StandardError => e + check('typed-not-found', false, "raised #{e.class}, not FlatNotFoundError") + end + + # An invalid token raises the typed authentication error. + begin + # A fresh Configuration, not ApiClient.new: that one shares Configuration.default, so setting + # a bad token on it would replace the real one for every later call, including the cleanup. + bad_config = FlatApi::Configuration.new + bad_config.access_token = 'invalid' + FlatApi::AccountApi.new(FlatApi::ApiClient.new(bad_config)).get_authenticated_user + check('typed-auth-error', false, 'no error raised for an invalid token') + rescue FlatApi::FlatAuthenticationError + check('typed-auth-error', true) + rescue StandardError => e + check('typed-auth-error', false, "raised #{e.class}, not FlatAuthenticationError") + end + # The retry policy is wired into the request path, not merely defined. It was defined, + # documented and never called once: every request went straight past it, so the first 403 from a + # rate limit reached the caller as a failure. Nothing in a build catches that, because the file + # exists and the class is correct. + # + # A real throttle cannot be induced without hammering production, so this checks the two things + # that were actually wrong: the wrapper is installed, and the policy says to retry the errors + # Flat uses for throttling and server failures. + wrapped = FlatApi::ApiClient.instance_methods.include?(:call_api_once) + policy = client.config.retry_policy + retries_throttle = policy.should_retry?(FlatApi::FlatRateLimitError.new('x'), 'GET', 1) + retries_5xx = policy.should_retry?(FlatApi::FlatServerError.new('x'), 'GET', 1) + # A plain 403 is a genuine authorization failure. Retrying it would be worse than not retrying. + keeps_403 = !policy.should_retry?(FlatApi::FlatAuthorizationError.new('x'), 'GET', 1) + # A POST may already have been applied, so it must not be replayed. + keeps_post = !policy.should_retry?(FlatApi::FlatServerError.new('x'), 'POST', 1) + check('retry-policy-applied', + wrapped && retries_throttle && retries_5xx && keeps_403 && keeps_post, + "wrapped=#{wrapped} throttle=#{retries_throttle} 5xx=#{retries_5xx} " \ + "keeps403=#{keeps_403} keepsPost=#{keeps_post}") + + # An expired token refreshes itself. TokenManager#access_token used to return the expired token + # unconditionally, which made Tokens#expired? dead code: every request after the expiry failed + # with a 401 that a refresh would have avoided. No network here; the helper is a stub. + refreshes = Struct.new(:calls) do + def refresh(_refresh_token) + self.calls += 1 + FlatApi::Tokens.new(access_token: 'refreshed', refresh_token: 'r', expires_at: Time.now.to_i + 3600) + end + end.new(0) + manager = FlatApi::TokenManager.new( + FlatApi::Tokens.new(access_token: 'stale', refresh_token: 'r', expires_at: Time.now.to_i - 60), + helper: refreshes + ) + first = manager.access_token + second = manager.access_token + check('oauth-refreshes-on-expiry', + first == 'refreshed' && second == 'refreshed' && refreshes.calls == 1, + "token=#{first.inspect} refreshes=#{refreshes.calls} (expected one refresh, then cached)") + +rescue FlatApi::FlatError => e + # The class, status and code, never the message: the message can quote a request body, and this + # runs with redaction on precisely so a failure does not become a disclosure. Those three are + # enough to say what went wrong, which a bare "" is not. + $failures << "unhandled #{e.class} status=#{e.status} code=#{e.code}" +rescue StandardError => e + $failures << "unhandled #{e.class}: #{redact(e.message)}" +ensure + # Delete what this run created, whatever happened above. Residue that survives is reported rather + # than swallowed, so cleanup.py can reclaim it and a maintainer knows to look. + created.each do |id| + scores.delete_score(id) + puts " cleanup score #{redact(id)} ... deleted" + rescue StandardError => e + $failures << "cleanup failed for score #{redact(id)}: #{e.class}" + end + + created_collections.each do |id| + collections.delete_collection(id) + puts " cleanup collection #{redact(id)} ... deleted" + rescue StandardError => e + $failures << "cleanup failed for collection #{redact(id)}: #{e.class}" + end +end + +if $failures.any? + $failures.each { |failure| warn " FAIL #{failure}" } + exit 1 +end + +puts 'smoke: PASS'