Class: WhopSDK::Models::Lesson

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/lesson.rb

Overview

Defined Under Namespace

Classes: AssessmentQuestion, Attachment, MainPdf, Thumbnail, VideoAsset

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(url:) ⇒ Object

Some parameter documentations has been truncated, see Thumbnail for more details.

The thumbnail image displayed on lesson cards and previews. Null if no thumbnail has been uploaded.

Parameters:

  • url (String, nil)

    A pre-optimized URL for rendering this attachment on the client. This should be



# File 'lib/whop_sdk/models/lesson.rb', line 288

Instance Attribute Details

#assessment_questionsArray<WhopSDK::Models::Lesson::AssessmentQuestion>

The list of questions for quiz or knowledge check lessons. Empty for non-assessment lesson types.



18
19
# File 'lib/whop_sdk/models/lesson.rb', line 18

required :assessment_questions,
-> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Lesson::AssessmentQuestion] }

#attachmentsArray<WhopSDK::Models::Lesson::Attachment>

All supplementary files attached to this lesson returned as a flat array rather than a paginated connection.



26
# File 'lib/whop_sdk/models/lesson.rb', line 26

required :attachments, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Lesson::Attachment] }

#contentString?

The Markdown content body of the lesson. Null if the lesson has no text content.

Returns:

  • (String, nil)


32
# File 'lib/whop_sdk/models/lesson.rb', line 32

required :content, String, nil?: true

#created_atTime

The datetime the lesson was created.

Returns:

  • (Time)


38
# File 'lib/whop_sdk/models/lesson.rb', line 38

required :created_at, Time

#days_from_course_start_until_unlockInteger?

The number of days after a student starts the course before this lesson becomes accessible. Null if the lesson is available immediately.

Returns:

  • (Integer, nil)


45
# File 'lib/whop_sdk/models/lesson.rb', line 45

required :days_from_course_start_until_unlock, Integer, nil?: true

#embed_idString?

The external video identifier for embedded video lessons, such as a YouTube video ID or Loom share ID. Null if the lesson has no embed.

Returns:

  • (String, nil)


52
# File 'lib/whop_sdk/models/lesson.rb', line 52

required :embed_id, String, nil?: true

#embed_typeSymbol, ...

The type of embed for a lesson

Returns:



58
# File 'lib/whop_sdk/models/lesson.rb', line 58

required :embed_type, enum: -> { WhopSDK::EmbedType }, nil?: true

#idString

The unique identifier for the lesson.

Returns:

  • (String)


11
# File 'lib/whop_sdk/models/lesson.rb', line 11

required :id, String

#lesson_typeSymbol, WhopSDK::Models::LessonTypes

The content format of this lesson. One of: text, video, pdf, multi, quiz, knowledge_check.

Returns:



65
# File 'lib/whop_sdk/models/lesson.rb', line 65

required :lesson_type, enum: -> { WhopSDK::LessonTypes }

#main_pdfWhopSDK::Models::Lesson::MainPdf?

The primary PDF document for PDF-type lessons. Null if this lesson is not a PDF lesson or no PDF has been uploaded.



72
# File 'lib/whop_sdk/models/lesson.rb', line 72

required :main_pdf, -> { WhopSDK::Lesson::MainPdf }, nil?: true

#orderInteger

The sort position of this lesson within its parent chapter, starting from zero.

Returns:

  • (Integer)


78
# File 'lib/whop_sdk/models/lesson.rb', line 78

required :order, Integer

#thumbnailWhopSDK::Models::Lesson::Thumbnail?

The thumbnail image displayed on lesson cards and previews. Null if no thumbnail has been uploaded.



85
# File 'lib/whop_sdk/models/lesson.rb', line 85

required :thumbnail, -> { WhopSDK::Lesson::Thumbnail }, nil?: true

#titleString

The display name of the lesson shown to students. Maximum 120 characters.

Returns:

  • (String)


91
# File 'lib/whop_sdk/models/lesson.rb', line 91

required :title, String

#video_assetWhopSDK::Models::Lesson::VideoAsset?

The Mux video asset for video-type lessons, used for streaming playback. Null if this lesson has no hosted video.



98
# File 'lib/whop_sdk/models/lesson.rb', line 98

required :video_asset, -> { WhopSDK::Lesson::VideoAsset }, nil?: true

#visibilitySymbol, WhopSDK::Models::LessonVisibilities

The visibility setting that controls whether this lesson appears to students. One of: visible, hidden.



105
# File 'lib/whop_sdk/models/lesson.rb', line 105

required :visibility, enum: -> { WhopSDK::LessonVisibilities }