encode<V> static method

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

Implementation

static V encode<V>(
  PaymentMethodConfigurationCreateOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.acssDebit != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.acssDebit!,
      container.nestedSingleValueContainer('acss_debit').encoder,
    );
  }
  if (instance.affirm != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.affirm!,
      container.nestedSingleValueContainer('affirm').encoder,
    );
  }
  if (instance.afterpayClearpay != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.afterpayClearpay!,
      container.nestedSingleValueContainer('afterpay_clearpay').encoder,
    );
  }
  if (instance.alipay != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.alipay!,
      container.nestedSingleValueContainer('alipay').encoder,
    );
  }
  if (instance.applePay != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.applePay!,
      container.nestedSingleValueContainer('apple_pay').encoder,
    );
  }
  if (instance.applePayLater != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.applePayLater!,
      container.nestedSingleValueContainer('apple_pay_later').encoder,
    );
  }
  if (instance.auBecsDebit != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.auBecsDebit!,
      container.nestedSingleValueContainer('au_becs_debit').encoder,
    );
  }
  if (instance.bacsDebit != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.bacsDebit!,
      container.nestedSingleValueContainer('bacs_debit').encoder,
    );
  }
  if (instance.bancontact != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.bancontact!,
      container.nestedSingleValueContainer('bancontact').encoder,
    );
  }
  if (instance.blik != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.blik!,
      container.nestedSingleValueContainer('blik').encoder,
    );
  }
  if (instance.boleto != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.boleto!,
      container.nestedSingleValueContainer('boleto').encoder,
    );
  }
  if (instance.card != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.card!,
      container.nestedSingleValueContainer('card').encoder,
    );
  }
  if (instance.cartesBancaires != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.cartesBancaires!,
      container.nestedSingleValueContainer('cartes_bancaires').encoder,
    );
  }
  if (instance.cashapp != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.cashapp!,
      container.nestedSingleValueContainer('cashapp').encoder,
    );
  }
  if (instance.customerBalance != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.customerBalance!,
      container.nestedSingleValueContainer('customer_balance').encoder,
    );
  }
  if (instance.eps != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.eps!,
      container.nestedSingleValueContainer('eps').encoder,
    );
  }
  if (instance.expand != null) {
    container.encodeList(
      'expand',
      (container) =>
          instance.expand!.forEach((el) => container.encodeString(el)),
    );
  }
  if (instance.fpx != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.fpx!,
      container.nestedSingleValueContainer('fpx').encoder,
    );
  }
  if (instance.giropay != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.giropay!,
      container.nestedSingleValueContainer('giropay').encoder,
    );
  }
  if (instance.googlePay != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.googlePay!,
      container.nestedSingleValueContainer('google_pay').encoder,
    );
  }
  if (instance.grabpay != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.grabpay!,
      container.nestedSingleValueContainer('grabpay').encoder,
    );
  }
  if (instance.ideal != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.ideal!,
      container.nestedSingleValueContainer('ideal').encoder,
    );
  }
  if (instance.jcb != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.jcb!,
      container.nestedSingleValueContainer('jcb').encoder,
    );
  }
  if (instance.klarna != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.klarna!,
      container.nestedSingleValueContainer('klarna').encoder,
    );
  }
  if (instance.konbini != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.konbini!,
      container.nestedSingleValueContainer('konbini').encoder,
    );
  }
  if (instance.link != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.link!,
      container.nestedSingleValueContainer('link').encoder,
    );
  }
  if (instance.name != null) {
    container.encodeString(
      'name',
      instance.name!,
    );
  }
  if (instance.oxxo != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.oxxo!,
      container.nestedSingleValueContainer('oxxo').encoder,
    );
  }
  if (instance.p24 != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.p24!,
      container.nestedSingleValueContainer('p24').encoder,
    );
  }
  if (instance.parent != null) {
    container.encodeString(
      'parent',
      instance.parent!,
    );
  }
  if (instance.paynow != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.paynow!,
      container.nestedSingleValueContainer('paynow').encoder,
    );
  }
  if (instance.paypal != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.paypal!,
      container.nestedSingleValueContainer('paypal').encoder,
    );
  }
  if (instance.promptpay != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.promptpay!,
      container.nestedSingleValueContainer('promptpay').encoder,
    );
  }
  if (instance.revolutPay != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.revolutPay!,
      container.nestedSingleValueContainer('revolut_pay').encoder,
    );
  }
  if (instance.sepaDebit != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.sepaDebit!,
      container.nestedSingleValueContainer('sepa_debit').encoder,
    );
  }
  if (instance.sofort != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.sofort!,
      container.nestedSingleValueContainer('sofort').encoder,
    );
  }
  if (instance.usBankAccount != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.usBankAccount!,
      container.nestedSingleValueContainer('us_bank_account').encoder,
    );
  }
  if (instance.wechatPay != null) {
    PaymentMethodConfigurationAcssDebit.encode(
      instance.wechatPay!,
      container.nestedSingleValueContainer('wechat_pay').encoder,
    );
  }
  return container.value;
}