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

// GetCharactersCharacterIDContactsOKBodyItems get_characters_character_id_contacts_200_ok
//
// 200 ok object
// swagger:model getCharactersCharacterIdContactsOKBodyItems

type GetCharactersCharacterIDContactsOKBodyItems struct {

	// get_characters_character_id_contacts_contact_id
	//
	// contact_id integer
	// Required: true
	ContactID *int32 `json:"contact_id"`

	// get_characters_character_id_contacts_contact_type
	//
	// contact_type string
	// Required: true
	ContactType *string `json:"contact_type"`

	// get_characters_character_id_contacts_is_blocked
	//
	// Whether this contact is in the blocked list. Note a missing value denotes unknown, not true or false
	IsBlocked bool `json:"is_blocked,omitempty"`

	// get_characters_character_id_contacts_is_watched
	//
	// Whether this contact is being watched
	IsWatched bool `json:"is_watched,omitempty"`

	// get_characters_character_id_contacts_label_id
	//
	// Custom label of the contact
	LabelID int64 `json:"label_id,omitempty"`

	// get_characters_character_id_contacts_standing
	//
	// Standing of the contact
	// Required: true
	Standing *float32 `json:"standing"`
}

/* polymorph getCharactersCharacterIdContactsOKBodyItems contact_id false */

/* polymorph getCharactersCharacterIdContactsOKBodyItems contact_type false */

/* polymorph getCharactersCharacterIdContactsOKBodyItems is_blocked false */

/* polymorph getCharactersCharacterIdContactsOKBodyItems is_watched false */

/* polymorph getCharactersCharacterIdContactsOKBodyItems label_id false */

/* polymorph getCharactersCharacterIdContactsOKBodyItems standing false */

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

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

	if err := m.validateContactType(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 *GetCharactersCharacterIDContactsOKBodyItems) validateContactID(formats strfmt.Registry) error {

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

	return nil
}

var getCharactersCharacterIdContactsOKBodyItemsTypeContactTypePropEnum []interface{}

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

const (
	// GetCharactersCharacterIDContactsOKBodyItemsContactTypeCharacter captures enum value "character"
	GetCharactersCharacterIDContactsOKBodyItemsContactTypeCharacter string = "character"
	// GetCharactersCharacterIDContactsOKBodyItemsContactTypeCorporation captures enum value "corporation"
	GetCharactersCharacterIDContactsOKBodyItemsContactTypeCorporation string = "corporation"
	// GetCharactersCharacterIDContactsOKBodyItemsContactTypeAlliance captures enum value "alliance"
	GetCharactersCharacterIDContactsOKBodyItemsContactTypeAlliance string = "alliance"
	// GetCharactersCharacterIDContactsOKBodyItemsContactTypeFaction captures enum value "faction"
	GetCharactersCharacterIDContactsOKBodyItemsContactTypeFaction string = "faction"
)

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

func (m *GetCharactersCharacterIDContactsOKBodyItems) validateContactType(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateContactTypeEnum("contact_type", "body", *m.ContactType); err != nil {
		return err
	}

	return nil
}

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

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

	return nil
}

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

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