## List `client.Builds.Diagnostics.List(ctx, buildID, query) (*Page[BuildDiagnostic], error)` **get** `/v0/builds/{buildId}/diagnostics` Get the list of diagnostics for a given build. If no language targets are specified, diagnostics for all languages are returned. ### Parameters - `buildID string` Build ID - `query BuildDiagnosticListParams` - `Cursor param.Field[string]` Pagination cursor from a previous response - `Limit param.Field[float64]` Maximum number of diagnostics to return, defaults to 100 (maximum: 100) - `Severity param.Field[BuildDiagnosticListParamsSeverity]` Includes the given severity and above (fatal > error > warning > note). - `const BuildDiagnosticListParamsSeverityFatal BuildDiagnosticListParamsSeverity = "fatal"` - `const BuildDiagnosticListParamsSeverityError BuildDiagnosticListParamsSeverity = "error"` - `const BuildDiagnosticListParamsSeverityWarning BuildDiagnosticListParamsSeverity = "warning"` - `const BuildDiagnosticListParamsSeverityNote BuildDiagnosticListParamsSeverity = "note"` - `Targets param.Field[string]` Optional comma-delimited list of language targets to filter diagnostics by ### Returns - `type BuildDiagnostic struct{…}` - `Code string` The kind of diagnostic. - `Ignored bool` Whether the diagnostic is ignored in the Stainless config. - `Level BuildDiagnosticLevel` The severity of the diagnostic. - `const BuildDiagnosticLevelFatal BuildDiagnosticLevel = "fatal"` - `const BuildDiagnosticLevelError BuildDiagnosticLevel = "error"` - `const BuildDiagnosticLevelWarning BuildDiagnosticLevel = "warning"` - `const BuildDiagnosticLevelNote BuildDiagnosticLevel = "note"` - `Message string` A description of the diagnostic. - `More BuildDiagnosticMoreUnion` - `type BuildDiagnosticMoreMarkdown struct{…}` - `Markdown string` - `Type Markdown` - `const MarkdownMarkdown Markdown = "markdown"` - `type BuildDiagnosticMoreRaw struct{…}` - `Raw string` - `Type Raw` - `const RawRaw Raw = "raw"` - `ConfigRef string` A JSON pointer to a relevant field in the Stainless config. - `OasRef string` A JSON pointer to a relevant field in the OpenAPI spec. ### Example ```go package main import ( "context" "fmt" "github.com/stainless-api/stainless-api-go" "github.com/stainless-api/stainless-api-go/option" ) func main() { client := stainless.NewClient( option.WithAPIKey("My API Key"), ) page, err := client.Builds.Diagnostics.List( context.TODO(), "buildId", stainless.BuildDiagnosticListParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ```