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.
()
| 287 | // request. An empty slice indicates the request is valid. Callers |
| 288 | // should reject empty patches with IsEmpty before invoking Validate. |
| 289 | func (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. |
| 301 | func (req UpdateAIProviderRequest) IsEmpty() bool { |
no test coverage detected