Class: WhopSDK::Resources::CourseLessonInteractions

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

Overview

Course lesson interactions

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:



79
80
81
# File 'lib/whop_sdk/resources/course_lesson_interactions.rb', line 79

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>

Returns a paginated list of lesson interactions, filtered by lesson, course, user, or completion status.

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 to filter for completed or in-progress lesson interactions.

  • course_id (String, nil)

    The unique identifier of the course to filter 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 unique identifier of the lesson to filter interactions for.

  • user_id (String, nil)

    The unique identifier of the user to filter lesson interactions for.

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

Returns:

See Also:



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

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

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

Retrieves the details of an existing course lesson interaction.

Required permissions:

  • ‘courses:read`

  • ‘course_analytics:read`

Parameters:

  • id (String)

    The unique identifier of the lesson interaction to retrieve.

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

Returns:

See Also:



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

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