flat_api 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +7 -0
- data/README.md +248 -0
- data/Rakefile +8 -0
- data/docs/AccountApi.md +55 -0
- data/docs/Assignment.md +18 -0
- data/docs/AssignmentCopy.md +8 -0
- data/docs/AssignmentCreation.md +12 -0
- data/docs/AssignmentSubmission.md +19 -0
- data/docs/AssignmentSubmissionUpdate.md +11 -0
- data/docs/ClassApi.md +1051 -0
- data/docs/ClassAttachmentCreation.md +10 -0
- data/docs/ClassCreation.md +9 -0
- data/docs/ClassDetails.md +25 -0
- data/docs/ClassDetailsCanvas.md +9 -0
- data/docs/ClassDetailsClever.md +14 -0
- data/docs/ClassDetailsGoogleClassroom.md +11 -0
- data/docs/ClassDetailsGoogleDrive.md +9 -0
- data/docs/ClassDetailsLti.md +10 -0
- data/docs/ClassRoles.md +7 -0
- data/docs/ClassState.md +7 -0
- data/docs/ClassUpdate.md +9 -0
- data/docs/FlatErrorResponse.md +11 -0
- data/docs/FlatLocales.md +7 -0
- data/docs/GoogleClassroomCoursework.md +10 -0
- data/docs/GoogleClassroomSubmission.md +10 -0
- data/docs/Group.md +14 -0
- data/docs/GroupApi.md +167 -0
- data/docs/GroupDetails.md +14 -0
- data/docs/GroupType.md +7 -0
- data/docs/LicenseMode.md +7 -0
- data/docs/LicenseSources.md +7 -0
- data/docs/LmsName.md +7 -0
- data/docs/LtiCredentials.md +16 -0
- data/docs/LtiCredentialsCreation.md +9 -0
- data/docs/MediaAttachment.md +23 -0
- data/docs/MediaScoreSharingMode.md +7 -0
- data/docs/OrganizationApi.md +538 -0
- data/docs/OrganizationInvitation.md +14 -0
- data/docs/OrganizationInvitationCreation.md +9 -0
- data/docs/OrganizationRoles.md +7 -0
- data/docs/ScoreApi.md +1605 -0
- data/docs/ScoreCollaborator.md +15 -0
- data/docs/ScoreCollaboratorCreation.md +13 -0
- data/docs/ScoreComment.md +22 -0
- data/docs/ScoreCommentContext.md +14 -0
- data/docs/ScoreCommentCreation.md +13 -0
- data/docs/ScoreCommentUpdate.md +11 -0
- data/docs/ScoreCommentsCounts.md +11 -0
- data/docs/ScoreCreation.md +13 -0
- data/docs/ScoreCreationType.md +7 -0
- data/docs/ScoreData.md +7 -0
- data/docs/ScoreDataEncoding.md +7 -0
- data/docs/ScoreDetails.md +36 -0
- data/docs/ScoreFork.md +7 -0
- data/docs/ScoreLicense.md +7 -0
- data/docs/ScoreLikesCounts.md +10 -0
- data/docs/ScoreModification.md +13 -0
- data/docs/ScorePrivacy.md +7 -0
- data/docs/ScoreRevision.md +14 -0
- data/docs/ScoreRevisionCreation.md +11 -0
- data/docs/ScoreRevisionStatistics.md +9 -0
- data/docs/ScoreRights.md +9 -0
- data/docs/ScoreSource.md +8 -0
- data/docs/ScoreSummary.md +13 -0
- data/docs/ScoreTrack.md +19 -0
- data/docs/ScoreTrackCreation.md +12 -0
- data/docs/ScoreTrackPoint.md +10 -0
- data/docs/ScoreTrackState.md +7 -0
- data/docs/ScoreTrackType.md +7 -0
- data/docs/ScoreTrackUpdate.md +11 -0
- data/docs/ScoreViewsCounts.md +10 -0
- data/docs/UserAdminUpdate.md +9 -0
- data/docs/UserApi.md +173 -0
- data/docs/UserBasics.md +13 -0
- data/docs/UserCreation.md +11 -0
- data/docs/UserDetails.md +28 -0
- data/docs/UserDetailsAdmin.md +20 -0
- data/docs/UserDetailsAdminLicense.md +12 -0
- data/docs/UserInstruments.md +7 -0
- data/docs/UserPublic.md +25 -0
- data/docs/UserPublicSummary.md +17 -0
- data/flat_api.gemspec +48 -0
- data/git_push.sh +55 -0
- data/lib/flat_api.rb +117 -0
- data/lib/flat_api/api/account_api.rb +72 -0
- data/lib/flat_api/api/class_api.rb +1148 -0
- data/lib/flat_api/api/group_api.rb +191 -0
- data/lib/flat_api/api/organization_api.rb +599 -0
- data/lib/flat_api/api/score_api.rb +1737 -0
- data/lib/flat_api/api/user_api.rb +194 -0
- data/lib/flat_api/api_client.rb +389 -0
- data/lib/flat_api/api_error.rb +38 -0
- data/lib/flat_api/configuration.rb +209 -0
- data/lib/flat_api/models/assignment.rb +323 -0
- data/lib/flat_api/models/assignment_copy.rb +194 -0
- data/lib/flat_api/models/assignment_creation.rb +230 -0
- data/lib/flat_api/models/assignment_submission.rb +299 -0
- data/lib/flat_api/models/assignment_submission_update.rb +220 -0
- data/lib/flat_api/models/class_attachment_creation.rb +242 -0
- data/lib/flat_api/models/class_creation.rb +239 -0
- data/lib/flat_api/models/class_details.rb +351 -0
- data/lib/flat_api/models/class_details_canvas.rb +199 -0
- data/lib/flat_api/models/class_details_clever.rb +282 -0
- data/lib/flat_api/models/class_details_google_classroom.rb +219 -0
- data/lib/flat_api/models/class_details_google_drive.rb +199 -0
- data/lib/flat_api/models/class_details_lti.rb +209 -0
- data/lib/flat_api/models/class_roles.rb +22 -0
- data/lib/flat_api/models/class_state.rb +23 -0
- data/lib/flat_api/models/class_update.rb +231 -0
- data/lib/flat_api/models/flat_error_response.rb +219 -0
- data/lib/flat_api/models/flat_locales.rb +27 -0
- data/lib/flat_api/models/google_classroom_coursework.rb +209 -0
- data/lib/flat_api/models/google_classroom_submission.rb +209 -0
- data/lib/flat_api/models/group.rb +282 -0
- data/lib/flat_api/models/group_details.rb +248 -0
- data/lib/flat_api/models/group_type.rb +23 -0
- data/lib/flat_api/models/license_mode.rb +22 -0
- data/lib/flat_api/models/license_sources.rb +25 -0
- data/lib/flat_api/models/lms_name.rb +27 -0
- data/lib/flat_api/models/lti_credentials.rb +268 -0
- data/lib/flat_api/models/lti_credentials_creation.rb +227 -0
- data/lib/flat_api/models/media_attachment.rb +371 -0
- data/lib/flat_api/models/media_score_sharing_mode.rb +23 -0
- data/lib/flat_api/models/organization_invitation.rb +248 -0
- data/lib/flat_api/models/organization_invitation_creation.rb +198 -0
- data/lib/flat_api/models/organization_roles.rb +24 -0
- data/lib/flat_api/models/score_collaborator.rb +263 -0
- data/lib/flat_api/models/score_collaborator_creation.rb +245 -0
- data/lib/flat_api/models/score_comment.rb +363 -0
- data/lib/flat_api/models/score_comment_context.rb +282 -0
- data/lib/flat_api/models/score_comment_creation.rb +245 -0
- data/lib/flat_api/models/score_comment_update.rb +268 -0
- data/lib/flat_api/models/score_comments_counts.rb +219 -0
- data/lib/flat_api/models/score_creation.rb +240 -0
- data/lib/flat_api/models/score_creation_type.rb +23 -0
- data/lib/flat_api/models/score_data.rb +179 -0
- data/lib/flat_api/models/score_data_encoding.rb +21 -0
- data/lib/flat_api/models/score_details.rb +467 -0
- data/lib/flat_api/models/score_fork.rb +179 -0
- data/lib/flat_api/models/score_license.rb +28 -0
- data/lib/flat_api/models/score_likes_counts.rb +209 -0
- data/lib/flat_api/models/score_modification.rb +270 -0
- data/lib/flat_api/models/score_privacy.rb +24 -0
- data/lib/flat_api/models/score_revision.rb +249 -0
- data/lib/flat_api/models/score_revision_creation.rb +222 -0
- data/lib/flat_api/models/score_revision_statistics.rb +199 -0
- data/lib/flat_api/models/score_rights.rb +203 -0
- data/lib/flat_api/models/score_source.rb +189 -0
- data/lib/flat_api/models/score_summary.rb +237 -0
- data/lib/flat_api/models/score_track.rb +298 -0
- data/lib/flat_api/models/score_track_creation.rb +229 -0
- data/lib/flat_api/models/score_track_point.rb +252 -0
- data/lib/flat_api/models/score_track_state.rb +23 -0
- data/lib/flat_api/models/score_track_type.rb +24 -0
- data/lib/flat_api/models/score_track_update.rb +219 -0
- data/lib/flat_api/models/score_views_counts.rb +209 -0
- data/lib/flat_api/models/user_admin_update.rb +214 -0
- data/lib/flat_api/models/user_basics.rb +239 -0
- data/lib/flat_api/models/user_creation.rb +266 -0
- data/lib/flat_api/models/user_details.rb +418 -0
- data/lib/flat_api/models/user_details_admin.rb +306 -0
- data/lib/flat_api/models/user_details_admin_license.rb +227 -0
- data/lib/flat_api/models/user_instruments.rb +179 -0
- data/lib/flat_api/models/user_public.rb +356 -0
- data/lib/flat_api/models/user_public_summary.rb +277 -0
- data/lib/flat_api/version.rb +15 -0
- data/lib/swagger_client.rb +117 -0
- data/lib/swagger_client/api/account_api.rb +72 -0
- data/lib/swagger_client/api/class_api.rb +1148 -0
- data/lib/swagger_client/api/group_api.rb +191 -0
- data/lib/swagger_client/api/organization_api.rb +599 -0
- data/lib/swagger_client/api/score_api.rb +1737 -0
- data/lib/swagger_client/api/user_api.rb +194 -0
- data/lib/swagger_client/api_client.rb +389 -0
- data/lib/swagger_client/api_error.rb +38 -0
- data/lib/swagger_client/configuration.rb +209 -0
- data/lib/swagger_client/models/assignment.rb +323 -0
- data/lib/swagger_client/models/assignment_copy.rb +194 -0
- data/lib/swagger_client/models/assignment_creation.rb +230 -0
- data/lib/swagger_client/models/assignment_submission.rb +299 -0
- data/lib/swagger_client/models/assignment_submission_update.rb +220 -0
- data/lib/swagger_client/models/class_attachment_creation.rb +242 -0
- data/lib/swagger_client/models/class_creation.rb +239 -0
- data/lib/swagger_client/models/class_details.rb +351 -0
- data/lib/swagger_client/models/class_details_canvas.rb +199 -0
- data/lib/swagger_client/models/class_details_clever.rb +282 -0
- data/lib/swagger_client/models/class_details_google_classroom.rb +219 -0
- data/lib/swagger_client/models/class_details_google_drive.rb +199 -0
- data/lib/swagger_client/models/class_details_lti.rb +209 -0
- data/lib/swagger_client/models/class_roles.rb +22 -0
- data/lib/swagger_client/models/class_state.rb +23 -0
- data/lib/swagger_client/models/class_update.rb +231 -0
- data/lib/swagger_client/models/flat_error_response.rb +219 -0
- data/lib/swagger_client/models/flat_locales.rb +27 -0
- data/lib/swagger_client/models/google_classroom_coursework.rb +209 -0
- data/lib/swagger_client/models/google_classroom_submission.rb +209 -0
- data/lib/swagger_client/models/group.rb +282 -0
- data/lib/swagger_client/models/group_details.rb +248 -0
- data/lib/swagger_client/models/group_type.rb +23 -0
- data/lib/swagger_client/models/license_mode.rb +22 -0
- data/lib/swagger_client/models/license_sources.rb +25 -0
- data/lib/swagger_client/models/lms_name.rb +27 -0
- data/lib/swagger_client/models/lti_credentials.rb +268 -0
- data/lib/swagger_client/models/lti_credentials_creation.rb +227 -0
- data/lib/swagger_client/models/media_attachment.rb +371 -0
- data/lib/swagger_client/models/media_score_sharing_mode.rb +23 -0
- data/lib/swagger_client/models/organization_invitation.rb +248 -0
- data/lib/swagger_client/models/organization_invitation_creation.rb +198 -0
- data/lib/swagger_client/models/organization_roles.rb +24 -0
- data/lib/swagger_client/models/score_collaborator.rb +263 -0
- data/lib/swagger_client/models/score_collaborator_creation.rb +245 -0
- data/lib/swagger_client/models/score_comment.rb +363 -0
- data/lib/swagger_client/models/score_comment_context.rb +282 -0
- data/lib/swagger_client/models/score_comment_creation.rb +245 -0
- data/lib/swagger_client/models/score_comment_update.rb +268 -0
- data/lib/swagger_client/models/score_comments_counts.rb +219 -0
- data/lib/swagger_client/models/score_creation.rb +240 -0
- data/lib/swagger_client/models/score_creation_type.rb +23 -0
- data/lib/swagger_client/models/score_data.rb +179 -0
- data/lib/swagger_client/models/score_data_encoding.rb +21 -0
- data/lib/swagger_client/models/score_details.rb +467 -0
- data/lib/swagger_client/models/score_fork.rb +179 -0
- data/lib/swagger_client/models/score_license.rb +28 -0
- data/lib/swagger_client/models/score_likes_counts.rb +209 -0
- data/lib/swagger_client/models/score_modification.rb +270 -0
- data/lib/swagger_client/models/score_privacy.rb +24 -0
- data/lib/swagger_client/models/score_revision.rb +249 -0
- data/lib/swagger_client/models/score_revision_creation.rb +222 -0
- data/lib/swagger_client/models/score_revision_statistics.rb +199 -0
- data/lib/swagger_client/models/score_rights.rb +203 -0
- data/lib/swagger_client/models/score_source.rb +189 -0
- data/lib/swagger_client/models/score_summary.rb +237 -0
- data/lib/swagger_client/models/score_track.rb +298 -0
- data/lib/swagger_client/models/score_track_creation.rb +229 -0
- data/lib/swagger_client/models/score_track_point.rb +252 -0
- data/lib/swagger_client/models/score_track_state.rb +23 -0
- data/lib/swagger_client/models/score_track_type.rb +24 -0
- data/lib/swagger_client/models/score_track_update.rb +219 -0
- data/lib/swagger_client/models/score_views_counts.rb +209 -0
- data/lib/swagger_client/models/user_admin_update.rb +214 -0
- data/lib/swagger_client/models/user_basics.rb +239 -0
- data/lib/swagger_client/models/user_creation.rb +266 -0
- data/lib/swagger_client/models/user_details.rb +418 -0
- data/lib/swagger_client/models/user_details_admin.rb +306 -0
- data/lib/swagger_client/models/user_details_admin_license.rb +227 -0
- data/lib/swagger_client/models/user_instruments.rb +179 -0
- data/lib/swagger_client/models/user_public.rb +356 -0
- data/lib/swagger_client/models/user_public_summary.rb +277 -0
- data/lib/swagger_client/version.rb +15 -0
- data/spec/api/account_api_spec.rb +46 -0
- data/spec/api/class_api_spec.rb +278 -0
- data/spec/api/group_api_spec.rb +72 -0
- data/spec/api/organization_api_spec.rb +162 -0
- data/spec/api/score_api_spec.rb +411 -0
- data/spec/api/user_api_spec.rb +73 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/assignment_copy_spec.rb +42 -0
- data/spec/models/assignment_creation_spec.rb +66 -0
- data/spec/models/assignment_spec.rb +106 -0
- data/spec/models/assignment_submission_spec.rb +108 -0
- data/spec/models/assignment_submission_update_spec.rb +60 -0
- data/spec/models/class_attachment_creation_spec.rb +58 -0
- data/spec/models/class_creation_spec.rb +48 -0
- data/spec/models/class_details_canvas_spec.rb +48 -0
- data/spec/models/class_details_clever_spec.rb +82 -0
- data/spec/models/class_details_google_classroom_spec.rb +60 -0
- data/spec/models/class_details_google_drive_spec.rb +48 -0
- data/spec/models/class_details_lti_spec.rb +54 -0
- data/spec/models/class_details_spec.rb +144 -0
- data/spec/models/class_roles_spec.rb +36 -0
- data/spec/models/class_state_spec.rb +36 -0
- data/spec/models/class_update_spec.rb +48 -0
- data/spec/models/flat_error_response_spec.rb +60 -0
- data/spec/models/flat_locales_spec.rb +36 -0
- data/spec/models/google_classroom_coursework_spec.rb +54 -0
- data/spec/models/google_classroom_submission_spec.rb +54 -0
- data/spec/models/group_details_spec.rb +78 -0
- data/spec/models/group_spec.rb +82 -0
- data/spec/models/group_type_spec.rb +36 -0
- data/spec/models/license_mode_spec.rb +36 -0
- data/spec/models/license_sources_spec.rb +36 -0
- data/spec/models/lms_name_spec.rb +36 -0
- data/spec/models/lti_credentials_creation_spec.rb +48 -0
- data/spec/models/lti_credentials_spec.rb +90 -0
- data/spec/models/media_attachment_spec.rb +136 -0
- data/spec/models/media_score_sharing_mode_spec.rb +36 -0
- data/spec/models/organization_invitation_creation_spec.rb +48 -0
- data/spec/models/organization_invitation_spec.rb +78 -0
- data/spec/models/organization_roles_spec.rb +36 -0
- data/spec/models/score_collaborator_creation_spec.rb +72 -0
- data/spec/models/score_collaborator_spec.rb +84 -0
- data/spec/models/score_comment_context_spec.rb +78 -0
- data/spec/models/score_comment_creation_spec.rb +72 -0
- data/spec/models/score_comment_spec.rb +130 -0
- data/spec/models/score_comment_update_spec.rb +60 -0
- data/spec/models/score_comments_counts_spec.rb +60 -0
- data/spec/models/score_creation_spec.rb +72 -0
- data/spec/models/score_creation_type_spec.rb +36 -0
- data/spec/models/score_data_encoding_spec.rb +36 -0
- data/spec/models/score_data_spec.rb +36 -0
- data/spec/models/score_details_spec.rb +210 -0
- data/spec/models/score_fork_spec.rb +36 -0
- data/spec/models/score_license_spec.rb +36 -0
- data/spec/models/score_likes_counts_spec.rb +54 -0
- data/spec/models/score_modification_spec.rb +72 -0
- data/spec/models/score_privacy_spec.rb +36 -0
- data/spec/models/score_revision_creation_spec.rb +60 -0
- data/spec/models/score_revision_spec.rb +78 -0
- data/spec/models/score_revision_statistics_spec.rb +48 -0
- data/spec/models/score_rights_spec.rb +48 -0
- data/spec/models/score_source_spec.rb +42 -0
- data/spec/models/score_summary_spec.rb +72 -0
- data/spec/models/score_track_creation_spec.rb +66 -0
- data/spec/models/score_track_point_spec.rb +58 -0
- data/spec/models/score_track_spec.rb +108 -0
- data/spec/models/score_track_state_spec.rb +36 -0
- data/spec/models/score_track_type_spec.rb +36 -0
- data/spec/models/score_track_update_spec.rb +60 -0
- data/spec/models/score_views_counts_spec.rb +54 -0
- data/spec/models/user_admin_update_spec.rb +48 -0
- data/spec/models/user_basics_spec.rb +72 -0
- data/spec/models/user_creation_spec.rb +60 -0
- data/spec/models/user_details_admin_license_spec.rb +66 -0
- data/spec/models/user_details_admin_spec.rb +114 -0
- data/spec/models/user_details_spec.rb +166 -0
- data/spec/models/user_instruments_spec.rb +36 -0
- data/spec/models/user_public_spec.rb +144 -0
- data/spec/models/user_public_summary_spec.rb +96 -0
- data/spec/spec_helper.rb +111 -0
- metadata +640 -0
@@ -0,0 +1,1148 @@
|
|
1
|
+
=begin
|
2
|
+
#Flat API
|
3
|
+
|
4
|
+
#The Flat API allows you to easily extend the abilities of 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. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and interoduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html)
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.5.0
|
7
|
+
Contact: developers@flat.io
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.2.3-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require "uri"
|
14
|
+
|
15
|
+
module SwaggerClient
|
16
|
+
class ClassApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
|
23
|
+
# Activate the class
|
24
|
+
# 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.
|
25
|
+
# @param _class Unique identifier of the class
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [ClassDetails]
|
28
|
+
def activate_class(_class, opts = {})
|
29
|
+
data, _status_code, _headers = activate_class_with_http_info(_class, opts)
|
30
|
+
return data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Activate the class
|
34
|
+
# 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.
|
35
|
+
# @param _class Unique identifier of the class
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @return [Array<(ClassDetails, Fixnum, Hash)>] ClassDetails data, response status code and response headers
|
38
|
+
def activate_class_with_http_info(_class, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug "Calling API: ClassApi.activate_class ..."
|
41
|
+
end
|
42
|
+
# verify the required parameter '_class' is set
|
43
|
+
if @api_client.config.client_side_validation && _class.nil?
|
44
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.activate_class"
|
45
|
+
end
|
46
|
+
# resource path
|
47
|
+
local_var_path = "/classes/{class}/activate".sub('{' + 'class' + '}', _class.to_s)
|
48
|
+
|
49
|
+
# query parameters
|
50
|
+
query_params = {}
|
51
|
+
|
52
|
+
# header parameters
|
53
|
+
header_params = {}
|
54
|
+
# HTTP header 'Accept' (if needed)
|
55
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
56
|
+
# HTTP header 'Content-Type'
|
57
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
58
|
+
|
59
|
+
# form parameters
|
60
|
+
form_params = {}
|
61
|
+
|
62
|
+
# http body (model)
|
63
|
+
post_body = nil
|
64
|
+
auth_names = ['OAuth2']
|
65
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
66
|
+
:header_params => header_params,
|
67
|
+
:query_params => query_params,
|
68
|
+
:form_params => form_params,
|
69
|
+
:body => post_body,
|
70
|
+
:auth_names => auth_names,
|
71
|
+
:return_type => 'ClassDetails')
|
72
|
+
if @api_client.config.debugging
|
73
|
+
@api_client.config.logger.debug "API called: ClassApi#activate_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
74
|
+
end
|
75
|
+
return data, status_code, headers
|
76
|
+
end
|
77
|
+
|
78
|
+
# Add a user to the class
|
79
|
+
# 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.
|
80
|
+
# @param _class Unique identifier of the class
|
81
|
+
# @param user Unique identifier of the user
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @return [nil]
|
84
|
+
def add_class_user(_class, user, opts = {})
|
85
|
+
add_class_user_with_http_info(_class, user, opts)
|
86
|
+
return nil
|
87
|
+
end
|
88
|
+
|
89
|
+
# Add a user to the class
|
90
|
+
# 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.
|
91
|
+
# @param _class Unique identifier of the class
|
92
|
+
# @param user Unique identifier of the user
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
95
|
+
def add_class_user_with_http_info(_class, user, opts = {})
|
96
|
+
if @api_client.config.debugging
|
97
|
+
@api_client.config.logger.debug "Calling API: ClassApi.add_class_user ..."
|
98
|
+
end
|
99
|
+
# verify the required parameter '_class' is set
|
100
|
+
if @api_client.config.client_side_validation && _class.nil?
|
101
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.add_class_user"
|
102
|
+
end
|
103
|
+
# verify the required parameter 'user' is set
|
104
|
+
if @api_client.config.client_side_validation && user.nil?
|
105
|
+
fail ArgumentError, "Missing the required parameter 'user' when calling ClassApi.add_class_user"
|
106
|
+
end
|
107
|
+
# resource path
|
108
|
+
local_var_path = "/classes/{class}/users/{user}".sub('{' + 'class' + '}', _class.to_s).sub('{' + 'user' + '}', user.to_s)
|
109
|
+
|
110
|
+
# query parameters
|
111
|
+
query_params = {}
|
112
|
+
|
113
|
+
# header parameters
|
114
|
+
header_params = {}
|
115
|
+
# HTTP header 'Accept' (if needed)
|
116
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
117
|
+
# HTTP header 'Content-Type'
|
118
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
119
|
+
|
120
|
+
# form parameters
|
121
|
+
form_params = {}
|
122
|
+
|
123
|
+
# http body (model)
|
124
|
+
post_body = nil
|
125
|
+
auth_names = ['OAuth2']
|
126
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
127
|
+
:header_params => header_params,
|
128
|
+
:query_params => query_params,
|
129
|
+
:form_params => form_params,
|
130
|
+
:body => post_body,
|
131
|
+
:auth_names => auth_names)
|
132
|
+
if @api_client.config.debugging
|
133
|
+
@api_client.config.logger.debug "API called: ClassApi#add_class_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
134
|
+
end
|
135
|
+
return data, status_code, headers
|
136
|
+
end
|
137
|
+
|
138
|
+
# Archive the class
|
139
|
+
# Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.
|
140
|
+
# @param _class Unique identifier of the class
|
141
|
+
# @param [Hash] opts the optional parameters
|
142
|
+
# @return [ClassDetails]
|
143
|
+
def archive_class(_class, opts = {})
|
144
|
+
data, _status_code, _headers = archive_class_with_http_info(_class, opts)
|
145
|
+
return data
|
146
|
+
end
|
147
|
+
|
148
|
+
# Archive the class
|
149
|
+
# Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.
|
150
|
+
# @param _class Unique identifier of the class
|
151
|
+
# @param [Hash] opts the optional parameters
|
152
|
+
# @return [Array<(ClassDetails, Fixnum, Hash)>] ClassDetails data, response status code and response headers
|
153
|
+
def archive_class_with_http_info(_class, opts = {})
|
154
|
+
if @api_client.config.debugging
|
155
|
+
@api_client.config.logger.debug "Calling API: ClassApi.archive_class ..."
|
156
|
+
end
|
157
|
+
# verify the required parameter '_class' is set
|
158
|
+
if @api_client.config.client_side_validation && _class.nil?
|
159
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.archive_class"
|
160
|
+
end
|
161
|
+
# resource path
|
162
|
+
local_var_path = "/classes/{class}/archive".sub('{' + 'class' + '}', _class.to_s)
|
163
|
+
|
164
|
+
# query parameters
|
165
|
+
query_params = {}
|
166
|
+
|
167
|
+
# header parameters
|
168
|
+
header_params = {}
|
169
|
+
# HTTP header 'Accept' (if needed)
|
170
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
171
|
+
# HTTP header 'Content-Type'
|
172
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
173
|
+
|
174
|
+
# form parameters
|
175
|
+
form_params = {}
|
176
|
+
|
177
|
+
# http body (model)
|
178
|
+
post_body = nil
|
179
|
+
auth_names = ['OAuth2']
|
180
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
181
|
+
:header_params => header_params,
|
182
|
+
:query_params => query_params,
|
183
|
+
:form_params => form_params,
|
184
|
+
:body => post_body,
|
185
|
+
:auth_names => auth_names,
|
186
|
+
:return_type => 'ClassDetails')
|
187
|
+
if @api_client.config.debugging
|
188
|
+
@api_client.config.logger.debug "API called: ClassApi#archive_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
189
|
+
end
|
190
|
+
return data, status_code, headers
|
191
|
+
end
|
192
|
+
|
193
|
+
# Copy an assignment
|
194
|
+
# Copy an assignment to a specified class. If the original assignment has a due date in the past, this new assingment will be created without a due date. If the new class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app.
|
195
|
+
# @param _class Unique identifier of the class
|
196
|
+
# @param assignment Unique identifier of the assignment
|
197
|
+
# @param body
|
198
|
+
# @param [Hash] opts the optional parameters
|
199
|
+
# @return [Assignment]
|
200
|
+
def copy_assignment(_class, assignment, body, opts = {})
|
201
|
+
data, _status_code, _headers = copy_assignment_with_http_info(_class, assignment, body, opts)
|
202
|
+
return data
|
203
|
+
end
|
204
|
+
|
205
|
+
# Copy an assignment
|
206
|
+
# Copy an assignment to a specified class. If the original assignment has a due date in the past, this new assingment will be created without a due date. If the new class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app.
|
207
|
+
# @param _class Unique identifier of the class
|
208
|
+
# @param assignment Unique identifier of the assignment
|
209
|
+
# @param body
|
210
|
+
# @param [Hash] opts the optional parameters
|
211
|
+
# @return [Array<(Assignment, Fixnum, Hash)>] Assignment data, response status code and response headers
|
212
|
+
def copy_assignment_with_http_info(_class, assignment, body, opts = {})
|
213
|
+
if @api_client.config.debugging
|
214
|
+
@api_client.config.logger.debug "Calling API: ClassApi.copy_assignment ..."
|
215
|
+
end
|
216
|
+
# verify the required parameter '_class' is set
|
217
|
+
if @api_client.config.client_side_validation && _class.nil?
|
218
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.copy_assignment"
|
219
|
+
end
|
220
|
+
# verify the required parameter 'assignment' is set
|
221
|
+
if @api_client.config.client_side_validation && assignment.nil?
|
222
|
+
fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.copy_assignment"
|
223
|
+
end
|
224
|
+
# verify the required parameter 'body' is set
|
225
|
+
if @api_client.config.client_side_validation && body.nil?
|
226
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.copy_assignment"
|
227
|
+
end
|
228
|
+
# resource path
|
229
|
+
local_var_path = "/classes/{class}/assignments/{assignment}/copy".sub('{' + 'class' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s)
|
230
|
+
|
231
|
+
# query parameters
|
232
|
+
query_params = {}
|
233
|
+
|
234
|
+
# header parameters
|
235
|
+
header_params = {}
|
236
|
+
# HTTP header 'Accept' (if needed)
|
237
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
238
|
+
# HTTP header 'Content-Type'
|
239
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
240
|
+
|
241
|
+
# form parameters
|
242
|
+
form_params = {}
|
243
|
+
|
244
|
+
# http body (model)
|
245
|
+
post_body = @api_client.object_to_http_body(body)
|
246
|
+
auth_names = ['OAuth2']
|
247
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
248
|
+
:header_params => header_params,
|
249
|
+
:query_params => query_params,
|
250
|
+
:form_params => form_params,
|
251
|
+
:body => post_body,
|
252
|
+
:auth_names => auth_names,
|
253
|
+
:return_type => 'Assignment')
|
254
|
+
if @api_client.config.debugging
|
255
|
+
@api_client.config.logger.debug "API called: ClassApi#copy_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
256
|
+
end
|
257
|
+
return data, status_code, headers
|
258
|
+
end
|
259
|
+
|
260
|
+
# Assignment creation
|
261
|
+
# 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.
|
262
|
+
# @param _class Unique identifier of the class
|
263
|
+
# @param [Hash] opts the optional parameters
|
264
|
+
# @option opts [AssignmentCreation] :body
|
265
|
+
# @return [Assignment]
|
266
|
+
def create_assignment(_class, opts = {})
|
267
|
+
data, _status_code, _headers = create_assignment_with_http_info(_class, opts)
|
268
|
+
return data
|
269
|
+
end
|
270
|
+
|
271
|
+
# Assignment creation
|
272
|
+
# 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.
|
273
|
+
# @param _class Unique identifier of the class
|
274
|
+
# @param [Hash] opts the optional parameters
|
275
|
+
# @option opts [AssignmentCreation] :body
|
276
|
+
# @return [Array<(Assignment, Fixnum, Hash)>] Assignment data, response status code and response headers
|
277
|
+
def create_assignment_with_http_info(_class, opts = {})
|
278
|
+
if @api_client.config.debugging
|
279
|
+
@api_client.config.logger.debug "Calling API: ClassApi.create_assignment ..."
|
280
|
+
end
|
281
|
+
# verify the required parameter '_class' is set
|
282
|
+
if @api_client.config.client_side_validation && _class.nil?
|
283
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.create_assignment"
|
284
|
+
end
|
285
|
+
# resource path
|
286
|
+
local_var_path = "/classes/{class}/assignments".sub('{' + 'class' + '}', _class.to_s)
|
287
|
+
|
288
|
+
# query parameters
|
289
|
+
query_params = {}
|
290
|
+
|
291
|
+
# header parameters
|
292
|
+
header_params = {}
|
293
|
+
# HTTP header 'Accept' (if needed)
|
294
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
295
|
+
# HTTP header 'Content-Type'
|
296
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
297
|
+
|
298
|
+
# form parameters
|
299
|
+
form_params = {}
|
300
|
+
|
301
|
+
# http body (model)
|
302
|
+
post_body = @api_client.object_to_http_body(opts[:'body'])
|
303
|
+
auth_names = ['OAuth2']
|
304
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
305
|
+
:header_params => header_params,
|
306
|
+
:query_params => query_params,
|
307
|
+
:form_params => form_params,
|
308
|
+
:body => post_body,
|
309
|
+
:auth_names => auth_names,
|
310
|
+
:return_type => 'Assignment')
|
311
|
+
if @api_client.config.debugging
|
312
|
+
@api_client.config.logger.debug "API called: ClassApi#create_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
313
|
+
end
|
314
|
+
return data, status_code, headers
|
315
|
+
end
|
316
|
+
|
317
|
+
# Create a new class
|
318
|
+
# 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 `POST /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.
|
319
|
+
# @param body
|
320
|
+
# @param [Hash] opts the optional parameters
|
321
|
+
# @return [ClassDetails]
|
322
|
+
def create_class(body, opts = {})
|
323
|
+
data, _status_code, _headers = create_class_with_http_info(body, opts)
|
324
|
+
return data
|
325
|
+
end
|
326
|
+
|
327
|
+
# Create a new class
|
328
|
+
# 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 `POST /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.
|
329
|
+
# @param body
|
330
|
+
# @param [Hash] opts the optional parameters
|
331
|
+
# @return [Array<(ClassDetails, Fixnum, Hash)>] ClassDetails data, response status code and response headers
|
332
|
+
def create_class_with_http_info(body, opts = {})
|
333
|
+
if @api_client.config.debugging
|
334
|
+
@api_client.config.logger.debug "Calling API: ClassApi.create_class ..."
|
335
|
+
end
|
336
|
+
# verify the required parameter 'body' is set
|
337
|
+
if @api_client.config.client_side_validation && body.nil?
|
338
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.create_class"
|
339
|
+
end
|
340
|
+
# resource path
|
341
|
+
local_var_path = "/classes"
|
342
|
+
|
343
|
+
# query parameters
|
344
|
+
query_params = {}
|
345
|
+
|
346
|
+
# header parameters
|
347
|
+
header_params = {}
|
348
|
+
# HTTP header 'Accept' (if needed)
|
349
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
350
|
+
# HTTP header 'Content-Type'
|
351
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
352
|
+
|
353
|
+
# form parameters
|
354
|
+
form_params = {}
|
355
|
+
|
356
|
+
# http body (model)
|
357
|
+
post_body = @api_client.object_to_http_body(body)
|
358
|
+
auth_names = ['OAuth2']
|
359
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
360
|
+
:header_params => header_params,
|
361
|
+
:query_params => query_params,
|
362
|
+
:form_params => form_params,
|
363
|
+
:body => post_body,
|
364
|
+
:auth_names => auth_names,
|
365
|
+
:return_type => 'ClassDetails')
|
366
|
+
if @api_client.config.debugging
|
367
|
+
@api_client.config.logger.debug "API called: ClassApi#create_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
368
|
+
end
|
369
|
+
return data, status_code, headers
|
370
|
+
end
|
371
|
+
|
372
|
+
# Create or edit a submission
|
373
|
+
# Use this method as a student to create, update and submit a submission related to an assignment. Students can only set `attachments`, `studentComment` and `submit`. Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id.
|
374
|
+
# @param _class Unique identifier of the class
|
375
|
+
# @param assignment Unique identifier of the assignment
|
376
|
+
# @param body
|
377
|
+
# @param [Hash] opts the optional parameters
|
378
|
+
# @return [AssignmentSubmission]
|
379
|
+
def create_submission(_class, assignment, body, opts = {})
|
380
|
+
data, _status_code, _headers = create_submission_with_http_info(_class, assignment, body, opts)
|
381
|
+
return data
|
382
|
+
end
|
383
|
+
|
384
|
+
# Create or edit a submission
|
385
|
+
# Use this method as a student to create, update and submit a submission related to an assignment. Students can only set `attachments`, `studentComment` and `submit`. Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id.
|
386
|
+
# @param _class Unique identifier of the class
|
387
|
+
# @param assignment Unique identifier of the assignment
|
388
|
+
# @param body
|
389
|
+
# @param [Hash] opts the optional parameters
|
390
|
+
# @return [Array<(AssignmentSubmission, Fixnum, Hash)>] AssignmentSubmission data, response status code and response headers
|
391
|
+
def create_submission_with_http_info(_class, assignment, body, opts = {})
|
392
|
+
if @api_client.config.debugging
|
393
|
+
@api_client.config.logger.debug "Calling API: ClassApi.create_submission ..."
|
394
|
+
end
|
395
|
+
# verify the required parameter '_class' is set
|
396
|
+
if @api_client.config.client_side_validation && _class.nil?
|
397
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.create_submission"
|
398
|
+
end
|
399
|
+
# verify the required parameter 'assignment' is set
|
400
|
+
if @api_client.config.client_side_validation && assignment.nil?
|
401
|
+
fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.create_submission"
|
402
|
+
end
|
403
|
+
# verify the required parameter 'body' is set
|
404
|
+
if @api_client.config.client_side_validation && body.nil?
|
405
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.create_submission"
|
406
|
+
end
|
407
|
+
# resource path
|
408
|
+
local_var_path = "/classes/{class}/assignments/{assignment}/submissions".sub('{' + 'class' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s)
|
409
|
+
|
410
|
+
# query parameters
|
411
|
+
query_params = {}
|
412
|
+
|
413
|
+
# header parameters
|
414
|
+
header_params = {}
|
415
|
+
# HTTP header 'Accept' (if needed)
|
416
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
417
|
+
# HTTP header 'Content-Type'
|
418
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
419
|
+
|
420
|
+
# form parameters
|
421
|
+
form_params = {}
|
422
|
+
|
423
|
+
# http body (model)
|
424
|
+
post_body = @api_client.object_to_http_body(body)
|
425
|
+
auth_names = ['OAuth2']
|
426
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
427
|
+
:header_params => header_params,
|
428
|
+
:query_params => query_params,
|
429
|
+
:form_params => form_params,
|
430
|
+
:body => post_body,
|
431
|
+
:auth_names => auth_names,
|
432
|
+
:return_type => 'AssignmentSubmission')
|
433
|
+
if @api_client.config.debugging
|
434
|
+
@api_client.config.logger.debug "API called: ClassApi#create_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
435
|
+
end
|
436
|
+
return data, status_code, headers
|
437
|
+
end
|
438
|
+
|
439
|
+
# Remove a user from the class
|
440
|
+
# 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.
|
441
|
+
# @param _class Unique identifier of the class
|
442
|
+
# @param user Unique identifier of the user
|
443
|
+
# @param [Hash] opts the optional parameters
|
444
|
+
# @return [nil]
|
445
|
+
def delete_class_user(_class, user, opts = {})
|
446
|
+
delete_class_user_with_http_info(_class, user, opts)
|
447
|
+
return nil
|
448
|
+
end
|
449
|
+
|
450
|
+
# Remove a user from the class
|
451
|
+
# 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.
|
452
|
+
# @param _class Unique identifier of the class
|
453
|
+
# @param user Unique identifier of the user
|
454
|
+
# @param [Hash] opts the optional parameters
|
455
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
456
|
+
def delete_class_user_with_http_info(_class, user, opts = {})
|
457
|
+
if @api_client.config.debugging
|
458
|
+
@api_client.config.logger.debug "Calling API: ClassApi.delete_class_user ..."
|
459
|
+
end
|
460
|
+
# verify the required parameter '_class' is set
|
461
|
+
if @api_client.config.client_side_validation && _class.nil?
|
462
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.delete_class_user"
|
463
|
+
end
|
464
|
+
# verify the required parameter 'user' is set
|
465
|
+
if @api_client.config.client_side_validation && user.nil?
|
466
|
+
fail ArgumentError, "Missing the required parameter 'user' when calling ClassApi.delete_class_user"
|
467
|
+
end
|
468
|
+
# resource path
|
469
|
+
local_var_path = "/classes/{class}/users/{user}".sub('{' + 'class' + '}', _class.to_s).sub('{' + 'user' + '}', user.to_s)
|
470
|
+
|
471
|
+
# query parameters
|
472
|
+
query_params = {}
|
473
|
+
|
474
|
+
# header parameters
|
475
|
+
header_params = {}
|
476
|
+
# HTTP header 'Accept' (if needed)
|
477
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
478
|
+
# HTTP header 'Content-Type'
|
479
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
480
|
+
|
481
|
+
# form parameters
|
482
|
+
form_params = {}
|
483
|
+
|
484
|
+
# http body (model)
|
485
|
+
post_body = nil
|
486
|
+
auth_names = ['OAuth2']
|
487
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
488
|
+
:header_params => header_params,
|
489
|
+
:query_params => query_params,
|
490
|
+
:form_params => form_params,
|
491
|
+
:body => post_body,
|
492
|
+
:auth_names => auth_names)
|
493
|
+
if @api_client.config.debugging
|
494
|
+
@api_client.config.logger.debug "API called: ClassApi#delete_class_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
495
|
+
end
|
496
|
+
return data, status_code, headers
|
497
|
+
end
|
498
|
+
|
499
|
+
# Edit a submission
|
500
|
+
# Use this method as a teacher to update the different submission and give feedback. Teachers can only set `returnFeedback`
|
501
|
+
# @param _class Unique identifier of the class
|
502
|
+
# @param assignment Unique identifier of the assignment
|
503
|
+
# @param submission Unique identifier of the submission
|
504
|
+
# @param body
|
505
|
+
# @param [Hash] opts the optional parameters
|
506
|
+
# @return [AssignmentSubmission]
|
507
|
+
def edit_submission(_class, assignment, submission, body, opts = {})
|
508
|
+
data, _status_code, _headers = edit_submission_with_http_info(_class, assignment, submission, body, opts)
|
509
|
+
return data
|
510
|
+
end
|
511
|
+
|
512
|
+
# Edit a submission
|
513
|
+
# Use this method as a teacher to update the different submission and give feedback. Teachers can only set `returnFeedback`
|
514
|
+
# @param _class Unique identifier of the class
|
515
|
+
# @param assignment Unique identifier of the assignment
|
516
|
+
# @param submission Unique identifier of the submission
|
517
|
+
# @param body
|
518
|
+
# @param [Hash] opts the optional parameters
|
519
|
+
# @return [Array<(AssignmentSubmission, Fixnum, Hash)>] AssignmentSubmission data, response status code and response headers
|
520
|
+
def edit_submission_with_http_info(_class, assignment, submission, body, opts = {})
|
521
|
+
if @api_client.config.debugging
|
522
|
+
@api_client.config.logger.debug "Calling API: ClassApi.edit_submission ..."
|
523
|
+
end
|
524
|
+
# verify the required parameter '_class' is set
|
525
|
+
if @api_client.config.client_side_validation && _class.nil?
|
526
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.edit_submission"
|
527
|
+
end
|
528
|
+
# verify the required parameter 'assignment' is set
|
529
|
+
if @api_client.config.client_side_validation && assignment.nil?
|
530
|
+
fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.edit_submission"
|
531
|
+
end
|
532
|
+
# verify the required parameter 'submission' is set
|
533
|
+
if @api_client.config.client_side_validation && submission.nil?
|
534
|
+
fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.edit_submission"
|
535
|
+
end
|
536
|
+
# verify the required parameter 'body' is set
|
537
|
+
if @api_client.config.client_side_validation && body.nil?
|
538
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ClassApi.edit_submission"
|
539
|
+
end
|
540
|
+
# resource path
|
541
|
+
local_var_path = "/classes/{class}/assignments/{assignment}/submissions/{submission}".sub('{' + 'class' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s).sub('{' + 'submission' + '}', submission.to_s)
|
542
|
+
|
543
|
+
# query parameters
|
544
|
+
query_params = {}
|
545
|
+
|
546
|
+
# header parameters
|
547
|
+
header_params = {}
|
548
|
+
# HTTP header 'Accept' (if needed)
|
549
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
550
|
+
# HTTP header 'Content-Type'
|
551
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
552
|
+
|
553
|
+
# form parameters
|
554
|
+
form_params = {}
|
555
|
+
|
556
|
+
# http body (model)
|
557
|
+
post_body = @api_client.object_to_http_body(body)
|
558
|
+
auth_names = ['OAuth2']
|
559
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
560
|
+
:header_params => header_params,
|
561
|
+
:query_params => query_params,
|
562
|
+
:form_params => form_params,
|
563
|
+
:body => post_body,
|
564
|
+
:auth_names => auth_names,
|
565
|
+
:return_type => 'AssignmentSubmission')
|
566
|
+
if @api_client.config.debugging
|
567
|
+
@api_client.config.logger.debug "API called: ClassApi#edit_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
568
|
+
end
|
569
|
+
return data, status_code, headers
|
570
|
+
end
|
571
|
+
|
572
|
+
# Join a class
|
573
|
+
# 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.
|
574
|
+
# @param enrollment_code The enrollment code, available to the teacher in `ClassDetails`
|
575
|
+
# @param [Hash] opts the optional parameters
|
576
|
+
# @return [ClassDetails]
|
577
|
+
def enroll_class(enrollment_code, opts = {})
|
578
|
+
data, _status_code, _headers = enroll_class_with_http_info(enrollment_code, opts)
|
579
|
+
return data
|
580
|
+
end
|
581
|
+
|
582
|
+
# Join a class
|
583
|
+
# 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.
|
584
|
+
# @param enrollment_code The enrollment code, available to the teacher in `ClassDetails`
|
585
|
+
# @param [Hash] opts the optional parameters
|
586
|
+
# @return [Array<(ClassDetails, Fixnum, Hash)>] ClassDetails data, response status code and response headers
|
587
|
+
def enroll_class_with_http_info(enrollment_code, opts = {})
|
588
|
+
if @api_client.config.debugging
|
589
|
+
@api_client.config.logger.debug "Calling API: ClassApi.enroll_class ..."
|
590
|
+
end
|
591
|
+
# verify the required parameter 'enrollment_code' is set
|
592
|
+
if @api_client.config.client_side_validation && enrollment_code.nil?
|
593
|
+
fail ArgumentError, "Missing the required parameter 'enrollment_code' when calling ClassApi.enroll_class"
|
594
|
+
end
|
595
|
+
# resource path
|
596
|
+
local_var_path = "/classes/enroll/{enrollmentCode}".sub('{' + 'enrollmentCode' + '}', enrollment_code.to_s)
|
597
|
+
|
598
|
+
# query parameters
|
599
|
+
query_params = {}
|
600
|
+
|
601
|
+
# header parameters
|
602
|
+
header_params = {}
|
603
|
+
# HTTP header 'Accept' (if needed)
|
604
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
605
|
+
# HTTP header 'Content-Type'
|
606
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
607
|
+
|
608
|
+
# form parameters
|
609
|
+
form_params = {}
|
610
|
+
|
611
|
+
# http body (model)
|
612
|
+
post_body = nil
|
613
|
+
auth_names = ['OAuth2']
|
614
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
615
|
+
:header_params => header_params,
|
616
|
+
:query_params => query_params,
|
617
|
+
:form_params => form_params,
|
618
|
+
:body => post_body,
|
619
|
+
:auth_names => auth_names,
|
620
|
+
:return_type => 'ClassDetails')
|
621
|
+
if @api_client.config.debugging
|
622
|
+
@api_client.config.logger.debug "API called: ClassApi#enroll_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
623
|
+
end
|
624
|
+
return data, status_code, headers
|
625
|
+
end
|
626
|
+
|
627
|
+
# Get the details of a single class
|
628
|
+
#
|
629
|
+
# @param _class Unique identifier of the class
|
630
|
+
# @param [Hash] opts the optional parameters
|
631
|
+
# @return [ClassDetails]
|
632
|
+
def get_class(_class, opts = {})
|
633
|
+
data, _status_code, _headers = get_class_with_http_info(_class, opts)
|
634
|
+
return data
|
635
|
+
end
|
636
|
+
|
637
|
+
# Get the details of a single class
|
638
|
+
#
|
639
|
+
# @param _class Unique identifier of the class
|
640
|
+
# @param [Hash] opts the optional parameters
|
641
|
+
# @return [Array<(ClassDetails, Fixnum, Hash)>] ClassDetails data, response status code and response headers
|
642
|
+
def get_class_with_http_info(_class, opts = {})
|
643
|
+
if @api_client.config.debugging
|
644
|
+
@api_client.config.logger.debug "Calling API: ClassApi.get_class ..."
|
645
|
+
end
|
646
|
+
# verify the required parameter '_class' is set
|
647
|
+
if @api_client.config.client_side_validation && _class.nil?
|
648
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_class"
|
649
|
+
end
|
650
|
+
# resource path
|
651
|
+
local_var_path = "/classes/{class}".sub('{' + 'class' + '}', _class.to_s)
|
652
|
+
|
653
|
+
# query parameters
|
654
|
+
query_params = {}
|
655
|
+
|
656
|
+
# header parameters
|
657
|
+
header_params = {}
|
658
|
+
# HTTP header 'Accept' (if needed)
|
659
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
660
|
+
# HTTP header 'Content-Type'
|
661
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
662
|
+
|
663
|
+
# form parameters
|
664
|
+
form_params = {}
|
665
|
+
|
666
|
+
# http body (model)
|
667
|
+
post_body = nil
|
668
|
+
auth_names = ['OAuth2']
|
669
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
670
|
+
:header_params => header_params,
|
671
|
+
:query_params => query_params,
|
672
|
+
:form_params => form_params,
|
673
|
+
:body => post_body,
|
674
|
+
:auth_names => auth_names,
|
675
|
+
:return_type => 'ClassDetails')
|
676
|
+
if @api_client.config.debugging
|
677
|
+
@api_client.config.logger.debug "API called: ClassApi#get_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
678
|
+
end
|
679
|
+
return data, status_code, headers
|
680
|
+
end
|
681
|
+
|
682
|
+
# List submissions related to the score
|
683
|
+
# 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.
|
684
|
+
# @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`).
|
685
|
+
# @param [Hash] opts the optional parameters
|
686
|
+
# @return [Array<AssignmentSubmission>]
|
687
|
+
def get_score_submissions(score, opts = {})
|
688
|
+
data, _status_code, _headers = get_score_submissions_with_http_info(score, opts)
|
689
|
+
return data
|
690
|
+
end
|
691
|
+
|
692
|
+
# List submissions related to the score
|
693
|
+
# 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.
|
694
|
+
# @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`).
|
695
|
+
# @param [Hash] opts the optional parameters
|
696
|
+
# @return [Array<(Array<AssignmentSubmission>, Fixnum, Hash)>] Array<AssignmentSubmission> data, response status code and response headers
|
697
|
+
def get_score_submissions_with_http_info(score, opts = {})
|
698
|
+
if @api_client.config.debugging
|
699
|
+
@api_client.config.logger.debug "Calling API: ClassApi.get_score_submissions ..."
|
700
|
+
end
|
701
|
+
# verify the required parameter 'score' is set
|
702
|
+
if @api_client.config.client_side_validation && score.nil?
|
703
|
+
fail ArgumentError, "Missing the required parameter 'score' when calling ClassApi.get_score_submissions"
|
704
|
+
end
|
705
|
+
# resource path
|
706
|
+
local_var_path = "/scores/{score}/submissions".sub('{' + 'score' + '}', score.to_s)
|
707
|
+
|
708
|
+
# query parameters
|
709
|
+
query_params = {}
|
710
|
+
|
711
|
+
# header parameters
|
712
|
+
header_params = {}
|
713
|
+
# HTTP header 'Accept' (if needed)
|
714
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
715
|
+
# HTTP header 'Content-Type'
|
716
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
717
|
+
|
718
|
+
# form parameters
|
719
|
+
form_params = {}
|
720
|
+
|
721
|
+
# http body (model)
|
722
|
+
post_body = nil
|
723
|
+
auth_names = ['OAuth2']
|
724
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
725
|
+
:header_params => header_params,
|
726
|
+
:query_params => query_params,
|
727
|
+
:form_params => form_params,
|
728
|
+
:body => post_body,
|
729
|
+
:auth_names => auth_names,
|
730
|
+
:return_type => 'Array<AssignmentSubmission>')
|
731
|
+
if @api_client.config.debugging
|
732
|
+
@api_client.config.logger.debug "API called: ClassApi#get_score_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
733
|
+
end
|
734
|
+
return data, status_code, headers
|
735
|
+
end
|
736
|
+
|
737
|
+
# Get a student submission
|
738
|
+
#
|
739
|
+
# @param _class Unique identifier of the class
|
740
|
+
# @param assignment Unique identifier of the assignment
|
741
|
+
# @param submission Unique identifier of the submission
|
742
|
+
# @param [Hash] opts the optional parameters
|
743
|
+
# @return [AssignmentSubmission]
|
744
|
+
def get_submission(_class, assignment, submission, opts = {})
|
745
|
+
data, _status_code, _headers = get_submission_with_http_info(_class, assignment, submission, opts)
|
746
|
+
return data
|
747
|
+
end
|
748
|
+
|
749
|
+
# Get a student submission
|
750
|
+
#
|
751
|
+
# @param _class Unique identifier of the class
|
752
|
+
# @param assignment Unique identifier of the assignment
|
753
|
+
# @param submission Unique identifier of the submission
|
754
|
+
# @param [Hash] opts the optional parameters
|
755
|
+
# @return [Array<(AssignmentSubmission, Fixnum, Hash)>] AssignmentSubmission data, response status code and response headers
|
756
|
+
def get_submission_with_http_info(_class, assignment, submission, opts = {})
|
757
|
+
if @api_client.config.debugging
|
758
|
+
@api_client.config.logger.debug "Calling API: ClassApi.get_submission ..."
|
759
|
+
end
|
760
|
+
# verify the required parameter '_class' is set
|
761
|
+
if @api_client.config.client_side_validation && _class.nil?
|
762
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_submission"
|
763
|
+
end
|
764
|
+
# verify the required parameter 'assignment' is set
|
765
|
+
if @api_client.config.client_side_validation && assignment.nil?
|
766
|
+
fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.get_submission"
|
767
|
+
end
|
768
|
+
# verify the required parameter 'submission' is set
|
769
|
+
if @api_client.config.client_side_validation && submission.nil?
|
770
|
+
fail ArgumentError, "Missing the required parameter 'submission' when calling ClassApi.get_submission"
|
771
|
+
end
|
772
|
+
# resource path
|
773
|
+
local_var_path = "/classes/{class}/assignments/{assignment}/submissions/{submission}".sub('{' + 'class' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s).sub('{' + 'submission' + '}', submission.to_s)
|
774
|
+
|
775
|
+
# query parameters
|
776
|
+
query_params = {}
|
777
|
+
|
778
|
+
# header parameters
|
779
|
+
header_params = {}
|
780
|
+
# HTTP header 'Accept' (if needed)
|
781
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
782
|
+
# HTTP header 'Content-Type'
|
783
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
784
|
+
|
785
|
+
# form parameters
|
786
|
+
form_params = {}
|
787
|
+
|
788
|
+
# http body (model)
|
789
|
+
post_body = nil
|
790
|
+
auth_names = ['OAuth2']
|
791
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
792
|
+
:header_params => header_params,
|
793
|
+
:query_params => query_params,
|
794
|
+
:form_params => form_params,
|
795
|
+
:body => post_body,
|
796
|
+
:auth_names => auth_names,
|
797
|
+
:return_type => 'AssignmentSubmission')
|
798
|
+
if @api_client.config.debugging
|
799
|
+
@api_client.config.logger.debug "API called: ClassApi#get_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
800
|
+
end
|
801
|
+
return data, status_code, headers
|
802
|
+
end
|
803
|
+
|
804
|
+
# List the students' submissions
|
805
|
+
#
|
806
|
+
# @param _class Unique identifier of the class
|
807
|
+
# @param assignment Unique identifier of the assignment
|
808
|
+
# @param [Hash] opts the optional parameters
|
809
|
+
# @return [Array<AssignmentSubmission>]
|
810
|
+
def get_submissions(_class, assignment, opts = {})
|
811
|
+
data, _status_code, _headers = get_submissions_with_http_info(_class, assignment, opts)
|
812
|
+
return data
|
813
|
+
end
|
814
|
+
|
815
|
+
# List the students' submissions
|
816
|
+
#
|
817
|
+
# @param _class Unique identifier of the class
|
818
|
+
# @param assignment Unique identifier of the assignment
|
819
|
+
# @param [Hash] opts the optional parameters
|
820
|
+
# @return [Array<(Array<AssignmentSubmission>, Fixnum, Hash)>] Array<AssignmentSubmission> data, response status code and response headers
|
821
|
+
def get_submissions_with_http_info(_class, assignment, opts = {})
|
822
|
+
if @api_client.config.debugging
|
823
|
+
@api_client.config.logger.debug "Calling API: ClassApi.get_submissions ..."
|
824
|
+
end
|
825
|
+
# verify the required parameter '_class' is set
|
826
|
+
if @api_client.config.client_side_validation && _class.nil?
|
827
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.get_submissions"
|
828
|
+
end
|
829
|
+
# verify the required parameter 'assignment' is set
|
830
|
+
if @api_client.config.client_side_validation && assignment.nil?
|
831
|
+
fail ArgumentError, "Missing the required parameter 'assignment' when calling ClassApi.get_submissions"
|
832
|
+
end
|
833
|
+
# resource path
|
834
|
+
local_var_path = "/classes/{class}/assignments/{assignment}/submissions".sub('{' + 'class' + '}', _class.to_s).sub('{' + 'assignment' + '}', assignment.to_s)
|
835
|
+
|
836
|
+
# query parameters
|
837
|
+
query_params = {}
|
838
|
+
|
839
|
+
# header parameters
|
840
|
+
header_params = {}
|
841
|
+
# HTTP header 'Accept' (if needed)
|
842
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
843
|
+
# HTTP header 'Content-Type'
|
844
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
845
|
+
|
846
|
+
# form parameters
|
847
|
+
form_params = {}
|
848
|
+
|
849
|
+
# http body (model)
|
850
|
+
post_body = nil
|
851
|
+
auth_names = ['OAuth2']
|
852
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
853
|
+
:header_params => header_params,
|
854
|
+
:query_params => query_params,
|
855
|
+
:form_params => form_params,
|
856
|
+
:body => post_body,
|
857
|
+
:auth_names => auth_names,
|
858
|
+
:return_type => 'Array<AssignmentSubmission>')
|
859
|
+
if @api_client.config.debugging
|
860
|
+
@api_client.config.logger.debug "API called: ClassApi#get_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
861
|
+
end
|
862
|
+
return data, status_code, headers
|
863
|
+
end
|
864
|
+
|
865
|
+
# Assignments listing
|
866
|
+
#
|
867
|
+
# @param _class Unique identifier of the class
|
868
|
+
# @param [Hash] opts the optional parameters
|
869
|
+
# @return [Array<Assignment>]
|
870
|
+
def list_assignments(_class, opts = {})
|
871
|
+
data, _status_code, _headers = list_assignments_with_http_info(_class, opts)
|
872
|
+
return data
|
873
|
+
end
|
874
|
+
|
875
|
+
# Assignments listing
|
876
|
+
#
|
877
|
+
# @param _class Unique identifier of the class
|
878
|
+
# @param [Hash] opts the optional parameters
|
879
|
+
# @return [Array<(Array<Assignment>, Fixnum, Hash)>] Array<Assignment> data, response status code and response headers
|
880
|
+
def list_assignments_with_http_info(_class, opts = {})
|
881
|
+
if @api_client.config.debugging
|
882
|
+
@api_client.config.logger.debug "Calling API: ClassApi.list_assignments ..."
|
883
|
+
end
|
884
|
+
# verify the required parameter '_class' is set
|
885
|
+
if @api_client.config.client_side_validation && _class.nil?
|
886
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.list_assignments"
|
887
|
+
end
|
888
|
+
# resource path
|
889
|
+
local_var_path = "/classes/{class}/assignments".sub('{' + 'class' + '}', _class.to_s)
|
890
|
+
|
891
|
+
# query parameters
|
892
|
+
query_params = {}
|
893
|
+
|
894
|
+
# header parameters
|
895
|
+
header_params = {}
|
896
|
+
# HTTP header 'Accept' (if needed)
|
897
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
898
|
+
# HTTP header 'Content-Type'
|
899
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
900
|
+
|
901
|
+
# form parameters
|
902
|
+
form_params = {}
|
903
|
+
|
904
|
+
# http body (model)
|
905
|
+
post_body = nil
|
906
|
+
auth_names = ['OAuth2']
|
907
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
908
|
+
:header_params => header_params,
|
909
|
+
:query_params => query_params,
|
910
|
+
:form_params => form_params,
|
911
|
+
:body => post_body,
|
912
|
+
:auth_names => auth_names,
|
913
|
+
:return_type => 'Array<Assignment>')
|
914
|
+
if @api_client.config.debugging
|
915
|
+
@api_client.config.logger.debug "API called: ClassApi#list_assignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
916
|
+
end
|
917
|
+
return data, status_code, headers
|
918
|
+
end
|
919
|
+
|
920
|
+
# List the submissions for a student
|
921
|
+
# Use this method as a teacher to list all the assignment submissions sent by a student of the class
|
922
|
+
# @param _class Unique identifier of the class
|
923
|
+
# @param user Unique identifier of the user
|
924
|
+
# @param [Hash] opts the optional parameters
|
925
|
+
# @return [Array<AssignmentSubmission>]
|
926
|
+
def list_class_student_submissions(_class, user, opts = {})
|
927
|
+
data, _status_code, _headers = list_class_student_submissions_with_http_info(_class, user, opts)
|
928
|
+
return data
|
929
|
+
end
|
930
|
+
|
931
|
+
# List the submissions for a student
|
932
|
+
# Use this method as a teacher to list all the assignment submissions sent by a student of the class
|
933
|
+
# @param _class Unique identifier of the class
|
934
|
+
# @param user Unique identifier of the user
|
935
|
+
# @param [Hash] opts the optional parameters
|
936
|
+
# @return [Array<(Array<AssignmentSubmission>, Fixnum, Hash)>] Array<AssignmentSubmission> data, response status code and response headers
|
937
|
+
def list_class_student_submissions_with_http_info(_class, user, opts = {})
|
938
|
+
if @api_client.config.debugging
|
939
|
+
@api_client.config.logger.debug "Calling API: ClassApi.list_class_student_submissions ..."
|
940
|
+
end
|
941
|
+
# verify the required parameter '_class' is set
|
942
|
+
if @api_client.config.client_side_validation && _class.nil?
|
943
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.list_class_student_submissions"
|
944
|
+
end
|
945
|
+
# verify the required parameter 'user' is set
|
946
|
+
if @api_client.config.client_side_validation && user.nil?
|
947
|
+
fail ArgumentError, "Missing the required parameter 'user' when calling ClassApi.list_class_student_submissions"
|
948
|
+
end
|
949
|
+
# resource path
|
950
|
+
local_var_path = "/classes/{class}/students/{user}/submissions".sub('{' + 'class' + '}', _class.to_s).sub('{' + 'user' + '}', user.to_s)
|
951
|
+
|
952
|
+
# query parameters
|
953
|
+
query_params = {}
|
954
|
+
|
955
|
+
# header parameters
|
956
|
+
header_params = {}
|
957
|
+
# HTTP header 'Accept' (if needed)
|
958
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
959
|
+
# HTTP header 'Content-Type'
|
960
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
961
|
+
|
962
|
+
# form parameters
|
963
|
+
form_params = {}
|
964
|
+
|
965
|
+
# http body (model)
|
966
|
+
post_body = nil
|
967
|
+
auth_names = ['OAuth2']
|
968
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
969
|
+
:header_params => header_params,
|
970
|
+
:query_params => query_params,
|
971
|
+
:form_params => form_params,
|
972
|
+
:body => post_body,
|
973
|
+
:auth_names => auth_names,
|
974
|
+
:return_type => 'Array<AssignmentSubmission>')
|
975
|
+
if @api_client.config.debugging
|
976
|
+
@api_client.config.logger.debug "API called: ClassApi#list_class_student_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
977
|
+
end
|
978
|
+
return data, status_code, headers
|
979
|
+
end
|
980
|
+
|
981
|
+
# List the classes available for the current user
|
982
|
+
#
|
983
|
+
# @param [Hash] opts the optional parameters
|
984
|
+
# @option opts [String] :state Filter the classes by state (default to active)
|
985
|
+
# @return [Array<ClassDetails>]
|
986
|
+
def list_classes(opts = {})
|
987
|
+
data, _status_code, _headers = list_classes_with_http_info(opts)
|
988
|
+
return data
|
989
|
+
end
|
990
|
+
|
991
|
+
# List the classes available for the current user
|
992
|
+
#
|
993
|
+
# @param [Hash] opts the optional parameters
|
994
|
+
# @option opts [String] :state Filter the classes by state
|
995
|
+
# @return [Array<(Array<ClassDetails>, Fixnum, Hash)>] Array<ClassDetails> data, response status code and response headers
|
996
|
+
def list_classes_with_http_info(opts = {})
|
997
|
+
if @api_client.config.debugging
|
998
|
+
@api_client.config.logger.debug "Calling API: ClassApi.list_classes ..."
|
999
|
+
end
|
1000
|
+
if @api_client.config.client_side_validation && opts[:'state'] && !['active', 'inactive', 'archived'].include?(opts[:'state'])
|
1001
|
+
fail ArgumentError, 'invalid value for "state", must be one of active, inactive, archived'
|
1002
|
+
end
|
1003
|
+
# resource path
|
1004
|
+
local_var_path = "/classes"
|
1005
|
+
|
1006
|
+
# query parameters
|
1007
|
+
query_params = {}
|
1008
|
+
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
1009
|
+
|
1010
|
+
# header parameters
|
1011
|
+
header_params = {}
|
1012
|
+
# HTTP header 'Accept' (if needed)
|
1013
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1014
|
+
# HTTP header 'Content-Type'
|
1015
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1016
|
+
|
1017
|
+
# form parameters
|
1018
|
+
form_params = {}
|
1019
|
+
|
1020
|
+
# http body (model)
|
1021
|
+
post_body = nil
|
1022
|
+
auth_names = ['OAuth2']
|
1023
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1024
|
+
:header_params => header_params,
|
1025
|
+
:query_params => query_params,
|
1026
|
+
:form_params => form_params,
|
1027
|
+
:body => post_body,
|
1028
|
+
:auth_names => auth_names,
|
1029
|
+
:return_type => 'Array<ClassDetails>')
|
1030
|
+
if @api_client.config.debugging
|
1031
|
+
@api_client.config.logger.debug "API called: ClassApi#list_classes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1032
|
+
end
|
1033
|
+
return data, status_code, headers
|
1034
|
+
end
|
1035
|
+
|
1036
|
+
# Unarchive the class
|
1037
|
+
# Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.
|
1038
|
+
# @param _class Unique identifier of the class
|
1039
|
+
# @param [Hash] opts the optional parameters
|
1040
|
+
# @return [ClassDetails]
|
1041
|
+
def unarchive_class(_class, opts = {})
|
1042
|
+
data, _status_code, _headers = unarchive_class_with_http_info(_class, opts)
|
1043
|
+
return data
|
1044
|
+
end
|
1045
|
+
|
1046
|
+
# Unarchive the class
|
1047
|
+
# Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.
|
1048
|
+
# @param _class Unique identifier of the class
|
1049
|
+
# @param [Hash] opts the optional parameters
|
1050
|
+
# @return [Array<(ClassDetails, Fixnum, Hash)>] ClassDetails data, response status code and response headers
|
1051
|
+
def unarchive_class_with_http_info(_class, opts = {})
|
1052
|
+
if @api_client.config.debugging
|
1053
|
+
@api_client.config.logger.debug "Calling API: ClassApi.unarchive_class ..."
|
1054
|
+
end
|
1055
|
+
# verify the required parameter '_class' is set
|
1056
|
+
if @api_client.config.client_side_validation && _class.nil?
|
1057
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.unarchive_class"
|
1058
|
+
end
|
1059
|
+
# resource path
|
1060
|
+
local_var_path = "/classes/{class}/archive".sub('{' + 'class' + '}', _class.to_s)
|
1061
|
+
|
1062
|
+
# query parameters
|
1063
|
+
query_params = {}
|
1064
|
+
|
1065
|
+
# header parameters
|
1066
|
+
header_params = {}
|
1067
|
+
# HTTP header 'Accept' (if needed)
|
1068
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1069
|
+
# HTTP header 'Content-Type'
|
1070
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1071
|
+
|
1072
|
+
# form parameters
|
1073
|
+
form_params = {}
|
1074
|
+
|
1075
|
+
# http body (model)
|
1076
|
+
post_body = nil
|
1077
|
+
auth_names = ['OAuth2']
|
1078
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
1079
|
+
:header_params => header_params,
|
1080
|
+
:query_params => query_params,
|
1081
|
+
:form_params => form_params,
|
1082
|
+
:body => post_body,
|
1083
|
+
:auth_names => auth_names,
|
1084
|
+
:return_type => 'ClassDetails')
|
1085
|
+
if @api_client.config.debugging
|
1086
|
+
@api_client.config.logger.debug "API called: ClassApi#unarchive_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1087
|
+
end
|
1088
|
+
return data, status_code, headers
|
1089
|
+
end
|
1090
|
+
|
1091
|
+
# Update the class
|
1092
|
+
# Update the meta information of the class
|
1093
|
+
# @param _class Unique identifier of the class
|
1094
|
+
# @param [Hash] opts the optional parameters
|
1095
|
+
# @option opts [ClassUpdate] :body Details of the Class
|
1096
|
+
# @return [ClassDetails]
|
1097
|
+
def update_class(_class, opts = {})
|
1098
|
+
data, _status_code, _headers = update_class_with_http_info(_class, opts)
|
1099
|
+
return data
|
1100
|
+
end
|
1101
|
+
|
1102
|
+
# Update the class
|
1103
|
+
# Update the meta information of the class
|
1104
|
+
# @param _class Unique identifier of the class
|
1105
|
+
# @param [Hash] opts the optional parameters
|
1106
|
+
# @option opts [ClassUpdate] :body Details of the Class
|
1107
|
+
# @return [Array<(ClassDetails, Fixnum, Hash)>] ClassDetails data, response status code and response headers
|
1108
|
+
def update_class_with_http_info(_class, opts = {})
|
1109
|
+
if @api_client.config.debugging
|
1110
|
+
@api_client.config.logger.debug "Calling API: ClassApi.update_class ..."
|
1111
|
+
end
|
1112
|
+
# verify the required parameter '_class' is set
|
1113
|
+
if @api_client.config.client_side_validation && _class.nil?
|
1114
|
+
fail ArgumentError, "Missing the required parameter '_class' when calling ClassApi.update_class"
|
1115
|
+
end
|
1116
|
+
# resource path
|
1117
|
+
local_var_path = "/classes/{class}".sub('{' + 'class' + '}', _class.to_s)
|
1118
|
+
|
1119
|
+
# query parameters
|
1120
|
+
query_params = {}
|
1121
|
+
|
1122
|
+
# header parameters
|
1123
|
+
header_params = {}
|
1124
|
+
# HTTP header 'Accept' (if needed)
|
1125
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1126
|
+
# HTTP header 'Content-Type'
|
1127
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1128
|
+
|
1129
|
+
# form parameters
|
1130
|
+
form_params = {}
|
1131
|
+
|
1132
|
+
# http body (model)
|
1133
|
+
post_body = @api_client.object_to_http_body(opts[:'body'])
|
1134
|
+
auth_names = ['OAuth2']
|
1135
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
1136
|
+
:header_params => header_params,
|
1137
|
+
:query_params => query_params,
|
1138
|
+
:form_params => form_params,
|
1139
|
+
:body => post_body,
|
1140
|
+
:auth_names => auth_names,
|
1141
|
+
:return_type => 'ClassDetails')
|
1142
|
+
if @api_client.config.debugging
|
1143
|
+
@api_client.config.logger.debug "API called: ClassApi#update_class\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1144
|
+
end
|
1145
|
+
return data, status_code, headers
|
1146
|
+
end
|
1147
|
+
end
|
1148
|
+
end
|