// 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 (
	"encoding/json"

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

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

// GetMarketsRegionIDOrdersOKBodyItems get_markets_region_id_orders_200_ok
//
// 200 ok object
// swagger:model getMarketsRegionIdOrdersOKBodyItems

type GetMarketsRegionIDOrdersOKBodyItems struct {

	// get_markets_region_id_orders_duration
	//
	// duration integer
	// Required: true
	Duration *int32 `json:"duration"`

	// get_markets_region_id_orders_is_buy_order
	//
	// is_buy_order boolean
	// Required: true
	IsBuyOrder *bool `json:"is_buy_order"`

	// get_markets_region_id_orders_issued
	//
	// issued string
	// Required: true
	Issued *strfmt.DateTime `json:"issued"`

	// get_markets_region_id_orders_location_id
	//
	// location_id integer
	// Required: true
	LocationID *int64 `json:"location_id"`

	// get_markets_region_id_orders_min_volume
	//
	// min_volume integer
	// Required: true
	MinVolume *int32 `json:"min_volume"`

	// get_markets_region_id_orders_order_id
	//
	// order_id integer
	// Required: true
	OrderID *int64 `json:"order_id"`

	// get_markets_region_id_orders_price
	//
	// price number
	// Required: true
	Price *float32 `json:"price"`

	// get_markets_region_id_orders_range
	//
	// range string
	// Required: true
	Range *string `json:"range"`

	// get_markets_region_id_orders_type_id
	//
	// type_id integer
	// Required: true
	TypeID *int32 `json:"type_id"`

	// get_markets_region_id_orders_volume_remain
	//
	// volume_remain integer
	// Required: true
	VolumeRemain *int32 `json:"volume_remain"`

	// get_markets_region_id_orders_volume_total
	//
	// volume_total integer
	// Required: true
	VolumeTotal *int32 `json:"volume_total"`
}

/* polymorph getMarketsRegionIdOrdersOKBodyItems duration false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems is_buy_order false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems issued false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems location_id false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems min_volume false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems order_id false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems price false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems range false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems type_id false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems volume_remain false */

/* polymorph getMarketsRegionIdOrdersOKBodyItems volume_total false */

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

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

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

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

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

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

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

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

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

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

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

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

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

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateDuration(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateIsBuyOrder(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateIssued(formats strfmt.Registry) error {

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

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

	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateLocationID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateMinVolume(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateOrderID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validatePrice(formats strfmt.Registry) error {

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

	return nil
}

var getMarketsRegionIdOrdersOKBodyItemsTypeRangePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["station","region","solarsystem","1","2","3","4","5","10","20","30","40"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getMarketsRegionIdOrdersOKBodyItemsTypeRangePropEnum = append(getMarketsRegionIdOrdersOKBodyItemsTypeRangePropEnum, v)
	}
}

const (
	// GetMarketsRegionIDOrdersOKBodyItemsRangeStation captures enum value "station"
	GetMarketsRegionIDOrdersOKBodyItemsRangeStation string = "station"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeRegion captures enum value "region"
	GetMarketsRegionIDOrdersOKBodyItemsRangeRegion string = "region"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeSolarsystem captures enum value "solarsystem"
	GetMarketsRegionIDOrdersOKBodyItemsRangeSolarsystem string = "solarsystem"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeNr1 captures enum value "1"
	GetMarketsRegionIDOrdersOKBodyItemsRangeNr1 string = "1"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeNr2 captures enum value "2"
	GetMarketsRegionIDOrdersOKBodyItemsRangeNr2 string = "2"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeNr3 captures enum value "3"
	GetMarketsRegionIDOrdersOKBodyItemsRangeNr3 string = "3"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeNr4 captures enum value "4"
	GetMarketsRegionIDOrdersOKBodyItemsRangeNr4 string = "4"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeNr5 captures enum value "5"
	GetMarketsRegionIDOrdersOKBodyItemsRangeNr5 string = "5"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeNr10 captures enum value "10"
	GetMarketsRegionIDOrdersOKBodyItemsRangeNr10 string = "10"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeNr20 captures enum value "20"
	GetMarketsRegionIDOrdersOKBodyItemsRangeNr20 string = "20"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeNr30 captures enum value "30"
	GetMarketsRegionIDOrdersOKBodyItemsRangeNr30 string = "30"
	// GetMarketsRegionIDOrdersOKBodyItemsRangeNr40 captures enum value "40"
	GetMarketsRegionIDOrdersOKBodyItemsRangeNr40 string = "40"
)

// prop value enum
func (m *GetMarketsRegionIDOrdersOKBodyItems) validateRangeEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, getMarketsRegionIdOrdersOKBodyItemsTypeRangePropEnum); err != nil {
		return err
	}
	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateRange(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateRangeEnum("range", "body", *m.Range); err != nil {
		return err
	}

	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateTypeID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateVolumeRemain(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetMarketsRegionIDOrdersOKBodyItems) validateVolumeTotal(formats strfmt.Registry) error {

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

	return nil
}

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

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