encode<V> static method
Implementation
static V encode<V>(
TerminalReaderReaderResourceCart instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
container.encodeString(
'currency',
instance.currency,
);
container.encodeList(
'line_items',
(container) => instance.lineItems
.forEach((el) => TerminalReaderReaderResourceLineItem.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
if (instance.tax != null) {
container.encodeInt(
'tax',
instance.tax!,
);
}
container.encodeInt(
'total',
instance.total,
);
return container.value;
}