func (m *RestDataSourceCollection) UnmarshalBinary(b []byte) error {
	var res RestDataSourceCollection
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
UnmarshalBinary interface implementation
package models
import (
	"strconv"
	strfmt "github.com/go-openapi/strfmt"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
)
type RestDataSourceCollection struct {
	DataSources []*ObjectDataSource `json:"DataSources"`
	Total int32 `json:"Total,omitempty"`
}
func (m *RestDataSourceCollection) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateDataSources(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *RestDataSourceCollection) validateDataSources(formats strfmt.Registry) error {
	if swag.IsZero(m.DataSources) {  
		return nil
	}
	for i := 0; i < len(m.DataSources); i++ {
		if swag.IsZero(m.DataSources[i]) {  
			continue
		}
		if m.DataSources[i] != nil {
			if err := m.DataSources[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("DataSources" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *RestDataSourceCollection) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}