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

// GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItems get_characters_character_id_chat_channels_operator
//
// operator object
// swagger:model getCharactersCharacterIdChatChannelsOKBodyItemsOperatorsItems

type GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItems struct {

	// get_characters_character_id_chat_channels_accessor_id
	//
	// ID of a channel operator
	// Required: true
	AccessorID *int32 `json:"accessor_id"`

	// get_characters_character_id_chat_channels_accessor_type
	//
	// accessor_type string
	// Required: true
	AccessorType *string `json:"accessor_type"`
}

/* polymorph getCharactersCharacterIdChatChannelsOKBodyItemsOperatorsItems accessor_id false */

/* polymorph getCharactersCharacterIdChatChannelsOKBodyItemsOperatorsItems accessor_type false */

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

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

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

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

func (m *GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItems) validateAccessorID(formats strfmt.Registry) error {

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

	return nil
}

var getCharactersCharacterIdChatChannelsOKBodyItemsOperatorsItemsTypeAccessorTypePropEnum []interface{}

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

const (
	// GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItemsAccessorTypeCharacter captures enum value "character"
	GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItemsAccessorTypeCharacter string = "character"
	// GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItemsAccessorTypeCorporation captures enum value "corporation"
	GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItemsAccessorTypeCorporation string = "corporation"
	// GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItemsAccessorTypeAlliance captures enum value "alliance"
	GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItemsAccessorTypeAlliance string = "alliance"
)

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

func (m *GetCharactersCharacterIDChatChannelsOKBodyItemsOperatorsItems) validateAccessorType(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateAccessorTypeEnum("accessor_type", "body", *m.AccessorType); err != nil {
		return err
	}

	return nil
}

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

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