PaidMedia.preview constructor

  1. @Assert('type == PaidMediaType.preview', 'type must be PaidMediaType.preview')
const PaidMedia.preview({
  1. @Default(PaidMediaType.preview) @JsonKey(name: 'type') PaidMediaType type,
  2. @JsonKey(name: 'width') int? width,
  3. @JsonKey(name: 'height') int? height,
  4. @JsonKey(name: 'duration') int? duration,
})

Preview of paid media

Implementation

@Assert(
  'type == PaidMediaType.preview',
  'type must be PaidMediaType.preview',
)
const factory PaidMedia.preview({
  /// Type of the paid media, must be "preview"
  @Default(PaidMediaType.preview) @JsonKey(name: 'type') PaidMediaType type,

  /// Optional. Media width as defined by the sender.
  @JsonKey(name: 'width') final int? width,

  /// Optional. Media height as defined by the sender.
  @JsonKey(name: 'height') final int? height,

  /// Optional. Duration of the media in seconds as defined by the sender.
  @JsonKey(name: 'duration') final int? duration,
}) = PaidMediaPreview;