PaidMedia.livePhoto constructor

  1. @Assert.new('type == PaidMediaType.livePhoto', 'type must be PaidMediaType.livePhoto')
const PaidMedia.livePhoto({
  1. @Default.new(PaidMediaType.livePhoto) @JsonKey.new(name: 'type') PaidMediaType type,
  2. @JsonKey.new(name: 'live_photo') required LivePhoto livePhoto,
})

Live photo paid media

Implementation

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

  /// The photo.
  @JsonKey(name: 'live_photo') required final LivePhoto livePhoto,
}) = PaidMediaLivePhoto;