The QueryDiagnostic datatype includes various settings.

Table: QueryDiagnostic

messagestringyes Preview: Internal testing.
codestringyes Preview: Internal testing.
severitySeverityyes Preview: Internal testing. Severity is an enumerated list: Error, Warning, Information, or Hint.

[a] Some arguments may be required, as indicated in this column. For some fields, this column indicates that a result will always be returned for it.