GiftUpgradePreview.fromJson constructor

GiftUpgradePreview.fromJson(
  1. Map<String, dynamic> json
)

Parses a GiftUpgradePreview from TDLib JSON.

Implementation

factory GiftUpgradePreview.fromJson(Map<String, dynamic> json) =>
    GiftUpgradePreview(
      models: _readList<UpgradedGiftModel>(
        json['models'],
        (e) => _readObject(e, UpgradedGiftModel.fromJson),
      ),
      symbols: _readList<UpgradedGiftSymbol>(
        json['symbols'],
        (e) => _readObject(e, UpgradedGiftSymbol.fromJson),
      ),
      backdrops: _readList<UpgradedGiftBackdrop>(
        json['backdrops'],
        (e) => _readObject(e, UpgradedGiftBackdrop.fromJson),
      ),
      prices: _readList<GiftUpgradePrice>(
        json['prices'],
        (e) => _readObject(e, GiftUpgradePrice.fromJson),
      ),
      nextPrices: _readList<GiftUpgradePrice>(
        json['next_prices'],
        (e) => _readObject(e, GiftUpgradePrice.fromJson),
      ),
      extra: json['@extra'],
      clientId: _readClientId(json['@client_id']),
    );