encode<V> static method

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

Implementation

static V encode<V>(
  CheckoutCustomerBalanceBankTransferPaymentMethodOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.euBankTransfer != null) {
    PaymentMethodOptionsCustomerBalanceEuBankAccount.encode(
      instance.euBankTransfer!,
      container.nestedSingleValueContainer('eu_bank_transfer').encoder,
    );
  }
  if (instance.requestedAddressTypes != null) {
    container.encodeList(
      'requested_address_types',
      (container) => instance.requestedAddressTypes!
          .forEach((el) => container.encodeString(el)),
    );
  }
  if (instance.type != null) {
    container.encodeString(
      'type',
      instance.type!,
    );
  }
  return container.value;
}