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

// GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItemsExtractorDetailsHeadsItems get_characters_character_id_planets_planet_id_head
//
// head object
// swagger:model getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItemsExtractorDetailsHeadsItems

type GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItemsExtractorDetailsHeadsItems struct {

	// get_characters_character_id_planets_planet_id_head_id
	//
	// head_id integer
	// Required: true
	// Maximum: 9
	// Minimum: 0
	HeadID *int32 `json:"head_id"`

	// get_characters_character_id_planets_planet_id_latitude
	//
	// latitude number
	// Required: true
	Latitude *float32 `json:"latitude"`

	// get_characters_character_id_planets_planet_id_longitude
	//
	// longitude number
	// Required: true
	Longitude *float32 `json:"longitude"`
}

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItemsExtractorDetailsHeadsItems head_id false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItemsExtractorDetailsHeadsItems latitude false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItemsExtractorDetailsHeadsItems longitude false */

// Validate validates this get characters character Id planets planet Id o k body pins items extractor details heads items
func (m *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItemsExtractorDetailsHeadsItems) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

func (m *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItemsExtractorDetailsHeadsItems) validateHeadID(formats strfmt.Registry) error {

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

	if err := validate.MinimumInt("head_id", "body", int64(*m.HeadID), 0, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("head_id", "body", int64(*m.HeadID), 9, false); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItemsExtractorDetailsHeadsItems) validateLatitude(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItemsExtractorDetailsHeadsItems) validateLongitude(formats strfmt.Registry) error {

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

	return nil
}

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

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