encode<V> static method

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

Implementation

static V encode<V>(
  CustomerTax instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeString(
    'automatic_tax',
    instance.automaticTax,
  );
  if (instance.ipAddress != null) {
    container.encodeString(
      'ip_address',
      instance.ipAddress!,
    );
  }
  if (instance.location != null) {
    CustomerTaxLocation.encode(
      instance.location!,
      container.nestedSingleValueContainer('location').encoder,
    );
  }
  return container.value;
}