MCPcopy Index your code
hub / github.com/coder/coder / Validate

Method Validate

codersdk/aiproviders.go:289–298  ·  view source on GitHub ↗

Validate returns the field-level validation errors for an update request. An empty slice indicates the request is valid. Callers should reject empty patches with IsEmpty before invoking Validate.

()

Source from the content-addressed store, hash-verified

287// request. An empty slice indicates the request is valid. Callers
288// should reject empty patches with IsEmpty before invoking Validate.
289func (req UpdateAIProviderRequest) Validate() []ValidationError {
290 var validations []ValidationError
291 if req.BaseURL != nil {
292 validations = append(validations, validateRequiredAIProviderBaseURL(*req.BaseURL)...)
293 }
294 if req.APIKeys != nil {
295 validations = append(validations, validateAIProviderKeyMutations(*req.APIKeys)...)
296 }
297 return validations
298}
299
300// IsEmpty reports whether the patch carries no fields.
301func (req UpdateAIProviderRequest) IsEmpty() bool {

Callers 1

aiProvidersUpdateMethod · 0.95

Tested by

no test coverage detected