encode<V> static method

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

Implementation

static V encode<V>(
  TreasuryFinancialAccountsResourceFinancialAddress instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.aba != null) {
    TreasuryFinancialAccountsResourceAbaRecord.encode(
      instance.aba!,
      container.nestedSingleValueContainer('aba').encoder,
    );
  }
  if (instance.supportedNetworks != null) {
    container.encodeList(
      'supported_networks',
      (container) => instance.supportedNetworks!.forEach((el) =>
          OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork.encode(
            el,
            container.nestedSingleValueContainer().encoder,
          )),
    );
  }
  container.encodeString(
    'type',
    'aba',
  );
  return container.value;
}