encode<V> static method
Implementation
static V encode<V>(
SubscriptionScheduleAddInvoiceItem instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
SubscriptionScheduleAddInvoiceItemPriceOrId.encode(
instance.price,
container.nestedSingleValueContainer('price').encoder,
);
if (instance.quantity != null) {
container.encodeInt(
'quantity',
instance.quantity!,
);
}
if (instance.taxRates != null) {
container.encodeList(
'tax_rates',
(container) => instance.taxRates!.forEach((el) => TaxRate.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
return container.value;
}