encode<V> static method

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

Implementation

static V encode<V>(
  SourceTypeIdeal instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.bank != null) {
    container.encodeString(
      'bank',
      instance.bank!,
    );
  }
  if (instance.bic != null) {
    container.encodeString(
      'bic',
      instance.bic!,
    );
  }
  if (instance.ibanLast4 != null) {
    container.encodeString(
      'iban_last4',
      instance.ibanLast4!,
    );
  }
  if (instance.statementDescriptor != null) {
    container.encodeString(
      'statement_descriptor',
      instance.statementDescriptor!,
    );
  }
  return container.value;
}