Class: WhopSDK::Models::Course::Chapter

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

Defined Under Namespace

Classes: Lesson

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(id:, certificate_after_completion_enabled:, chapters:, cover_image:, created_at:, description:, language:, order:, require_completing_lessons_in_order:, tagline:, thumbnail:, title:, updated_at:, visibility:) ⇒ Object

Some parameter documentations has been truncated, see WhopSDK::Models::Course for more details.

A structured learning module containing chapters and lessons, belonging to an experience.

Parameters:

  • id (String)

    The unique identifier for the course.

  • certificate_after_completion_enabled (Boolean, nil)

    Whether students receive a PDF certificate after completing all lessons in this

  • chapters (Array<WhopSDK::Models::Course::Chapter>)

    An ordered list of all chapters in this course, sorted by their display position

  • cover_image (String, nil)

    The URL of the course cover image shown on preview cards. Null if no cover image

  • created_at (Time)

    The datetime the course was created.

  • description (String, nil)

    A brief summary of the course content and objectives. Null if no description has

  • language (Symbol, WhopSDK::Models::Languages)

    The spoken language of the video content, used to generate accurate closed capti

  • order (String)

    The sort position of this course within its parent experience, as a decimal for

  • require_completing_lessons_in_order (Boolean)

    Whether students must complete each lesson sequentially before advancing to the

  • tagline (String, nil)

    A short marketing tagline displayed beneath the course title. Null if no tagline

  • thumbnail (WhopSDK::Models::Course::Thumbnail, nil)

    The thumbnail image displayed on course cards and previews. Null if no thumbnail

  • title (String, nil)

    The display name of the course shown to students. Null if no title has been set.

  • updated_at (Time)

    The datetime the course was last updated.

  • visibility (Symbol, WhopSDK::Models::CourseVisibilities)

    The visibility setting that controls whether this course appears to students. On



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/whop_sdk/models/course.rb', line 137

class Chapter < WhopSDK::Internal::Type::BaseModel
  # @!attribute id
  #   The unique identifier for the chapter.
  #
  #   @return [String]
  required :id, String

  # @!attribute lessons
  #   An ordered list of lessons in this chapter, sorted by display position. Hidden
  #   lessons are excluded for non-admin users.
  #
  #   @return [Array<WhopSDK::Models::Course::Chapter::Lesson>]
  required :lessons, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Course::Chapter::Lesson] }

  # @!attribute order
  #   The sort position of this chapter within its parent course, starting from zero.
  #
  #   @return [Integer]
  required :order, Integer

  # @!attribute title
  #   The display name of the chapter shown to students. Maximum 150 characters.
  #
  #   @return [String]
  required :title, String

  # @!method initialize(id:, lessons:, order:, title:)
  #   Some parameter documentations has been truncated, see
  #   {WhopSDK::Models::Course::Chapter} for more details.
  #
  #   A grouping of related lessons within a course, used to organize content into
  #   sections.
  #
  #   @param id [String] The unique identifier for the chapter.
  #
  #   @param lessons [Array<WhopSDK::Models::Course::Chapter::Lesson>] An ordered list of lessons in this chapter, sorted by display position. Hidden l
  #
  #   @param order [Integer] The sort position of this chapter within its parent course, starting from zero.
  #
  #   @param title [String] The display name of the chapter shown to students. Maximum 150 characters.

  class Lesson < WhopSDK::Internal::Type::BaseModel
    # @!attribute id
    #   The unique identifier for the lesson.
    #
    #   @return [String]
    required :id, String

    # @!attribute lesson_type
    #   The content format of this lesson. One of: text, video, pdf, multi, quiz,
    #   knowledge_check.
    #
    #   @return [Symbol, WhopSDK::Models::LessonTypes]
    required :lesson_type, enum: -> { WhopSDK::LessonTypes }

    # @!attribute order
    #   The sort position of this lesson within its parent chapter, starting from zero.
    #
    #   @return [Integer]
    required :order, Integer

    # @!attribute thumbnail
    #   The thumbnail image displayed on lesson cards and previews. Null if no thumbnail
    #   has been uploaded.
    #
    #   @return [WhopSDK::Models::Course::Chapter::Lesson::Thumbnail, nil]
    required :thumbnail, -> { WhopSDK::Course::Chapter::Lesson::Thumbnail }, nil?: true

    # @!attribute title
    #   The display name of the lesson shown to students. Maximum 120 characters.
    #
    #   @return [String]
    required :title, String

    # @!attribute video_asset
    #   The Mux video asset for video-type lessons, used for streaming playback. Null if
    #   this lesson has no hosted video.
    #
    #   @return [WhopSDK::Models::Course::Chapter::Lesson::VideoAsset, nil]
    required :video_asset, -> { WhopSDK::Course::Chapter::Lesson::VideoAsset }, nil?: true

    # @!method initialize(id:, lesson_type:, order:, thumbnail:, title:, video_asset:)
    #   Some parameter documentations has been truncated, see
    #   {WhopSDK::Models::Course::Chapter::Lesson} for more details.
    #
    #   An individual learning unit within a chapter, which can contain text, video,
    #   PDF, or assessment content.
    #
    #   @param id [String] The unique identifier for the lesson.
    #
    #   @param lesson_type [Symbol, WhopSDK::Models::LessonTypes] The content format of this lesson. One of: text, video, pdf, multi, quiz, knowle
    #
    #   @param order [Integer] The sort position of this lesson within its parent chapter, starting from zero.
    #
    #   @param thumbnail [WhopSDK::Models::Course::Chapter::Lesson::Thumbnail, nil] The thumbnail image displayed on lesson cards and previews. Null if no thumbnail
    #
    #   @param title [String] The display name of the lesson shown to students. Maximum 120 characters.
    #
    #   @param video_asset [WhopSDK::Models::Course::Chapter::Lesson::VideoAsset, nil] The Mux video asset for video-type lessons, used for streaming playback. Null if

    # @see WhopSDK::Models::Course::Chapter::Lesson#thumbnail
    class Thumbnail < WhopSDK::Internal::Type::BaseModel
      # @!attribute url
      #   A pre-optimized URL for rendering this attachment on the client. This should be
      #   used for displaying attachments in apps.
      #
      #   @return [String, nil]
      required :url, String, nil?: true

      # @!method initialize(url:)
      #   Some parameter documentations has been truncated, see
      #   {WhopSDK::Models::Course::Chapter::Lesson::Thumbnail} for more details.
      #
      #   The thumbnail image displayed on lesson cards and previews. Null if no thumbnail
      #   has been uploaded.
      #
      #   @param url [String, nil] A pre-optimized URL for rendering this attachment on the client. This should be
    end

    # @see WhopSDK::Models::Course::Chapter::Lesson#video_asset
    class VideoAsset < WhopSDK::Internal::Type::BaseModel
      # @!attribute duration_seconds
      #   The duration of the video in seconds
      #
      #   @return [Integer, nil]
      required :duration_seconds, Integer, nil?: true

      # @!attribute signed_playback_id
      #   The signed playback ID of the Mux asset
      #
      #   @return [String, nil]
      required :signed_playback_id, String, nil?: true

      # @!attribute signed_thumbnail_playback_token
      #   The signed thumbnail playback token of the Mux asset
      #
      #   @return [String, nil]
      required :signed_thumbnail_playback_token, String, nil?: true

      # @!method initialize(duration_seconds:, signed_playback_id:, signed_thumbnail_playback_token:)
      #   The Mux video asset for video-type lessons, used for streaming playback. Null if
      #   this lesson has no hosted video.
      #
      #   @param duration_seconds [Integer, nil] The duration of the video in seconds
      #
      #   @param signed_playback_id [String, nil] The signed playback ID of the Mux asset
      #
      #   @param signed_thumbnail_playback_token [String, nil] The signed thumbnail playback token of the Mux asset
    end
  end
end

Instance Attribute Details

#idString

The unique identifier for the chapter.

Returns:

  • (String)


142
# File 'lib/whop_sdk/models/course.rb', line 142

required :id, String

#lessonsArray<WhopSDK::Models::Course::Chapter::Lesson>

An ordered list of lessons in this chapter, sorted by display position. Hidden lessons are excluded for non-admin users.



149
# File 'lib/whop_sdk/models/course.rb', line 149

required :lessons, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Course::Chapter::Lesson] }

#orderInteger

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

Returns:

  • (Integer)


155
# File 'lib/whop_sdk/models/course.rb', line 155

required :order, Integer

#titleString

The display name of the chapter shown to students. Maximum 150 characters.

Returns:

  • (String)


161
# File 'lib/whop_sdk/models/course.rb', line 161

required :title, String