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

// GetCorporationsCorporationIDAlliancehistoryOKBodyItems get_corporations_corporation_id_alliancehistory_200_ok
//
// 200 ok object
// swagger:model getCorporationsCorporationIdAlliancehistoryOKBodyItems

type GetCorporationsCorporationIDAlliancehistoryOKBodyItems struct {

	// get_corporations_corporation_id_alliancehistory_alliance_id
	//
	// alliance_id integer
	AllianceID int32 `json:"alliance_id,omitempty"`

	// get_corporations_corporation_id_alliancehistory_is_deleted
	//
	// True if the alliance has been closed
	IsDeleted bool `json:"is_deleted,omitempty"`

	// get_corporations_corporation_id_alliancehistory_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_corporations_corporation_id_alliancehistory_start_date
	//
	// start_date string
	// Required: true
	StartDate *strfmt.DateTime `json:"start_date"`
}

/* polymorph getCorporationsCorporationIdAlliancehistoryOKBodyItems alliance_id false */

/* polymorph getCorporationsCorporationIdAlliancehistoryOKBodyItems is_deleted false */

/* polymorph getCorporationsCorporationIdAlliancehistoryOKBodyItems record_id false */

/* polymorph getCorporationsCorporationIdAlliancehistoryOKBodyItems start_date false */

// Validate validates this get corporations corporation Id alliancehistory o k body items
func (m *GetCorporationsCorporationIDAlliancehistoryOKBodyItems) Validate(formats strfmt.Registry) error {
	var res []error

	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 *GetCorporationsCorporationIDAlliancehistoryOKBodyItems) validateRecordID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCorporationsCorporationIDAlliancehistoryOKBodyItems) 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 *GetCorporationsCorporationIDAlliancehistoryOKBodyItems) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

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