encode<V> static method

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

Implementation

static V encode<V>(
  TreasuryReceivedDebitsResourceReversalDetails instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.deadline != null) {
    container.encodeDateTime(
      'deadline',
      instance.deadline!,
    );
  }
  if (instance.restrictedReason != null) {
    TreasuryReceivedCreditReversalDetailsRestrictedReason.encode(
      instance.restrictedReason!,
      container.nestedSingleValueContainer('restricted_reason').encoder,
    );
  }
  return container.value;
}