// 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"
)

// GetMarketsStructuresStructureIDOKBodyItems get_markets_structures_structure_id_200_ok
//
// 200 ok object
// swagger:model getMarketsStructuresStructureIdOKBodyItems

type GetMarketsStructuresStructureIDOKBodyItems struct {

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

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

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

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

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

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

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

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

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

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

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

/* polymorph getMarketsStructuresStructureIdOKBodyItems duration false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems is_buy_order false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems issued false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems location_id false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems min_volume false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems order_id false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems price false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems range false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems type_id false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems volume_remain false */

/* polymorph getMarketsStructuresStructureIdOKBodyItems volume_total false */

// Validate validates this get markets structures structure Id o k body items
func (m *GetMarketsStructuresStructureIDOKBodyItems) 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 *GetMarketsStructuresStructureIDOKBodyItems) validateDuration(formats strfmt.Registry) error {

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

	return nil
}

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

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

	return nil
}

func (m *GetMarketsStructuresStructureIDOKBodyItems) 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 *GetMarketsStructuresStructureIDOKBodyItems) validateLocationID(formats strfmt.Registry) error {

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

	return nil
}

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

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

	return nil
}

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

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

	return nil
}

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

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

	return nil
}

var getMarketsStructuresStructureIdOKBodyItemsTypeRangePropEnum []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 {
		getMarketsStructuresStructureIdOKBodyItemsTypeRangePropEnum = append(getMarketsStructuresStructureIdOKBodyItemsTypeRangePropEnum, v)
	}
}

const (
	// GetMarketsStructuresStructureIDOKBodyItemsRangeStation captures enum value "station"
	GetMarketsStructuresStructureIDOKBodyItemsRangeStation string = "station"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeRegion captures enum value "region"
	GetMarketsStructuresStructureIDOKBodyItemsRangeRegion string = "region"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeSolarsystem captures enum value "solarsystem"
	GetMarketsStructuresStructureIDOKBodyItemsRangeSolarsystem string = "solarsystem"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeNr1 captures enum value "1"
	GetMarketsStructuresStructureIDOKBodyItemsRangeNr1 string = "1"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeNr2 captures enum value "2"
	GetMarketsStructuresStructureIDOKBodyItemsRangeNr2 string = "2"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeNr3 captures enum value "3"
	GetMarketsStructuresStructureIDOKBodyItemsRangeNr3 string = "3"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeNr4 captures enum value "4"
	GetMarketsStructuresStructureIDOKBodyItemsRangeNr4 string = "4"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeNr5 captures enum value "5"
	GetMarketsStructuresStructureIDOKBodyItemsRangeNr5 string = "5"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeNr10 captures enum value "10"
	GetMarketsStructuresStructureIDOKBodyItemsRangeNr10 string = "10"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeNr20 captures enum value "20"
	GetMarketsStructuresStructureIDOKBodyItemsRangeNr20 string = "20"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeNr30 captures enum value "30"
	GetMarketsStructuresStructureIDOKBodyItemsRangeNr30 string = "30"
	// GetMarketsStructuresStructureIDOKBodyItemsRangeNr40 captures enum value "40"
	GetMarketsStructuresStructureIDOKBodyItemsRangeNr40 string = "40"
)

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

func (m *GetMarketsStructuresStructureIDOKBodyItems) 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 *GetMarketsStructuresStructureIDOKBodyItems) validateTypeID(formats strfmt.Registry) error {

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

	return nil
}

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

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

	return nil
}

func (m *GetMarketsStructuresStructureIDOKBodyItems) 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 *GetMarketsStructuresStructureIDOKBodyItems) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

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