Gift constructor

const Gift({
  1. @JsonKey(name: 'id') required String id,
  2. @JsonKey(name: 'sticker') required Sticker sticker,
  3. @JsonKey(name: 'star_count') required int starCount,
  4. @JsonKey(name: 'total_count') int? totalCount,
  5. @JsonKey(name: 'remaining_count') int? remainingCount,
  6. @JsonKey(name: 'upgrade_star_count') int? upgradeStarCount,
  7. @JsonKey(name: 'publisher_chat') Chat? publisherChat,
})

Creates a Gift object.

Implementation

const factory Gift({
  /// Unique identifier of the gift.
  @JsonKey(name: 'id') required String id,

  /// The sticker that represents the gift.
  @JsonKey(name: 'sticker') required Sticker sticker,

  /// The number of Telegram Stars that must be paid to send the sticker.
  @JsonKey(name: 'star_count') required int starCount,

  /// Optional. The total number of gifts of this type that can be sent; for
  /// limited gifts only.
  @JsonKey(name: 'total_count') int? totalCount,

  /// Optional. The number of remaining gifts of this type that can be sent;
  /// for limited gifts only.
  @JsonKey(name: 'remaining_count') int? remainingCount,

  /// Optional. The number of Telegram Stars that must be paid to upgrade the
  /// gift to a unique one.
  @JsonKey(name: 'upgrade_star_count') int? upgradeStarCount,

  /// Optional. Information about the chat that published the gift
  @JsonKey(name: 'publisher_chat') Chat? publisherChat,
}) = _Gift;