Class: WhopSDK::Resources::CourseLessonInteractions

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/course_lesson_interactions.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CourseLessonInteractions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CourseLessonInteractions.

Parameters:



76
77
78
# File 'lib/whop_sdk/resources/course_lesson_interactions.rb', line 76

def initialize(client:)
  @client = client
end

Instance Method Details

#list(after: nil, before: nil, completed: nil, course_id: nil, first: nil, last: nil, lesson_id: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::CourseLessonInteractionListItem>

Lists course lesson interactions

Required permissions:

  • ‘courses:read`

  • ‘course_analytics:read`

Parameters:

  • after (String, nil)

    Returns the elements in the list that come after the specified cursor.

  • before (String, nil)

    Returns the elements in the list that come before the specified cursor.

  • completed (Boolean, nil)

    Whether the lesson has been completed by the user

  • course_id (String, nil)

    The ID of the course to list course lesson interactions for

  • first (Integer, nil)

    Returns the first n elements from the list.

  • last (Integer, nil)

    Returns the last n elements from the list.

  • lesson_id (String, nil)

    The ID of the lesson to list course lesson interactions for

  • user_id (String, nil)

    The ID of the user to list course lesson interactions for

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/whop_sdk/resources/course_lesson_interactions.rb', line 61

def list(params = {})
  parsed, options = WhopSDK::CourseLessonInteractionListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "course_lesson_interactions",
    query: parsed,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::CourseLessonInteractionListItem,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::CourseLessonInteraction

Retrieves a course lesson interaction by ID

Required permissions:

  • ‘courses:read`

  • ‘course_analytics:read`

Parameters:

  • id (String)

    The ID of the course lesson interaction

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



22
23
24
25
26
27
28
29
# File 'lib/whop_sdk/resources/course_lesson_interactions.rb', line 22

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["course_lesson_interactions/%1$s", id],
    model: WhopSDK::CourseLessonInteraction,
    options: params[:request_options]
  )
end