InputPaidMedia class sealed

This object describes the paid media to be sent. Currently, it can be one of InputPaidMediaPhoto or InputPaidMediaVideo.

Available extensions
Annotations
  • @Freezed.new(fromJson: false, toJson: true)

Constructors

InputPaidMedia.photo({@Default.new(InputPaidMediaType.photo) InputPaidMediaType type, @InputFileConverter() required InputFile media})
The paid media to send is a photo.
const
factory
InputPaidMedia.video({@Default.new(InputPaidMediaType.video) @JsonKey.new(name: 'type') InputPaidMediaType type, @InputFileConverter() @JsonKey.new(name: 'media') required InputFile media, @InputFileConverter() @JsonKey.new(name: 'thumbnail') InputFile? thumbnail, @JsonKey.new(name: 'width') int? width, @JsonKey.new(name: 'height') int? height, @JsonKey.new(name: 'duration') int? duration, @JsonKey.new(name: 'supports_streaming') bool? supportsStreaming, @JsonKey.new(name: 'start_timestamp') int? startTimestamp, @InputFileConverter() @JsonKey.new(name: 'cover') InputFile? cover})
The paid media to send is a video.
const
factory

Properties

copyWith → $InputPaidMediaCopyWith<InputPaidMedia>
Create a copy of InputPaidMedia with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
media InputFile
File to send.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type InputPaidMediaType
Type of the media, must be "photo"
no setterinherited

Methods

map<TResult extends Object?>({required TResult photo(InputPaidMediaPhoto value), required TResult video(InputPaidMediaVideo value)}) → TResult

Available on InputPaidMedia, provided by the InputPaidMediaPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? photo(InputPaidMediaPhoto value)?, TResult? video(InputPaidMediaVideo value)?}) → TResult?

Available on InputPaidMedia, provided by the InputPaidMediaPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult photo(InputPaidMediaPhoto value)?, TResult video(InputPaidMediaVideo value)?, required TResult orElse()}) → TResult

Available on InputPaidMedia, provided by the InputPaidMediaPatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this InputPaidMedia to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited