encode<V> static method

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

Implementation

static V encode<V>(
  SetupAttemptPaymentMethodDetailsCardWallet instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.applePay != null) {
    PaymentMethodDetailsCardWalletApplePay.encode(
      instance.applePay!,
      container.nestedSingleValueContainer('apple_pay').encoder,
    );
  }
  if (instance.googlePay != null) {
    PaymentMethodDetailsCardWalletGooglePay.encode(
      instance.googlePay!,
      container.nestedSingleValueContainer('google_pay').encoder,
    );
  }
  container.encodeString(
    'type',
    instance.type,
  );
  return container.value;
}