encode<V> static method

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

Implementation

static V encode<V>(
  TreasuryReceivedCreditsResourceSourceFlowsDetails instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.creditReversal != null) {
    TreasuryCreditReversal.encode(
      instance.creditReversal!,
      container.nestedSingleValueContainer('credit_reversal').encoder,
    );
  }
  if (instance.outboundPayment != null) {
    TreasuryOutboundPayment.encode(
      instance.outboundPayment!,
      container.nestedSingleValueContainer('outbound_payment').encoder,
    );
  }
  if (instance.payout != null) {
    Payout.encode(
      instance.payout!,
      container.nestedSingleValueContainer('payout').encoder,
    );
  }
  TreasuryReceivedCreditsResourceLinkedFlowsSourceFlowDetailsType.encode(
    instance.type,
    container.nestedSingleValueContainer('type').encoder,
  );
  return container.value;
}