func (m *ResourceDiff) UnmarshalBinary(b []byte) error {
	var res ResourceDiff
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
UnmarshalBinary interface implementation
package models
import (
	"encoding/json"
	"strconv"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)
type ResourceDiff struct {
	Attributes []*Attribute `json:"attributes"`
	Change string `json:"change,omitempty"`
	ResourceID string `json:"resource_id,omitempty"`
	ResourceType string `json:"resource_type,omitempty"`
}
func (m *ResourceDiff) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateAttributes(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateChange(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *ResourceDiff) validateAttributes(formats strfmt.Registry) error {
	if swag.IsZero(m.Attributes) {  
		return nil
	}
	for i := 0; i < len(m.Attributes); i++ {
		if swag.IsZero(m.Attributes[i]) {  
			continue
		}
		if m.Attributes[i] != nil {
			if err := m.Attributes[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("attributes" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
var resourceDiffTypeChangePropEnum []interface{}
func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["ADDED","MODIFIED","REMOVED"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		resourceDiffTypeChangePropEnum = append(resourceDiffTypeChangePropEnum, v)
	}
}
const (
	ResourceDiffChangeADDED string = "ADDED"
	ResourceDiffChangeMODIFIED string = "MODIFIED"
	ResourceDiffChangeREMOVED string = "REMOVED"
)
func (m *ResourceDiff) validateChangeEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, resourceDiffTypeChangePropEnum); err != nil {
		return err
	}
	return nil
}
func (m *ResourceDiff) validateChange(formats strfmt.Registry) error {
	if swag.IsZero(m.Change) {  
		return nil
	}
	if err := m.validateChangeEnum("change", "body", m.Change); err != nil {
		return err
	}
	return nil
}
func (m *ResourceDiff) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}