encode<V> static method
Implementation
static V encode<V>(
SessionPriceData instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
container.encodeString(
'currency',
instance.currency,
);
if (instance.product != null) {
container.encodeString(
'product',
instance.product!,
);
}
if (instance.productData != null) {
SessionProductData.encode(
instance.productData!,
container.nestedSingleValueContainer('product_data').encoder,
);
}
if (instance.recurring != null) {
SessionRecurring.encode(
instance.recurring!,
container.nestedSingleValueContainer('recurring').encoder,
);
}
if (instance.taxBehavior != null) {
ShippingRateCurrencyOptionTaxBehavior.encode(
instance.taxBehavior!,
container.nestedSingleValueContainer('tax_behavior').encoder,
);
}
if (instance.unitAmount != null) {
container.encodeInt(
'unit_amount',
instance.unitAmount!,
);
}
if (instance.unitAmountDecimal != null) {
container.encodeString(
'unit_amount_decimal',
instance.unitAmountDecimal!,
);
}
return container.value;
}