SingleValidationResponse.fromJson constructor

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

Creates a SingleValidationResponse from a JSON map.

Used internally to deserialize API responses.

Implementation

factory SingleValidationResponse.fromJson(Map<String, dynamic> json) {
  return SingleValidationResponse(
    email: json['email'] as String,
    isValid: json['isValid'] as bool? ?? false,
    score: (json['score'] as num?)?.toInt() ?? 0,
    deliverable: json['deliverable'] as bool? ?? false,
    syntaxValid: json['syntaxValid'] as bool? ?? false,
    domainValid: json['domainValid'] as bool? ?? false,
    mxRecords: json['mxRecords'] as bool? ?? false,
    smtpValid: json['smtpValid'] as bool? ?? false,
    catchAll: json['catchAll'] as bool?,
    disposable: json['disposable'] as bool? ?? false,
    generic: json['generic'] as bool? ?? false,
    provider: json['provider'] as String?,
    risk: json['risk'] as String? ?? 'HIGH',
    confidence: json['confidence'] as String?,
    suggestion: json['suggestion'] as String?,
    creditsRemaining: json['creditsRemaining'] as int?,
    cached: json['cached'] as bool?,
    timestamp: json['timestamp'] as String?,
  );
}