encode<V> static method

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

Implementation

static V encode<V>(
  IssuingDisputeCreateOptionsEvidence instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.canceled != null) {
    DisputeCanceled.encode(
      instance.canceled!,
      container.nestedSingleValueContainer('canceled').encoder,
    );
  }
  if (instance.duplicate != null) {
    DisputeDuplicate.encode(
      instance.duplicate!,
      container.nestedSingleValueContainer('duplicate').encoder,
    );
  }
  if (instance.fraudulent != null) {
    DisputeFraudulent.encode(
      instance.fraudulent!,
      container.nestedSingleValueContainer('fraudulent').encoder,
    );
  }
  if (instance.merchandiseNotAsDescribed != null) {
    DisputeMerchandiseNotAsDescribed.encode(
      instance.merchandiseNotAsDescribed!,
      container
          .nestedSingleValueContainer('merchandise_not_as_described')
          .encoder,
    );
  }
  if (instance.notReceived != null) {
    DisputeNotReceived.encode(
      instance.notReceived!,
      container.nestedSingleValueContainer('not_received').encoder,
    );
  }
  if (instance.other != null) {
    DisputeOther.encode(
      instance.other!,
      container.nestedSingleValueContainer('other').encoder,
    );
  }
  if (instance.reason != null) {
    IssuingDisputeEvidenceReason.encode(
      instance.reason!,
      container.nestedSingleValueContainer('reason').encoder,
    );
  }
  if (instance.serviceNotAsDescribed != null) {
    DisputeServiceNotAsDescribed.encode(
      instance.serviceNotAsDescribed!,
      container
          .nestedSingleValueContainer('service_not_as_described')
          .encoder,
    );
  }
  return container.value;
}