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

// GetUniverseStructuresStructureIDOKBody get_universe_structures_structure_id_ok
//
// 200 ok object
// swagger:model getUniverseStructuresStructureIdOKBody

type GetUniverseStructuresStructureIDOKBody struct {

	// get_universe_structures_structure_id_name
	//
	// The full name of the structure
	// Required: true
	Name *string `json:"name"`

	// position
	Position *GetUniverseStructuresStructureIDOKBodyPosition `json:"position,omitempty"`

	// get_universe_structures_structure_id_solar_system_id
	//
	// solar_system_id integer
	// Required: true
	SolarSystemID *int32 `json:"solar_system_id"`

	// get_universe_structures_structure_id_type_id
	//
	// type_id integer
	TypeID int32 `json:"type_id,omitempty"`
}

/* polymorph getUniverseStructuresStructureIdOKBody name false */

/* polymorph getUniverseStructuresStructureIdOKBody position false */

/* polymorph getUniverseStructuresStructureIdOKBody solar_system_id false */

/* polymorph getUniverseStructuresStructureIdOKBody type_id false */

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

	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.validateSolarSystemID(formats); err != nil {
		// prop
		res = append(res, err)
	}

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

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

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

	return nil
}

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

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

	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 *GetUniverseStructuresStructureIDOKBody) validateSolarSystemID(formats strfmt.Registry) error {

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

	return nil
}

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

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