encode<V> static method

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

Implementation

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