factory TemplateError.fromJson(Map<String, dynamic> json) { return TemplateError( message: json['Message'] as String?, type: (json['Type'] as String?)?.toTemplateErrorType(), ); }