encode<V> static method
Implementation
static V encode<V>(
PaymentPagesCheckoutSessionShippingCost instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
container.encodeInt(
'amount_subtotal',
instance.amountSubtotal,
);
container.encodeInt(
'amount_tax',
instance.amountTax,
);
container.encodeInt(
'amount_total',
instance.amountTotal,
);
if (instance.shippingRate != null) {
ShippingRateOrId.encode(
instance.shippingRate!,
container.nestedSingleValueContainer('shipping_rate').encoder,
);
}
if (instance.taxes != null) {
container.encodeList(
'taxes',
(container) =>
instance.taxes!.forEach((el) => LineItemsTaxAmount.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
return container.value;
}