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

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

Defined Under Namespace

Classes: 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



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
# File 'lib/whop_sdk/models/course.rb', line 178

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

Instance Attribute Details

#idString

The unique identifier for the lesson.

Returns:

  • (String)


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

required :id, String

#lesson_typeSymbol, WhopSDK::Models::LessonTypes

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

Returns:



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

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

#orderInteger

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

Returns:

  • (Integer)


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

required :order, Integer

#thumbnailWhopSDK::Models::Course::Chapter::Lesson::Thumbnail?

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



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

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

#titleString

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

Returns:

  • (String)


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

required :title, String

#video_assetWhopSDK::Models::Course::Chapter::Lesson::VideoAsset?

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



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

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