encode<V> static method

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

Implementation

static V encode<V>(
  PaymentMethodUpdateOptionsCard instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.expMonth != null) {
    container.encodeInt(
      'exp_month',
      instance.expMonth!,
    );
  }
  if (instance.expYear != null) {
    container.encodeInt(
      'exp_year',
      instance.expYear!,
    );
  }
  if (instance.networks != null) {
    PaymentMethodUpdateOptionsCardNetworks.encode(
      instance.networks!,
      container.nestedSingleValueContainer('networks').encoder,
    );
  }
  return container.value;
}