encode<V> static method

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

Implementation

static V encode<V>(
  PaymentMethodDetailsCardWallet instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.amexExpressCheckout != null) {
    PaymentMethodDetailsCardWalletAmexExpressCheckout.encode(
      instance.amexExpressCheckout!,
      container.nestedSingleValueContainer('amex_express_checkout').encoder,
    );
  }
  if (instance.applePay != null) {
    PaymentMethodDetailsCardWalletApplePay.encode(
      instance.applePay!,
      container.nestedSingleValueContainer('apple_pay').encoder,
    );
  }
  if (instance.dynamicLast4 != null) {
    container.encodeString(
      'dynamic_last4',
      instance.dynamicLast4!,
    );
  }
  if (instance.googlePay != null) {
    PaymentMethodDetailsCardWalletGooglePay.encode(
      instance.googlePay!,
      container.nestedSingleValueContainer('google_pay').encoder,
    );
  }
  if (instance.link != null) {
    PaymentMethodDetailsCardWalletLink.encode(
      instance.link!,
      container.nestedSingleValueContainer('link').encoder,
    );
  }
  if (instance.masterpass != null) {
    PaymentMethodDetailsCardWalletMasterpass.encode(
      instance.masterpass!,
      container.nestedSingleValueContainer('masterpass').encoder,
    );
  }
  if (instance.samsungPay != null) {
    PaymentMethodDetailsCardWalletSamsungPay.encode(
      instance.samsungPay!,
      container.nestedSingleValueContainer('samsung_pay').encoder,
    );
  }
  PaymentMethodCardWalletType.encode(
    instance.type,
    container.nestedSingleValueContainer('type').encoder,
  );
  if (instance.visaCheckout != null) {
    PaymentMethodDetailsCardWalletVisaCheckout.encode(
      instance.visaCheckout!,
      container.nestedSingleValueContainer('visa_checkout').encoder,
    );
  }
  return container.value;
}