func (m *BookNotificationRaw) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
MarshalBinary interface implementation
package models
import (
	strfmt "github.com/go-openapi/strfmt"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)
type BookNotificationRaw struct {
	Asks [][]float64 `json:"asks"`
	Bids [][]float64 `json:"bids"`
	ChangeID *int64 `json:"change_id"`
	InstrumentName InstrumentName `json:"instrument_name"`
	PrevChangeID int64 `json:"prev_change_id,omitempty"`
	Timestamp TimestampForBookNotifications `json:"timestamp,omitempty"`
}
func (m *BookNotificationRaw) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateAsks(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateBids(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateChangeID(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateInstrumentName(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateTimestamp(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *BookNotificationRaw) validateAsks(formats strfmt.Registry) error {
	if err := validate.Required("asks", "body", m.Asks); err != nil {
		return err
	}
	return nil
}
func (m *BookNotificationRaw) validateBids(formats strfmt.Registry) error {
	if err := validate.Required("bids", "body", m.Bids); err != nil {
		return err
	}
	return nil
}
func (m *BookNotificationRaw) validateChangeID(formats strfmt.Registry) error {
	if err := validate.Required("change_id", "body", m.ChangeID); err != nil {
		return err
	}
	return nil
}
func (m *BookNotificationRaw) validateInstrumentName(formats strfmt.Registry) error {
	if err := m.InstrumentName.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("instrument_name")
		}
		return err
	}
	return nil
}
func (m *BookNotificationRaw) validateTimestamp(formats strfmt.Registry) error {
	if swag.IsZero(m.Timestamp) {  
		return nil
	}
	if err := m.Timestamp.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("timestamp")
		}
		return err
	}
	return nil
}