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

// GetUniversePlanetsPlanetIDOKBody get_universe_planets_planet_id_ok
//
// 200 ok object
// swagger:model getUniversePlanetsPlanetIdOKBody

type GetUniversePlanetsPlanetIDOKBody struct {

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

	// get_universe_planets_planet_id_planet_id
	//
	// planet_id integer
	// Required: true
	PlanetID *int32 `json:"planet_id"`

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

	// get_universe_planets_planet_id_system_id
	//
	// The solar system this planet is in
	// Required: true
	SystemID *int32 `json:"system_id"`

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

/* polymorph getUniversePlanetsPlanetIdOKBody name false */

/* polymorph getUniversePlanetsPlanetIdOKBody planet_id false */

/* polymorph getUniversePlanetsPlanetIdOKBody position false */

/* polymorph getUniversePlanetsPlanetIdOKBody system_id false */

/* polymorph getUniversePlanetsPlanetIdOKBody type_id false */

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

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

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

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

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

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

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

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

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

	return nil
}

func (m *GetUniversePlanetsPlanetIDOKBody) validatePlanetID(formats strfmt.Registry) error {

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

	return nil
}

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

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

	return nil
}

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

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

	return nil
}

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

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