// 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 (
	"encoding/json"

	strfmt "github.com/go-openapi/strfmt"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// GetCharactersCharacterIDClonesOKBodyHomeLocation get_characters_character_id_clones_home_location
//
// home_location object
// swagger:model getCharactersCharacterIdClonesOKBodyHomeLocation

type GetCharactersCharacterIDClonesOKBodyHomeLocation struct {

	// get_characters_character_id_clones_location_id
	//
	// location_id integer
	LocationID int64 `json:"location_id,omitempty"`

	// get_characters_character_id_clones_location_type
	//
	// location_type string
	LocationType string `json:"location_type,omitempty"`
}

/* polymorph getCharactersCharacterIdClonesOKBodyHomeLocation location_id false */

/* polymorph getCharactersCharacterIdClonesOKBodyHomeLocation location_type false */

// Validate validates this get characters character Id clones o k body home location
func (m *GetCharactersCharacterIDClonesOKBodyHomeLocation) Validate(formats strfmt.Registry) error {
	var res []error

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

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

var getCharactersCharacterIdClonesOKBodyHomeLocationTypeLocationTypePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["station","structure"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getCharactersCharacterIdClonesOKBodyHomeLocationTypeLocationTypePropEnum = append(getCharactersCharacterIdClonesOKBodyHomeLocationTypeLocationTypePropEnum, v)
	}
}

const (
	// GetCharactersCharacterIDClonesOKBodyHomeLocationLocationTypeStation captures enum value "station"
	GetCharactersCharacterIDClonesOKBodyHomeLocationLocationTypeStation string = "station"
	// GetCharactersCharacterIDClonesOKBodyHomeLocationLocationTypeStructure captures enum value "structure"
	GetCharactersCharacterIDClonesOKBodyHomeLocationLocationTypeStructure string = "structure"
)

// prop value enum
func (m *GetCharactersCharacterIDClonesOKBodyHomeLocation) validateLocationTypeEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, getCharactersCharacterIdClonesOKBodyHomeLocationTypeLocationTypePropEnum); err != nil {
		return err
	}
	return nil
}

func (m *GetCharactersCharacterIDClonesOKBodyHomeLocation) validateLocationType(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateLocationTypeEnum("location_type", "body", m.LocationType); err != nil {
		return err
	}

	return nil
}

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

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