encode<V> static method

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

Implementation

static V encode<V>(
  CustomerCreateFundingInstructionsOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  CustomerBankTransfer.encode(
    instance.bankTransfer,
    container.nestedSingleValueContainer('bank_transfer').encoder,
  );
  container.encodeString(
    'currency',
    instance.currency,
  );
  if (instance.expand != null) {
    container.encodeList(
      'expand',
      (container) =>
          instance.expand!.forEach((el) => container.encodeString(el)),
    );
  }
  container.encodeString(
    'funding_type',
    'bank_transfer',
  );
  return container.value;
}