TreasuryTransactionEntry.fromJson constructor

TreasuryTransactionEntry.fromJson(
  1. Object? json
)

Implementation

factory TreasuryTransactionEntry.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return TreasuryTransactionEntry(
    balanceImpact: TreasuryTransactionsResourceBalanceImpact.fromJson(
        map['balance_impact']),
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    currency: (map['currency'] as String),
    effectiveAt: DateTime.fromMillisecondsSinceEpoch(
        (map['effective_at'] as int).toInt()),
    financialAccount: (map['financial_account'] as String),
    flow: map['flow'] == null ? null : (map['flow'] as String),
    flowDetails: map['flow_details'] == null
        ? null
        : TreasuryTransactionFlowDetails.fromJson(map['flow_details']),
    flowType: TreasuryTransactionFlowDetailsType.fromJson(map['flow_type']),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    transaction: TreasuryTransactionOrId.fromJson(map['transaction']),
    type: TreasuryTransactionEntryType.fromJson(map['type']),
  );
}