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

// GetIncursionsOKBodyItems get_incursions_200_ok
//
// 200 ok object
// swagger:model getIncursionsOKBodyItems

type GetIncursionsOKBodyItems struct {

	// get_incursions_constellation_id
	//
	// The constellation id in which this incursion takes place
	// Required: true
	ConstellationID *int32 `json:"constellation_id"`

	// get_incursions_faction_id
	//
	// The attacking faction's id
	// Required: true
	FactionID *int32 `json:"faction_id"`

	// get_incursions_has_boss
	//
	// Whether the final encounter has boss or not
	// Required: true
	HasBoss *bool `json:"has_boss"`

	// get_incursions_infested_solar_systems
	//
	// A list of infested solar system ids that are a part of this incursion
	// Required: true
	// Max Items: 100
	InfestedSolarSystems []int32 `json:"infested_solar_systems"`

	// get_incursions_influence
	//
	// Influence of this incursion as a float from 0 to 1
	// Required: true
	Influence *float32 `json:"influence"`

	// get_incursions_staging_solar_system_id
	//
	// Staging solar system for this incursion
	// Required: true
	StagingSolarSystemID *int32 `json:"staging_solar_system_id"`

	// get_incursions_state
	//
	// The state of this incursion
	// Required: true
	State *string `json:"state"`

	// get_incursions_type
	//
	// The type of this incursion
	// Required: true
	Type *string `json:"type"`
}

/* polymorph getIncursionsOKBodyItems constellation_id false */

/* polymorph getIncursionsOKBodyItems faction_id false */

/* polymorph getIncursionsOKBodyItems has_boss false */

/* polymorph getIncursionsOKBodyItems infested_solar_systems false */

/* polymorph getIncursionsOKBodyItems influence false */

/* polymorph getIncursionsOKBodyItems staging_solar_system_id false */

/* polymorph getIncursionsOKBodyItems state false */

/* polymorph getIncursionsOKBodyItems type false */

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

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

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

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

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

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

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

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

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

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

func (m *GetIncursionsOKBodyItems) validateConstellationID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetIncursionsOKBodyItems) validateFactionID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetIncursionsOKBodyItems) validateHasBoss(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetIncursionsOKBodyItems) validateInfestedSolarSystems(formats strfmt.Registry) error {

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

	iInfestedSolarSystemsSize := int64(len(m.InfestedSolarSystems))

	if err := validate.MaxItems("infested_solar_systems", "body", iInfestedSolarSystemsSize, 100); err != nil {
		return err
	}

	return nil
}

func (m *GetIncursionsOKBodyItems) validateInfluence(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetIncursionsOKBodyItems) validateStagingSolarSystemID(formats strfmt.Registry) error {

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

	return nil
}

var getIncursionsOKBodyItemsTypeStatePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["withdrawing","mobilizing","established"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getIncursionsOKBodyItemsTypeStatePropEnum = append(getIncursionsOKBodyItemsTypeStatePropEnum, v)
	}
}

const (
	// GetIncursionsOKBodyItemsStateWithdrawing captures enum value "withdrawing"
	GetIncursionsOKBodyItemsStateWithdrawing string = "withdrawing"
	// GetIncursionsOKBodyItemsStateMobilizing captures enum value "mobilizing"
	GetIncursionsOKBodyItemsStateMobilizing string = "mobilizing"
	// GetIncursionsOKBodyItemsStateEstablished captures enum value "established"
	GetIncursionsOKBodyItemsStateEstablished string = "established"
)

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

func (m *GetIncursionsOKBodyItems) validateState(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateStateEnum("state", "body", *m.State); err != nil {
		return err
	}

	return nil
}

func (m *GetIncursionsOKBodyItems) validateType(formats strfmt.Registry) error {

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

	return nil
}

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

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