factory ErrorReason.fromJson(Map<String, dynamic> json) { return ErrorReason( errorCode: (json['ErrorCode'] as String?)?.toErrorCode(), errorMessage: json['ErrorMessage'] as String?, ); }