encode<V> static method
Implementation
static V encode<V>(
TransferCreateOptions instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.amount != null) {
container.encodeInt(
'amount',
instance.amount!,
);
}
container.encodeString(
'currency',
instance.currency,
);
if (instance.description != null) {
container.encodeString(
'description',
instance.description!,
);
}
container.encodeString(
'destination',
instance.destination,
);
if (instance.expand != null) {
container.encodeList(
'expand',
(container) =>
instance.expand!.forEach((el) => container.encodeString(el)),
);
}
if (instance.metadata != null) {
container.encodeMap(
'metadata',
(container) => instance.metadata!.forEach((
key,
value,
) =>
container.encodeString(
key,
value,
)),
);
}
if (instance.sourceTransaction != null) {
container.encodeString(
'source_transaction',
instance.sourceTransaction!,
);
}
if (instance.sourceType != null) {
PayoutSourceType.encode(
instance.sourceType!,
container.nestedSingleValueContainer('source_type').encoder,
);
}
if (instance.transferGroup != null) {
container.encodeString(
'transfer_group',
instance.transferGroup!,
);
}
return container.value;
}