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

// GetUniverseConstellationsConstellationIDOKBody get_universe_constellations_constellation_id_ok
//
// 200 ok object
// swagger:model getUniverseConstellationsConstellationIdOKBody

type GetUniverseConstellationsConstellationIDOKBody struct {

	// get_universe_constellations_constellation_id_constellation_id
	//
	// constellation_id integer
	// Required: true
	ConstellationID *int32 `json:"constellation_id"`

	// get_universe_constellations_constellation_id_name
	//
	// name string
	// Required: true
	Name *string `json:"name"`

	// position
	// Required: true
	Position *GetUniverseConstellationsConstellationIDOKBodyPosition `json:"position"`

	// get_universe_constellations_constellation_id_region_id
	//
	// The region this constellation is in
	// Required: true
	RegionID *int32 `json:"region_id"`

	// get_universe_constellations_constellation_id_systems
	//
	// systems array
	// Required: true
	// Max Items: 10000
	Systems []int32 `json:"systems"`
}

/* polymorph getUniverseConstellationsConstellationIdOKBody constellation_id false */

/* polymorph getUniverseConstellationsConstellationIdOKBody name false */

/* polymorph getUniverseConstellationsConstellationIdOKBody position false */

/* polymorph getUniverseConstellationsConstellationIdOKBody region_id false */

/* polymorph getUniverseConstellationsConstellationIdOKBody systems false */

// Validate validates this get universe constellations constellation Id o k body
func (m *GetUniverseConstellationsConstellationIDOKBody) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

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

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

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

	return nil
}

func (m *GetUniverseConstellationsConstellationIDOKBody) validateName(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetUniverseConstellationsConstellationIDOKBody) validatePosition(formats strfmt.Registry) error {

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

	if m.Position != nil {

		if err := m.Position.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("position")
			}
			return err
		}
	}

	return nil
}

func (m *GetUniverseConstellationsConstellationIDOKBody) validateRegionID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetUniverseConstellationsConstellationIDOKBody) validateSystems(formats strfmt.Registry) error {

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

	iSystemsSize := int64(len(m.Systems))

	if err := validate.MaxItems("systems", "body", iSystemsSize, 10000); err != nil {
		return err
	}

	return nil
}

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

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