module Bearcat class Client < Footrest::Client module Courses extend ClientModule post :create_course, "/api/v1/accounts/:account_id/courses" get :list_users_courses, "/api/v1/courses" prefix "/api/v1/courses/:course/" do get :course put :update_course delete :delete_course, defaults: { event: "delete" } get :list_course_users, "users" post :course_quiz_extensions, "quiz_extensions" get :course_outcome_results, "outcome_results" get :course_grading_standards, "grading_standards" get :course_grading_standard, "grading_standards/:grading_standard_id" get :course_gradebook_history, "gradebook_history/feed" # Performs effectively the same operation as #create_content_migration, but without the need to specify a file to be uploaded post :copy_course, "content_migrations" get :course_settings, 'settings' get :course_late_policy, 'late_policy' post :create_course_late_policy, 'late_policy' patch :update_course_late_policy, 'late_policy' end def create_content_migration_with_both_responses(course, file_path, params={}) content_migration_response = post("/api/v1/courses/#{course}/content_migrations", params) pre_attachment = content_migration_response['pre_attachment'] confirmation_url = post_file(pre_attachment['upload_url'], pre_attachment['upload_params'], file_path) [content_migration_response, confirm_file_upload(confirmation_url)] end def create_content_migration(course, file_path, params={}) content_migration_response, file_upload_response = create_content_migration_with_both_responses(course, file_path, params) file_upload_response end end end end