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

// GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItems get_characters_character_id_planets_planet_id_pin
//
// pin object
// swagger:model getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems

type GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItems struct {

	// contents
	Contents GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItemsContents `json:"contents"`

	// get_characters_character_id_planets_planet_id_expiry_time
	//
	// expiry_time string
	ExpiryTime strfmt.DateTime `json:"expiry_time,omitempty"`

	// extractor details
	ExtractorDetails *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItemsExtractorDetails `json:"extractor_details,omitempty"`

	// factory details
	FactoryDetails *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItemsFactoryDetails `json:"factory_details,omitempty"`

	// get_characters_character_id_planets_planet_id_install_time
	//
	// install_time string
	InstallTime strfmt.DateTime `json:"install_time,omitempty"`

	// get_characters_character_id_planets_planet_id_last_cycle_start
	//
	// last_cycle_start string
	LastCycleStart strfmt.DateTime `json:"last_cycle_start,omitempty"`

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

	// get_characters_character_id_planets_planet_id_pin_id
	//
	// pin_id integer
	// Required: true
	PinID *int64 `json:"pin_id"`

	// get_characters_character_id_planets_planet_id_schematic_id
	//
	// schematic_id integer
	SchematicID int32 `json:"schematic_id,omitempty"`

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

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems contents false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems expiry_time false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems extractor_details false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems factory_details false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems install_time false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems last_cycle_start false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems latitude false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems longitude false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems pin_id false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems schematic_id false */

/* polymorph getCharactersCharacterIdPlanetsPlanetIdOKBodyPinsItems type_id false */

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

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

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

	if err := m.validateFactoryDetails(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 err := m.validatePinID(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 *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItems) validateContents(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItems) validateExtractorDetails(formats strfmt.Registry) error {

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

	if m.ExtractorDetails != nil {

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

	return nil
}

func (m *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItems) validateFactoryDetails(formats strfmt.Registry) error {

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

	if m.FactoryDetails != nil {

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

	return nil
}

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

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

	return nil
}

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

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

	return nil
}

func (m *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItems) validatePinID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItems) 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 *GetCharactersCharacterIDPlanetsPlanetIDOKBodyPinsItems) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

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