ChannelVideoFilter constructor

  1. @Assert('limit <= 50', 'The limit cannot be greater than 50')
const ChannelVideoFilter({
  1. @JsonKey(toJson: concatIncludesList, name: 'include', includeIfNull: false) @Default([]) List<Includes> includes,
  2. @JsonKey(toJson: concatLanguageListWithDefault, name: 'lang') @Default([]) List<Language> languages,
  3. @JsonKey(toJson: intToString) @Default(25) int limit,
  4. @JsonKey(toJson: intToString) @Default(0) int offset,
  5. @JsonKey(toJson: paginatedToString) @Default(true) bool paginated,
})

Used to filter the results returns by the Holodex API's channels endpoints

Implementation

@Assert('limit <= 50', 'The limit cannot be greater than 50')
const factory ChannelVideoFilter({
  /// Request extra data be included in the results. They are not guarenteed to be returned.
  @JsonKey(toJson: concatIncludesList, name: 'include', includeIfNull: false)
  @Default([])
  List<Includes> includes,

  /// List of Language enum to filter channels/clips. Official streams do not follow this parameter
  @JsonKey(toJson: concatLanguageListWithDefault, name: 'lang')
  @Default([])
  List<Language> languages,

  /// Result limit. Max of 50.
  @JsonKey(toJson: intToString) @Default(25) int limit,

  /// Offset results
  @JsonKey(toJson: intToString) @Default(0) int offset,

  /// If paginated is set to true, returns [PaginatedVideos] with total, otherwise returns [PaginatedVideos] without the total.
  @JsonKey(toJson: paginatedToString) @Default(true) bool paginated,
}) = _ChannelVideoFilter;