encode<V> static method

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

Implementation

static V encode<V>(
  UsBankAccountNetworks instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.preferred != null) {
    container.encodeString(
      'preferred',
      instance.preferred!,
    );
  }
  container.encodeList(
    'supported',
    (container) => instance.supported.forEach((el) =>
        OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork.encode(
          el,
          container.nestedSingleValueContainer().encoder,
        )),
  );
  return container.value;
}