encode<V> static method

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

Implementation

static V encode<V>(
  TreasuryFinancialAccountFeatures instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.cardIssuing != null) {
    TreasuryFinancialAccountsResourceToggleSettings.encode(
      instance.cardIssuing!,
      container.nestedSingleValueContainer('card_issuing').encoder,
    );
  }
  if (instance.depositInsurance != null) {
    TreasuryFinancialAccountsResourceToggleSettings.encode(
      instance.depositInsurance!,
      container.nestedSingleValueContainer('deposit_insurance').encoder,
    );
  }
  if (instance.financialAddresses != null) {
    TreasuryFinancialAccountsResourceFinancialAddressesFeatures.encode(
      instance.financialAddresses!,
      container.nestedSingleValueContainer('financial_addresses').encoder,
    );
  }
  if (instance.inboundTransfers != null) {
    TreasuryFinancialAccountsResourceInboundTransfers.encode(
      instance.inboundTransfers!,
      container.nestedSingleValueContainer('inbound_transfers').encoder,
    );
  }
  if (instance.intraStripeFlows != null) {
    TreasuryFinancialAccountsResourceToggleSettings.encode(
      instance.intraStripeFlows!,
      container.nestedSingleValueContainer('intra_stripe_flows').encoder,
    );
  }
  container.encodeString(
    'object',
    'treasury.financial_account_features',
  );
  if (instance.outboundPayments != null) {
    TreasuryFinancialAccountsResourceOutboundPayments.encode(
      instance.outboundPayments!,
      container.nestedSingleValueContainer('outbound_payments').encoder,
    );
  }
  if (instance.outboundTransfers != null) {
    TreasuryFinancialAccountsResourceOutboundTransfers.encode(
      instance.outboundTransfers!,
      container.nestedSingleValueContainer('outbound_transfers').encoder,
    );
  }
  return container.value;
}