fromJson static method

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

Implementation

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

  return StorePaymentPurposePremiumGiftCodes(
    boostedChatId: (json['boosted_chat_id'] as int?) ?? 0,
    currency: (json['currency'] as String?) ?? '',
    amount: (json['amount'] as int?) ?? 0,
    userIds: List<int>.from(
      tdListFromJson(
        json['user_ids'],
      ).map((item) => int.tryParse((item as dynamic)?.toString() ?? '') ?? 0),
    ),
    text: FormattedText.fromJson(tdMapFromJson(json['text'])),
  );
}