func (m *PublicTradesHistoryResponseAO1Result) UnmarshalBinary(b []byte) error {
	var res PublicTradesHistoryResponseAO1Result
	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"
	"github.com/go-openapi/validate"
)
type PublicTradesHistoryResponse struct {
	BaseMessage
	Result *PublicTradesHistoryResponseAO1Result `json:"result"`
}
func (m *PublicTradesHistoryResponse) UnmarshalJSON(raw []byte) error {
	var aO0 BaseMessage
	if err := swag.ReadJSON(raw, &aO0); err != nil {
		return err
	}
	m.BaseMessage = aO0
	var dataAO1 struct {
		Result *PublicTradesHistoryResponseAO1Result `json:"result"`
	}
	if err := swag.ReadJSON(raw, &dataAO1); err != nil {
		return err
	}
	m.Result = dataAO1.Result
	return nil
}
func (m PublicTradesHistoryResponse) MarshalJSON() ([]byte, error) {
	_parts := make([][]byte, 0, 2)
	aO0, err := swag.WriteJSON(m.BaseMessage)
	if err != nil {
		return nil, err
	}
	_parts = append(_parts, aO0)
	var dataAO1 struct {
		Result *PublicTradesHistoryResponseAO1Result `json:"result"`
	}
	dataAO1.Result = m.Result
	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
	if errAO1 != nil {
		return nil, errAO1
	}
	_parts = append(_parts, jsonDataAO1)
	return swag.ConcatJSON(_parts...), nil
}
func (m *PublicTradesHistoryResponse) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.BaseMessage.Validate(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateResult(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *PublicTradesHistoryResponse) validateResult(formats strfmt.Registry) error {
	if err := validate.Required("result", "body", m.Result); err != nil {
		return err
	}
	if m.Result != nil {
		if err := m.Result.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("result")
			}
			return err
		}
	}
	return nil
}
func (m *PublicTradesHistoryResponse) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
func (m *PublicTradesHistoryResponse) UnmarshalBinary(b []byte) error {
	var res PublicTradesHistoryResponse
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
type PublicTradesHistoryResponseAO1Result struct {
	HasMore *bool `json:"has_more"`
	Trades []*PublicTrade `json:"trades"`
}
func (m *PublicTradesHistoryResponseAO1Result) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateHasMore(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateTrades(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *PublicTradesHistoryResponseAO1Result) validateHasMore(formats strfmt.Registry) error {
	if err := validate.Required("result"+"."+"has_more", "body", m.HasMore); err != nil {
		return err
	}
	return nil
}
func (m *PublicTradesHistoryResponseAO1Result) validateTrades(formats strfmt.Registry) error {
	if err := validate.Required("result"+"."+"trades", "body", m.Trades); err != nil {
		return err
	}
	for i := 0; i < len(m.Trades); i++ {
		if swag.IsZero(m.Trades[i]) {  
			continue
		}
		if m.Trades[i] != nil {
			if err := m.Trades[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("result" + "." + "trades" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *PublicTradesHistoryResponseAO1Result) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}