Class: LMSGraphQL::Mutations::Canvas::EnrollUserSection

Inherits:
BaseMutation
  • Object
show all
Defined in:
lib/lms_graphql/mutations/canvas/enroll_user_sections.rb

Instance Method Summary collapse

Instance Method Details

#resolve(section_id:, enrollment_start_at: nil, enrollment_end_at: nil, enrollment_user_id:, enrollment_type:, enrollment_role: nil, enrollment_role_id: nil, enrollment_enrollment_state: nil, enrollment_course_section_id: nil, enrollment_limit_privileges_to_course_section: nil, enrollment_notify: nil, enrollment_self_enrollment_code: nil, enrollment_self_enrolled: nil, enrollment_associated_user_id: nil) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/lms_graphql/mutations/canvas/enroll_user_sections.rb', line 25

def resolve(section_id:, enrollment_start_at: nil, enrollment_end_at: nil, enrollment_user_id:, enrollment_type:, enrollment_role: nil, enrollment_role_id: nil, enrollment_enrollment_state: nil, enrollment_course_section_id: nil, enrollment_limit_privileges_to_course_section: nil, enrollment_notify: nil, enrollment_self_enrollment_code: nil, enrollment_self_enrolled: nil, enrollment_associated_user_id: nil)
  context[:canvas_api].call("ENROLL_USER_SECTIONS").proxy(
    "ENROLL_USER_SECTIONS",
    {
      "section_id": section_id
    },
    {
      "enrollment[start_at]": enrollment_start_at,
      "enrollment[end_at]": enrollment_end_at,
      "enrollment[user_id]": enrollment_user_id,
      "enrollment[type]": enrollment_type,
      "enrollment[role]": enrollment_role,
      "enrollment[role_id]": enrollment_role_id,
      "enrollment[enrollment_state]": enrollment_enrollment_state,
      "enrollment[course_section_id]": enrollment_course_section_id,
      "enrollment[limit_privileges_to_course_section]": enrollment_limit_privileges_to_course_section,
      "enrollment[notify]": enrollment_notify,
      "enrollment[self_enrollment_code]": enrollment_self_enrollment_code,
      "enrollment[self_enrolled]": enrollment_self_enrolled,
      "enrollment[associated_user_id]": enrollment_associated_user_id
    },
  ).parsed_response
end