encode<V> static method
Implementation
static V encode<V>(
TreasuryReceivedCreditCreateOptions instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
container.encodeInt(
'amount',
instance.amount,
);
container.encodeString(
'currency',
instance.currency,
);
if (instance.description != null) {
container.encodeString(
'description',
instance.description!,
);
}
if (instance.expand != null) {
container.encodeList(
'expand',
(container) =>
instance.expand!.forEach((el) => container.encodeString(el)),
);
}
container.encodeString(
'financial_account',
instance.financialAccount,
);
if (instance.initiatingPaymentMethodDetails != null) {
ReceivedCreditInitiatingPaymentMethodDetails.encode(
instance.initiatingPaymentMethodDetails!,
container
.nestedSingleValueContainer('initiating_payment_method_details')
.encoder,
);
}
OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork.encode(
instance.network,
container.nestedSingleValueContainer('network').encoder,
);
return container.value;
}