encode<V> static method

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

Implementation

static V encode<V>(
  TaxProductResourceLineItemTaxBreakdown instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeInt(
    'amount',
    instance.amount,
  );
  TaxProductResourceJurisdiction.encode(
    instance.jurisdiction,
    container.nestedSingleValueContainer('jurisdiction').encoder,
  );
  container.encodeString(
    'sourcing',
    instance.sourcing,
  );
  if (instance.taxRateDetails != null) {
    TaxProductResourceLineItemTaxBreakdownTaxRateDetails.encode(
      instance.taxRateDetails!,
      container.nestedSingleValueContainer('tax_rate_details').encoder,
    );
  }
  container.encodeString(
    'taxability_reason',
    instance.taxabilityReason,
  );
  container.encodeInt(
    'taxable_amount',
    instance.taxableAmount,
  );
  return container.value;
}