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

// GetSearchOKBody get_search_ok
//
// 200 ok object
// swagger:model getSearchOKBody

type GetSearchOKBody struct {

	// get_search_agent
	//
	// agent array
	// Max Items: 500
	Agent []int32 `json:"agent"`

	// get_search_alliance
	//
	// alliance array
	// Max Items: 500
	Alliance []int32 `json:"alliance"`

	// get_search_character
	//
	// character array
	// Max Items: 500
	Character []int32 `json:"character"`

	// get_search_constellation
	//
	// constellation array
	// Max Items: 500
	Constellation []int32 `json:"constellation"`

	// get_search_corporation
	//
	// corporation array
	// Max Items: 500
	Corporation []int32 `json:"corporation"`

	// get_search_faction
	//
	// faction array
	// Max Items: 500
	Faction []int32 `json:"faction"`

	// get_search_inventorytype
	//
	// inventorytype array
	// Max Items: 500
	Inventorytype []int32 `json:"inventorytype"`

	// get_search_region
	//
	// region array
	// Max Items: 500
	Region []int32 `json:"region"`

	// get_search_solarsystem
	//
	// solarsystem array
	// Max Items: 500
	Solarsystem []int32 `json:"solarsystem"`

	// get_search_station
	//
	// station array
	// Max Items: 500
	Station []int32 `json:"station"`

	// get_search_wormhole
	//
	// wormhole array
	// Max Items: 500
	Wormhole []int32 `json:"wormhole"`
}

/* polymorph getSearchOKBody agent false */

/* polymorph getSearchOKBody alliance false */

/* polymorph getSearchOKBody character false */

/* polymorph getSearchOKBody constellation false */

/* polymorph getSearchOKBody corporation false */

/* polymorph getSearchOKBody faction false */

/* polymorph getSearchOKBody inventorytype false */

/* polymorph getSearchOKBody region false */

/* polymorph getSearchOKBody solarsystem false */

/* polymorph getSearchOKBody station false */

/* polymorph getSearchOKBody wormhole false */

// Validate validates this get search o k body
func (m *GetSearchOKBody) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

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

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

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

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

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

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

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

func (m *GetSearchOKBody) validateAgent(formats strfmt.Registry) error {

	if swag.IsZero(m.Agent) { // not required
		return nil
	}

	iAgentSize := int64(len(m.Agent))

	if err := validate.MaxItems("agent", "body", iAgentSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateAlliance(formats strfmt.Registry) error {

	if swag.IsZero(m.Alliance) { // not required
		return nil
	}

	iAllianceSize := int64(len(m.Alliance))

	if err := validate.MaxItems("alliance", "body", iAllianceSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateCharacter(formats strfmt.Registry) error {

	if swag.IsZero(m.Character) { // not required
		return nil
	}

	iCharacterSize := int64(len(m.Character))

	if err := validate.MaxItems("character", "body", iCharacterSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateConstellation(formats strfmt.Registry) error {

	if swag.IsZero(m.Constellation) { // not required
		return nil
	}

	iConstellationSize := int64(len(m.Constellation))

	if err := validate.MaxItems("constellation", "body", iConstellationSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateCorporation(formats strfmt.Registry) error {

	if swag.IsZero(m.Corporation) { // not required
		return nil
	}

	iCorporationSize := int64(len(m.Corporation))

	if err := validate.MaxItems("corporation", "body", iCorporationSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateFaction(formats strfmt.Registry) error {

	if swag.IsZero(m.Faction) { // not required
		return nil
	}

	iFactionSize := int64(len(m.Faction))

	if err := validate.MaxItems("faction", "body", iFactionSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateInventorytype(formats strfmt.Registry) error {

	if swag.IsZero(m.Inventorytype) { // not required
		return nil
	}

	iInventorytypeSize := int64(len(m.Inventorytype))

	if err := validate.MaxItems("inventorytype", "body", iInventorytypeSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateRegion(formats strfmt.Registry) error {

	if swag.IsZero(m.Region) { // not required
		return nil
	}

	iRegionSize := int64(len(m.Region))

	if err := validate.MaxItems("region", "body", iRegionSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateSolarsystem(formats strfmt.Registry) error {

	if swag.IsZero(m.Solarsystem) { // not required
		return nil
	}

	iSolarsystemSize := int64(len(m.Solarsystem))

	if err := validate.MaxItems("solarsystem", "body", iSolarsystemSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateStation(formats strfmt.Registry) error {

	if swag.IsZero(m.Station) { // not required
		return nil
	}

	iStationSize := int64(len(m.Station))

	if err := validate.MaxItems("station", "body", iStationSize, 500); err != nil {
		return err
	}

	return nil
}

func (m *GetSearchOKBody) validateWormhole(formats strfmt.Registry) error {

	if swag.IsZero(m.Wormhole) { // not required
		return nil
	}

	iWormholeSize := int64(len(m.Wormhole))

	if err := validate.MaxItems("wormhole", "body", iWormholeSize, 500); err != nil {
		return err
	}

	return nil
}

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

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