encode<V> static method

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

Implementation

static V encode<V>(
  InvoiceLineItemTaxRateData instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.country != null) {
    container.encodeString(
      'country',
      instance.country!,
    );
  }
  if (instance.description != null) {
    container.encodeString(
      'description',
      instance.description!,
    );
  }
  container.encodeString(
    'display_name',
    instance.displayName,
  );
  container.encodeBool(
    'inclusive',
    instance.inclusive,
  );
  if (instance.jurisdiction != null) {
    container.encodeString(
      'jurisdiction',
      instance.jurisdiction!,
    );
  }
  container.encodeDouble(
    'percentage',
    instance.percentage,
  );
  if (instance.state != null) {
    container.encodeString(
      'state',
      instance.state!,
    );
  }
  if (instance.taxType != null) {
    TaxProductResourceLineItemTaxBreakdownTaxRateDetailsTaxType.encode(
      instance.taxType!,
      container.nestedSingleValueContainer('tax_type').encoder,
    );
  }
  return container.value;
}