encode<V> static method

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

Implementation

static V encode<V>(
  TreasuryFinancialAccountUpdateFeaturesOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.cardIssuing != null) {
    FinancialAccountCardIssuing.encode(
      instance.cardIssuing!,
      container.nestedSingleValueContainer('card_issuing').encoder,
    );
  }
  if (instance.depositInsurance != null) {
    FinancialAccountCardIssuing.encode(
      instance.depositInsurance!,
      container.nestedSingleValueContainer('deposit_insurance').encoder,
    );
  }
  if (instance.expand != null) {
    container.encodeList(
      'expand',
      (container) =>
          instance.expand!.forEach((el) => container.encodeString(el)),
    );
  }
  if (instance.financialAddresses != null) {
    FinancialAccountFinancialAddresses.encode(
      instance.financialAddresses!,
      container.nestedSingleValueContainer('financial_addresses').encoder,
    );
  }
  if (instance.inboundTransfers != null) {
    FinancialAccountInboundTransfers.encode(
      instance.inboundTransfers!,
      container.nestedSingleValueContainer('inbound_transfers').encoder,
    );
  }
  if (instance.intraStripeFlows != null) {
    FinancialAccountCardIssuing.encode(
      instance.intraStripeFlows!,
      container.nestedSingleValueContainer('intra_stripe_flows').encoder,
    );
  }
  if (instance.outboundPayments != null) {
    FinancialAccountOutboundPayments.encode(
      instance.outboundPayments!,
      container.nestedSingleValueContainer('outbound_payments').encoder,
    );
  }
  if (instance.outboundTransfers != null) {
    FinancialAccountOutboundPayments.encode(
      instance.outboundTransfers!,
      container.nestedSingleValueContainer('outbound_transfers').encoder,
    );
  }
  return container.value;
}