CompareFacesResponse.fromJson constructor

CompareFacesResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CompareFacesResponse.fromJson(Map<String, dynamic> json) {
  return CompareFacesResponse(
    faceMatches: (json['FaceMatches'] as List?)
        ?.whereNotNull()
        .map((e) => CompareFacesMatch.fromJson(e as Map<String, dynamic>))
        .toList(),
    sourceImageFace: json['SourceImageFace'] != null
        ? ComparedSourceImageFace.fromJson(
            json['SourceImageFace'] as Map<String, dynamic>)
        : null,
    sourceImageOrientationCorrection:
        (json['SourceImageOrientationCorrection'] as String?)
            ?.toOrientationCorrection(),
    targetImageOrientationCorrection:
        (json['TargetImageOrientationCorrection'] as String?)
            ?.toOrientationCorrection(),
    unmatchedFaces: (json['UnmatchedFaces'] as List?)
        ?.whereNotNull()
        .map((e) => ComparedFace.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}