encode<V> static method

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

Implementation

static V encode<V>(
  TaxProductResourceCustomerDetailsAddress instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.city != null) {
    container.encodeString(
      'city',
      instance.city!,
    );
  }
  container.encodeString(
    'country',
    instance.country,
  );
  if (instance.line1 != null) {
    container.encodeString(
      'line1',
      instance.line1!,
    );
  }
  if (instance.line2 != null) {
    container.encodeString(
      'line2',
      instance.line2!,
    );
  }
  if (instance.postalCode != null) {
    container.encodeString(
      'postal_code',
      instance.postalCode!,
    );
  }
  if (instance.state != null) {
    container.encodeString(
      'state',
      instance.state!,
    );
  }
  return container.value;
}