Video constructor

const Video({
  1. required String id,
  2. required String title,
  3. VideoType? type,
  4. @JsonKey(name: 'topic_id') String? topicId,
  5. @JsonKey(name: 'published_at') String? publishedAt,
  6. @JsonKey(name: 'available_at') required String availableAt,
  7. int? duration,
  8. @JsonKey(fromJson: VideoStatus.fromJson, toJson: VideoStatus.toJsonStatic) required VideoStatus status,
  9. @JsonKey(name: 'start_scheduled') String? startScheduled,
  10. @JsonKey(name: 'start_actual') String? startActual,
  11. @JsonKey(name: 'end_actual') String? endActual,
  12. @JsonKey(name: 'live_viewers') int? liveViewers,
  13. String? description,
  14. int? songcount,
  15. @JsonKey(name: 'channel_id') String? channelId,
  16. ChannelMin? channel,
  17. @JsonKey(name: 'lang') String? language,
})

Returns a new Video instance.

Implementation

const factory Video({
  required String id,
  required String title,
  VideoType? type,

  /// corresponds to a Topic ID, Videos of type clip cannot not have topic. Streams may or may not have topic.
  @JsonKey(name: 'topic_id') String? topicId,
  @JsonKey(name: 'published_at') String? publishedAt,

  /// Takes on the first non-null value of end_actual, start_actual, start_scheduled, or published_at
  @JsonKey(name: 'available_at') required String availableAt,

  /// Duration of the video in seconds
  int? duration,
  @JsonKey(fromJson: VideoStatus.fromJson, toJson: VideoStatus.toJsonStatic)
  required VideoStatus status,

  /// Included when includes contains 'live_info'
  @JsonKey(name: 'start_scheduled') String? startScheduled,

  /// Included when includes contains 'live_info'
  @JsonKey(name: 'start_actual') String? startActual,

  /// Included when includes contains 'live_info'
  @JsonKey(name: 'end_actual') String? endActual,

  /// Included when includes contains 'live_info'
  @JsonKey(name: 'live_viewers') int? liveViewers,

  /// Included when includes contains 'description'
  String? description,

  /// Number of tagged songs for this video
  int? songcount,
  @JsonKey(name: 'channel_id') String? channelId,
  ChannelMin? channel,
  @JsonKey(name: 'lang') String? language,
}) = _Video;