cloud/azure/batch/models/affinity_information.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/errors"
"github.com/go-openapi/validate"
)
// AffinityInformation A locality hint that can be used by the Batch service to select a compute node on which to start a task.
// swagger:model AffinityInformation
type AffinityInformation struct {
// An opaque string representing the location of a compute node or a task that has run previously.
//
// You can pass the affinityId of a compute node or task to indicate that this task needs to be placed close to the node or task.
// Required: true
AffinityID *string `json:"affinityId"`
}
// Validate validates this affinity information
func (m *AffinityInformation) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAffinityID(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AffinityInformation) validateAffinityID(formats strfmt.Registry) error {
if err := validate.Required("affinityId", "body", m.AffinityID); err != nil {
return err
}
return nil
}