// 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 (
	strfmt "github.com/go-openapi/strfmt"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// GetCharactersCharacterIDCorporationhistoryOKBodyItems get_characters_character_id_corporationhistory_200_ok
//
// 200 ok object
// swagger:model getCharactersCharacterIdCorporationhistoryOKBodyItems

type GetCharactersCharacterIDCorporationhistoryOKBodyItems struct {

	// get_characters_character_id_corporationhistory_corporation_id
	//
	// corporation_id integer
	// Required: true
	CorporationID *int32 `json:"corporation_id"`

	// get_characters_character_id_corporationhistory_is_deleted
	//
	// True if the corporation has been deleted
	IsDeleted bool `json:"is_deleted,omitempty"`

	// get_characters_character_id_corporationhistory_record_id
	//
	// An incrementing ID that can be used to canonically establish order of records in cases where dates may be ambiguous
	// Required: true
	RecordID *int32 `json:"record_id"`

	// get_characters_character_id_corporationhistory_start_date
	//
	// start_date string
	// Required: true
	StartDate *strfmt.DateTime `json:"start_date"`
}

/* polymorph getCharactersCharacterIdCorporationhistoryOKBodyItems corporation_id false */

/* polymorph getCharactersCharacterIdCorporationhistoryOKBodyItems is_deleted false */

/* polymorph getCharactersCharacterIdCorporationhistoryOKBodyItems record_id false */

/* polymorph getCharactersCharacterIdCorporationhistoryOKBodyItems start_date false */

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

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

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

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

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

func (m *GetCharactersCharacterIDCorporationhistoryOKBodyItems) validateCorporationID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDCorporationhistoryOKBodyItems) validateRecordID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDCorporationhistoryOKBodyItems) validateStartDate(formats strfmt.Registry) error {

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

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

	return nil
}

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

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