encode<V> static method

Implementation

static V encode<V>(
  CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer
      instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.euBankTransfer != null) {
    CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceEuBankTransfer
        .encode(
      instance.euBankTransfer!,
      container.nestedSingleValueContainer('eu_bank_transfer').encoder,
    );
  }
  if (instance.gbBankTransfer != null) {
    CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceGbBankTransfer
        .encode(
      instance.gbBankTransfer!,
      container.nestedSingleValueContainer('gb_bank_transfer').encoder,
    );
  }
  if (instance.jpBankTransfer != null) {
    CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceJpBankTransfer
        .encode(
      instance.jpBankTransfer!,
      container.nestedSingleValueContainer('jp_bank_transfer').encoder,
    );
  }
  if (instance.reference != null) {
    container.encodeString(
      'reference',
      instance.reference!,
    );
  }
  container.encodeString(
    'type',
    instance.type,
  );
  if (instance.usBankTransfer != null) {
    CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransfer
        .encode(
      instance.usBankTransfer!,
      container.nestedSingleValueContainer('us_bank_transfer').encoder,
    );
  }
  return container.value;
}