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

// GetCharactersCharacterIDStandingsOKBodyItems get_characters_character_id_standings_200_ok
//
// 200 ok object
// swagger:model getCharactersCharacterIdStandingsOKBodyItems

type GetCharactersCharacterIDStandingsOKBodyItems struct {

	// get_characters_character_id_standings_from_id
	//
	// from_id integer
	// Required: true
	FromID *int32 `json:"from_id"`

	// get_characters_character_id_standings_from_type
	//
	// from_type string
	// Required: true
	FromType *string `json:"from_type"`

	// get_characters_character_id_standings_standing
	//
	// standing number
	// Required: true
	// Maximum: 10
	// Minimum: -10
	Standing *float32 `json:"standing"`
}

/* polymorph getCharactersCharacterIdStandingsOKBodyItems from_id false */

/* polymorph getCharactersCharacterIdStandingsOKBodyItems from_type false */

/* polymorph getCharactersCharacterIdStandingsOKBodyItems standing false */

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

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

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

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

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

func (m *GetCharactersCharacterIDStandingsOKBodyItems) validateFromID(formats strfmt.Registry) error {

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

	return nil
}

var getCharactersCharacterIdStandingsOKBodyItemsTypeFromTypePropEnum []interface{}

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

const (
	// GetCharactersCharacterIDStandingsOKBodyItemsFromTypeAgent captures enum value "agent"
	GetCharactersCharacterIDStandingsOKBodyItemsFromTypeAgent string = "agent"
	// GetCharactersCharacterIDStandingsOKBodyItemsFromTypeNpcCorp captures enum value "npc_corp"
	GetCharactersCharacterIDStandingsOKBodyItemsFromTypeNpcCorp string = "npc_corp"
	// GetCharactersCharacterIDStandingsOKBodyItemsFromTypeFaction captures enum value "faction"
	GetCharactersCharacterIDStandingsOKBodyItemsFromTypeFaction string = "faction"
)

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

func (m *GetCharactersCharacterIDStandingsOKBodyItems) validateFromType(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateFromTypeEnum("from_type", "body", *m.FromType); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDStandingsOKBodyItems) validateStanding(formats strfmt.Registry) error {

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

	if err := validate.Minimum("standing", "body", float64(*m.Standing), -10, false); err != nil {
		return err
	}

	if err := validate.Maximum("standing", "body", float64(*m.Standing), 10, false); err != nil {
		return err
	}

	return nil
}

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

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