encode<V> static method

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

Implementation

static V encode<V>(
  SessionAccountHolder instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.account != null) {
    container.encodeString(
      'account',
      instance.account!,
    );
  }
  if (instance.customer != null) {
    container.encodeString(
      'customer',
      instance.customer!,
    );
  }
  BankConnectionsResourceAccountholderType.encode(
    instance.type,
    container.nestedSingleValueContainer('type').encoder,
  );
  return container.value;
}