encode<V> static method

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

Implementation

static V encode<V>(
  GelatoReportDocumentOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.allowedTypes != null) {
    container.encodeList(
      'allowed_types',
      (container) =>
          instance.allowedTypes!.forEach((el) => container.encodeString(el)),
    );
  }
  if (instance.requireIdNumber != null) {
    container.encodeBool(
      'require_id_number',
      instance.requireIdNumber!,
    );
  }
  if (instance.requireLiveCapture != null) {
    container.encodeBool(
      'require_live_capture',
      instance.requireLiveCapture!,
    );
  }
  if (instance.requireMatchingSelfie != null) {
    container.encodeBool(
      'require_matching_selfie',
      instance.requireMatchingSelfie!,
    );
  }
  return container.value;
}