func (m *PublicGetTradingviewChartDataResponseAO1Result) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
MarshalBinary interface implementation
package models
import (
	"encoding/json"
	"strconv"
	strfmt "github.com/go-openapi/strfmt"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)
type PublicGetTradingviewChartDataResponse struct {
	BaseMessage
	Result *PublicGetTradingviewChartDataResponseAO1Result `json:"result"`
}
func (m *PublicGetTradingviewChartDataResponse) UnmarshalJSON(raw []byte) error {
	var aO0 BaseMessage
	if err := swag.ReadJSON(raw, &aO0); err != nil {
		return err
	}
	m.BaseMessage = aO0
	var dataAO1 struct {
		Result *PublicGetTradingviewChartDataResponseAO1Result `json:"result"`
	}
	if err := swag.ReadJSON(raw, &dataAO1); err != nil {
		return err
	}
	m.Result = dataAO1.Result
	return nil
}
func (m PublicGetTradingviewChartDataResponse) 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 *PublicGetTradingviewChartDataResponseAO1Result `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 *PublicGetTradingviewChartDataResponse) 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 *PublicGetTradingviewChartDataResponse) 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 *PublicGetTradingviewChartDataResponse) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
func (m *PublicGetTradingviewChartDataResponse) UnmarshalBinary(b []byte) error {
	var res PublicGetTradingviewChartDataResponse
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
type PublicGetTradingviewChartDataResponseAO1Result struct {
	Close []QuotePrice `json:"close"`
	High []QuotePrice `json:"high"`
	Low []QuotePrice `json:"low"`
	Open []QuotePrice `json:"open"`
	Status string `json:"status,omitempty"`
	Ticks []Timestamp `json:"ticks"`
	Volume []ChartVolume `json:"volume"`
}
func (m *PublicGetTradingviewChartDataResponseAO1Result) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateClose(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateHigh(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateLow(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateOpen(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateStatus(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateTicks(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateVolume(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *PublicGetTradingviewChartDataResponseAO1Result) validateClose(formats strfmt.Registry) error {
	if swag.IsZero(m.Close) {  
		return nil
	}
	for i := 0; i < len(m.Close); i++ {
		if err := m.Close[i].Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("result" + "." + "close" + "." + strconv.Itoa(i))
			}
			return err
		}
	}
	return nil
}
func (m *PublicGetTradingviewChartDataResponseAO1Result) validateHigh(formats strfmt.Registry) error {
	if swag.IsZero(m.High) {  
		return nil
	}
	for i := 0; i < len(m.High); i++ {
		if err := m.High[i].Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("result" + "." + "high" + "." + strconv.Itoa(i))
			}
			return err
		}
	}
	return nil
}
func (m *PublicGetTradingviewChartDataResponseAO1Result) validateLow(formats strfmt.Registry) error {
	if swag.IsZero(m.Low) {  
		return nil
	}
	for i := 0; i < len(m.Low); i++ {
		if err := m.Low[i].Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("result" + "." + "low" + "." + strconv.Itoa(i))
			}
			return err
		}
	}
	return nil
}
func (m *PublicGetTradingviewChartDataResponseAO1Result) validateOpen(formats strfmt.Registry) error {
	if swag.IsZero(m.Open) {  
		return nil
	}
	for i := 0; i < len(m.Open); i++ {
		if err := m.Open[i].Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("result" + "." + "open" + "." + strconv.Itoa(i))
			}
			return err
		}
	}
	return nil
}
var publicGetTradingviewChartDataResponseAO1ResultTypeStatusPropEnum []interface{}
func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["ok","no_data"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		publicGetTradingviewChartDataResponseAO1ResultTypeStatusPropEnum = append(publicGetTradingviewChartDataResponseAO1ResultTypeStatusPropEnum, v)
	}
}
const (
	PublicGetTradingviewChartDataResponseAO1ResultStatusOk string = "ok"
	PublicGetTradingviewChartDataResponseAO1ResultStatusNoData string = "no_data"
)
func (m *PublicGetTradingviewChartDataResponseAO1Result) validateStatusEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, publicGetTradingviewChartDataResponseAO1ResultTypeStatusPropEnum); err != nil {
		return err
	}
	return nil
}
func (m *PublicGetTradingviewChartDataResponseAO1Result) validateStatus(formats strfmt.Registry) error {
	if swag.IsZero(m.Status) {  
		return nil
	}
	if err := m.validateStatusEnum("result"+"."+"status", "body", m.Status); err != nil {
		return err
	}
	return nil
}
func (m *PublicGetTradingviewChartDataResponseAO1Result) validateTicks(formats strfmt.Registry) error {
	if swag.IsZero(m.Ticks) {  
		return nil
	}
	for i := 0; i < len(m.Ticks); i++ {
		if err := m.Ticks[i].Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("result" + "." + "ticks" + "." + strconv.Itoa(i))
			}
			return err
		}
	}
	return nil
}
func (m *PublicGetTradingviewChartDataResponseAO1Result) validateVolume(formats strfmt.Registry) error {
	if swag.IsZero(m.Volume) {  
		return nil
	}
	for i := 0; i < len(m.Volume); i++ {
		if err := m.Volume[i].Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("result" + "." + "volume" + "." + strconv.Itoa(i))
			}
			return err
		}
	}
	return nil
}