encode<V> static method
Implementation
static V encode<V>(
CreditNoteTaxAmount instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
container.encodeInt(
'amount',
instance.amount,
);
container.encodeBool(
'inclusive',
instance.inclusive,
);
TaxRateOrId.encode(
instance.taxRate,
container.nestedSingleValueContainer('tax_rate').encoder,
);
if (instance.taxabilityReason != null) {
container.encodeString(
'taxability_reason',
instance.taxabilityReason!,
);
}
if (instance.taxableAmount != null) {
container.encodeInt(
'taxable_amount',
instance.taxableAmount!,
);
}
return container.value;
}