encode<V> static method

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

Implementation

static V encode<V>(
  TreasuryReceivedCreditsResourceLinkedFlows instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.creditReversal != null) {
    container.encodeString(
      'credit_reversal',
      instance.creditReversal!,
    );
  }
  if (instance.issuingAuthorization != null) {
    container.encodeString(
      'issuing_authorization',
      instance.issuingAuthorization!,
    );
  }
  if (instance.issuingTransaction != null) {
    container.encodeString(
      'issuing_transaction',
      instance.issuingTransaction!,
    );
  }
  if (instance.sourceFlow != null) {
    container.encodeString(
      'source_flow',
      instance.sourceFlow!,
    );
  }
  if (instance.sourceFlowDetails != null) {
    TreasuryReceivedCreditsResourceLinkedFlowsSourceFlowDetails.encode(
      instance.sourceFlowDetails!,
      container.nestedSingleValueContainer('source_flow_details').encoder,
    );
  }
  if (instance.sourceFlowType != null) {
    container.encodeString(
      'source_flow_type',
      instance.sourceFlowType!,
    );
  }
  return container.value;
}