TreasuryInboundTransferCreateOptions.fromJson constructor

TreasuryInboundTransferCreateOptions.fromJson(
  1. Object? json
)

Implementation

factory TreasuryInboundTransferCreateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return TreasuryInboundTransferCreateOptions(
    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),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    originPaymentMethod: (map['origin_payment_method'] as String),
    statementDescriptor: map['statement_descriptor'] == null
        ? null
        : (map['statement_descriptor'] as String),
  );
}