encode<V> static method

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

Implementation

static V encode<V>(
  GelatoSelfieReport instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.document != null) {
    container.encodeString(
      'document',
      instance.document!,
    );
  }
  if (instance.error != null) {
    GelatoSelfieReportError.encode(
      instance.error!,
      container.nestedSingleValueContainer('error').encoder,
    );
  }
  if (instance.selfie != null) {
    container.encodeString(
      'selfie',
      instance.selfie!,
    );
  }
  GelatoDocumentReportStatus.encode(
    instance.status,
    container.nestedSingleValueContainer('status').encoder,
  );
  return container.value;
}