fromJson static method

ChatBoostSourceGiveaway? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static ChatBoostSourceGiveaway? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return ChatBoostSourceGiveaway(
    userId: (json['user_id'] as int?) ?? 0,
    giftCode: (json['gift_code'] as String?) ?? '',
    starCount: (json['star_count'] as int?) ?? 0,
    giveawayMessageId: (json['giveaway_message_id'] as int?) ?? 0,
    isUnclaimed: (json['is_unclaimed'] as bool?) ?? false,
  );
}