TreasuryReceivedCreditCreateOptions.fromJson constructor

TreasuryReceivedCreditCreateOptions.fromJson(
  1. Object? json
)

Implementation

factory TreasuryReceivedCreditCreateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return TreasuryReceivedCreditCreateOptions(
    amount: (map['amount'] as num).toInt(),
    currency: (map['currency'] as String),
    description:
        map['description'] == null ? null : (map['description'] as String),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    financialAccount: (map['financial_account'] as String),
    initiatingPaymentMethodDetails:
        map['initiating_payment_method_details'] == null
            ? null
            : ReceivedCreditInitiatingPaymentMethodDetails.fromJson(
                map['initiating_payment_method_details']),
    network:
        OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork.fromJson(
            map['network']),
  );
}