// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	strfmt "github.com/go-openapi/strfmt"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// GetMarketsRegionIDHistoryOKBodyItems get_markets_region_id_history_200_ok
//
// 200 ok object
// swagger:model getMarketsRegionIdHistoryOKBodyItems

type GetMarketsRegionIDHistoryOKBodyItems struct {

	// get_markets_region_id_history_average
	//
	// average number
	// Required: true
	Average *float32 `json:"average"`

	// get_markets_region_id_history_date
	//
	// The date of this historical statistic entry
	// Required: true
	Date *strfmt.Date `json:"date"`

	// get_markets_region_id_history_highest
	//
	// highest number
	// Required: true
	Highest *float32 `json:"highest"`

	// get_markets_region_id_history_lowest
	//
	// lowest number
	// Required: true
	Lowest *float32 `json:"lowest"`

	// get_markets_region_id_history_order_count
	//
	// Total number of orders happened that day
	// Required: true
	OrderCount *int64 `json:"order_count"`

	// get_markets_region_id_history_volume
	//
	// Total
	// Required: true
	Volume *int64 `json:"volume"`
}

/* polymorph getMarketsRegionIdHistoryOKBodyItems average false */

/* polymorph getMarketsRegionIdHistoryOKBodyItems date false */

/* polymorph getMarketsRegionIdHistoryOKBodyItems highest false */

/* polymorph getMarketsRegionIdHistoryOKBodyItems lowest false */

/* polymorph getMarketsRegionIdHistoryOKBodyItems order_count false */

/* polymorph getMarketsRegionIdHistoryOKBodyItems volume false */

// Validate validates this get markets region Id history o k body items
func (m *GetMarketsRegionIDHistoryOKBodyItems) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateAverage(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if err := m.validateDate(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if err := m.validateHighest(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if err := m.validateLowest(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if err := m.validateOrderCount(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if err := m.validateVolume(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *GetMarketsRegionIDHistoryOKBodyItems) validateAverage(formats strfmt.Registry) error {

	if err := validate.Required("average", "body", m.Average); err != nil {
		return err
	}

	return nil
}

func (m *GetMarketsRegionIDHistoryOKBodyItems) validateDate(formats strfmt.Registry) error {

	if err := validate.Required("date", "body", m.Date); err != nil {
		return err
	}

	if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil {
		return err
	}

	return nil
}

func (m *GetMarketsRegionIDHistoryOKBodyItems) validateHighest(formats strfmt.Registry) error {

	if err := validate.Required("highest", "body", m.Highest); err != nil {
		return err
	}

	return nil
}

func (m *GetMarketsRegionIDHistoryOKBodyItems) validateLowest(formats strfmt.Registry) error {

	if err := validate.Required("lowest", "body", m.Lowest); err != nil {
		return err
	}

	return nil
}

func (m *GetMarketsRegionIDHistoryOKBodyItems) validateOrderCount(formats strfmt.Registry) error {

	if err := validate.Required("order_count", "body", m.OrderCount); err != nil {
		return err
	}

	return nil
}

func (m *GetMarketsRegionIDHistoryOKBodyItems) validateVolume(formats strfmt.Registry) error {

	if err := validate.Required("volume", "body", m.Volume); err != nil {
		return err
	}

	return nil
}

// MarshalBinary interface implementation
func (m *GetMarketsRegionIDHistoryOKBodyItems) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *GetMarketsRegionIDHistoryOKBodyItems) UnmarshalBinary(b []byte) error {
	var res GetMarketsRegionIDHistoryOKBodyItems
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
