encode<V> static method

V encode<V>(
  1. LineItemsTaxAmount instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  LineItemsTaxAmount instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeInt(
    'amount',
    instance.amount,
  );
  TaxRate.encode(
    instance.rate,
    container.nestedSingleValueContainer('rate').encoder,
  );
  if (instance.taxabilityReason != null) {
    CreditNoteTaxAmountTaxabilityReason.encode(
      instance.taxabilityReason!,
      container.nestedSingleValueContainer('taxability_reason').encoder,
    );
  }
  if (instance.taxableAmount != null) {
    container.encodeInt(
      'taxable_amount',
      instance.taxableAmount!,
    );
  }
  return container.value;
}