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