encode<V> static method

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

Implementation

static V encode<V>(
  SessionFinancialConnections instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.permissions != null) {
    container.encodeList(
      'permissions',
      (container) => instance.permissions!
          .forEach((el) => FinancialConnectionsAccountPermissionsItem.encode(
                el,
                container.nestedSingleValueContainer().encoder,
              )),
    );
  }
  if (instance.prefetch != null) {
    container.encodeList(
      'prefetch',
      (container) => instance.prefetch!.forEach((el) =>
          InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetchItem
              .encode(
            el,
            container.nestedSingleValueContainer().encoder,
          )),
    );
  }
  return container.value;
}