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

// GetCorporationsCorporationIDContactsOKBodyItems get_corporations_corporation_id_contacts_200_ok
//
// 200 ok object
// swagger:model getCorporationsCorporationIdContactsOKBodyItems

type GetCorporationsCorporationIDContactsOKBodyItems struct {

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

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

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

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

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

/* polymorph getCorporationsCorporationIdContactsOKBodyItems contact_id false */

/* polymorph getCorporationsCorporationIdContactsOKBodyItems contact_type false */

/* polymorph getCorporationsCorporationIdContactsOKBodyItems is_watched false */

/* polymorph getCorporationsCorporationIdContactsOKBodyItems label_id false */

/* polymorph getCorporationsCorporationIdContactsOKBodyItems standing false */

// Validate validates this get corporations corporation Id contacts o k body items
func (m *GetCorporationsCorporationIDContactsOKBodyItems) 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 *GetCorporationsCorporationIDContactsOKBodyItems) validateContactID(formats strfmt.Registry) error {

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

	return nil
}

var getCorporationsCorporationIdContactsOKBodyItemsTypeContactTypePropEnum []interface{}

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

const (
	// GetCorporationsCorporationIDContactsOKBodyItemsContactTypeCharacter captures enum value "character"
	GetCorporationsCorporationIDContactsOKBodyItemsContactTypeCharacter string = "character"
	// GetCorporationsCorporationIDContactsOKBodyItemsContactTypeCorporation captures enum value "corporation"
	GetCorporationsCorporationIDContactsOKBodyItemsContactTypeCorporation string = "corporation"
	// GetCorporationsCorporationIDContactsOKBodyItemsContactTypeAlliance captures enum value "alliance"
	GetCorporationsCorporationIDContactsOKBodyItemsContactTypeAlliance string = "alliance"
	// GetCorporationsCorporationIDContactsOKBodyItemsContactTypeFaction captures enum value "faction"
	GetCorporationsCorporationIDContactsOKBodyItemsContactTypeFaction string = "faction"
)

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

func (m *GetCorporationsCorporationIDContactsOKBodyItems) 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 *GetCorporationsCorporationIDContactsOKBodyItems) validateStanding(formats strfmt.Registry) error {

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

	return nil
}

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

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