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

// GetCharactersCharacterIDCalendarEventIDOKBody get_characters_character_id_calendar_event_id_ok
//
// Full details of a specific event
// swagger:model getCharactersCharacterIdCalendarEventIdOKBody

type GetCharactersCharacterIDCalendarEventIDOKBody struct {

	// get_characters_character_id_calendar_event_id_date
	//
	// date string
	// Required: true
	Date *strfmt.DateTime `json:"date"`

	// get_characters_character_id_calendar_event_id_duration
	//
	// Length in minutes
	// Required: true
	Duration *int32 `json:"duration"`

	// get_characters_character_id_calendar_event_id_event_id
	//
	// event_id integer
	// Required: true
	EventID *int32 `json:"event_id"`

	// get_characters_character_id_calendar_event_id_importance
	//
	// importance integer
	// Required: true
	Importance *int32 `json:"importance"`

	// get_characters_character_id_calendar_event_id_owner_id
	//
	// owner_id integer
	// Required: true
	OwnerID *int32 `json:"owner_id"`

	// get_characters_character_id_calendar_event_id_owner_name
	//
	// owner_name string
	// Required: true
	OwnerName *string `json:"owner_name"`

	// get_characters_character_id_calendar_event_id_owner_type
	//
	// owner_type string
	// Required: true
	OwnerType *string `json:"owner_type"`

	// get_characters_character_id_calendar_event_id_response
	//
	// response string
	// Required: true
	Response *string `json:"response"`

	// get_characters_character_id_calendar_event_id_text
	//
	// text string
	// Required: true
	Text *string `json:"text"`

	// get_characters_character_id_calendar_event_id_title
	//
	// title string
	// Required: true
	Title *string `json:"title"`
}

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody date false */

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody duration false */

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody event_id false */

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody importance false */

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody owner_id false */

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody owner_name false */

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody owner_type false */

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody response false */

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody text false */

/* polymorph getCharactersCharacterIdCalendarEventIdOKBody title false */

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

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

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

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

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

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

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

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

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

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

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

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

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateDate(formats strfmt.Registry) error {

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

	if err := validate.FormatOf("date", "body", "date-time", m.Date.String(), formats); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateDuration(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateEventID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateImportance(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateOwnerID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateOwnerName(formats strfmt.Registry) error {

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

	return nil
}

var getCharactersCharacterIdCalendarEventIdOKBodyTypeOwnerTypePropEnum []interface{}

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

const (
	// GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeEveServer captures enum value "eve_server"
	GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeEveServer string = "eve_server"
	// GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeCorporation captures enum value "corporation"
	GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeCorporation string = "corporation"
	// GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeFaction captures enum value "faction"
	GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeFaction string = "faction"
	// GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeCharacter captures enum value "character"
	GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeCharacter string = "character"
	// GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeAlliance captures enum value "alliance"
	GetCharactersCharacterIDCalendarEventIDOKBodyOwnerTypeAlliance string = "alliance"
)

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

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateOwnerType(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateOwnerTypeEnum("owner_type", "body", *m.OwnerType); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateResponse(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateText(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDCalendarEventIDOKBody) validateTitle(formats strfmt.Registry) error {

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

	return nil
}

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

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