cloud/azure/batch/models/auto_scale_run_error.go
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/errors"
)
// AutoScaleRunError An error that occurred when executing or evaluating a pool autoscale formula.
// swagger:model AutoScaleRunError
type AutoScaleRunError struct {
// An identifier for the autoscale error. Codes are invariant and are intended to be consumed programmatically.
Code string `json:"code,omitempty"`
// A message describing the autoscale error, intended to be suitable for display in a user interface.
Message string `json:"message,omitempty"`
// A list of additional error details related to the autoscale error.
Values []*NameValuePair `json:"values"`
}
// Validate validates this auto scale run error
func (m *AutoScaleRunError) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateValues(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AutoScaleRunError) validateValues(formats strfmt.Registry) error {
if swag.IsZero(m.Values) { // not required
return nil
}
for i := 0; i < len(m.Values); i++ {
if swag.IsZero(m.Values[i]) { // not required
continue
}
if m.Values[i] != nil {
if err := m.Values[i].Validate(formats); err != nil {
return err
}
}
}
return nil
}