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

// GetCharactersCharacterIDContractsOKBodyItems get_characters_character_id_contracts_200_ok
//
// 200 ok object
// swagger:model getCharactersCharacterIdContractsOKBodyItems

type GetCharactersCharacterIDContractsOKBodyItems struct {

	// get_characters_character_id_contracts_acceptor_id
	//
	// Who will accept the contract. If assignee_id is same as acceptorID then character ID else corporation ID (The contract accepted by the corporation)
	// Required: true
	AcceptorID *int32 `json:"acceptor_id"`

	// get_characters_character_id_contracts_assignee_id
	//
	// ID to whom the contract is assigned, can be corporation or character ID
	// Required: true
	AssigneeID *int32 `json:"assignee_id"`

	// get_characters_character_id_contracts_availability
	//
	// To whom the contract is available
	// Required: true
	Availability *string `json:"availability"`

	// get_characters_character_id_contracts_buyout
	//
	// Buyout price (for Auctions only)
	Buyout float32 `json:"buyout,omitempty"`

	// get_characters_character_id_contracts_collateral
	//
	// Collateral price (for Couriers only)
	Collateral float32 `json:"collateral,omitempty"`

	// get_characters_character_id_contracts_contract_id
	//
	// contract_id integer
	// Required: true
	ContractID *int32 `json:"contract_id"`

	// get_characters_character_id_contracts_date_accepted
	//
	// Date of confirmation of contract
	DateAccepted strfmt.DateTime `json:"date_accepted,omitempty"`

	// get_characters_character_id_contracts_date_completed
	//
	// Date of completed of contract
	DateCompleted strfmt.DateTime `json:"date_completed,omitempty"`

	// get_characters_character_id_contracts_date_expired
	//
	// Expiration date of the contract
	// Required: true
	DateExpired *strfmt.DateTime `json:"date_expired"`

	// get_characters_character_id_contracts_date_issued
	//
	// Сreation date of the contract
	// Required: true
	DateIssued *strfmt.DateTime `json:"date_issued"`

	// get_characters_character_id_contracts_days_to_complete
	//
	// Number of days to perform the contract
	DaysToComplete int32 `json:"days_to_complete,omitempty"`

	// get_characters_character_id_contracts_end_location_id
	//
	// End location ID (for Couriers contract)
	EndLocationID int64 `json:"end_location_id,omitempty"`

	// get_characters_character_id_contracts_for_corporation
	//
	// true if the contract was issued on behalf of the issuer's corporation
	// Required: true
	ForCorporation *bool `json:"for_corporation"`

	// get_characters_character_id_contracts_issuer_corporation_id
	//
	// Character's corporation ID for the issuer
	// Required: true
	IssuerCorporationID *int32 `json:"issuer_corporation_id"`

	// get_characters_character_id_contracts_issuer_id
	//
	// Character ID for the issuer
	// Required: true
	IssuerID *int32 `json:"issuer_id"`

	// get_characters_character_id_contracts_price
	//
	// Price of contract (for ItemsExchange and Auctions)
	Price float32 `json:"price,omitempty"`

	// get_characters_character_id_contracts_reward
	//
	// Remuneration for contract (for Couriers only)
	Reward float32 `json:"reward,omitempty"`

	// get_characters_character_id_contracts_start_location_id
	//
	// Start location ID (for Couriers contract)
	StartLocationID int64 `json:"start_location_id,omitempty"`

	// get_characters_character_id_contracts_status
	//
	// Status of the the contract
	// Required: true
	Status *string `json:"status"`

	// get_characters_character_id_contracts_title
	//
	// Title of the contract
	Title string `json:"title,omitempty"`

	// get_characters_character_id_contracts_type
	//
	// Type of the contract
	// Required: true
	Type *string `json:"type"`

	// get_characters_character_id_contracts_volume
	//
	// Volume of items in the contract
	Volume float32 `json:"volume,omitempty"`
}

/* polymorph getCharactersCharacterIdContractsOKBodyItems acceptor_id false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems assignee_id false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems availability false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems buyout false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems collateral false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems contract_id false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems date_accepted false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems date_completed false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems date_expired false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems date_issued false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems days_to_complete false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems end_location_id false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems for_corporation false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems issuer_corporation_id false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems issuer_id false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems price false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems reward false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems start_location_id false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems status false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems title false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems type false */

/* polymorph getCharactersCharacterIdContractsOKBodyItems volume false */

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

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

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

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

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

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

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

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

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

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

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

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

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

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateAcceptorID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateAssigneeID(formats strfmt.Registry) error {

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

	return nil
}

var getCharactersCharacterIdContractsOKBodyItemsTypeAvailabilityPropEnum []interface{}

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

const (
	// GetCharactersCharacterIDContractsOKBodyItemsAvailabilityPublic captures enum value "public"
	GetCharactersCharacterIDContractsOKBodyItemsAvailabilityPublic string = "public"
	// GetCharactersCharacterIDContractsOKBodyItemsAvailabilityPersonal captures enum value "personal"
	GetCharactersCharacterIDContractsOKBodyItemsAvailabilityPersonal string = "personal"
	// GetCharactersCharacterIDContractsOKBodyItemsAvailabilityCorporation captures enum value "corporation"
	GetCharactersCharacterIDContractsOKBodyItemsAvailabilityCorporation string = "corporation"
	// GetCharactersCharacterIDContractsOKBodyItemsAvailabilityAlliance captures enum value "alliance"
	GetCharactersCharacterIDContractsOKBodyItemsAvailabilityAlliance string = "alliance"
)

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

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateAvailability(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateAvailabilityEnum("availability", "body", *m.Availability); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateContractID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateDateExpired(formats strfmt.Registry) error {

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

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

	return nil
}

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateDateIssued(formats strfmt.Registry) error {

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

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

	return nil
}

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateForCorporation(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateIssuerCorporationID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateIssuerID(formats strfmt.Registry) error {

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

	return nil
}

var getCharactersCharacterIdContractsOKBodyItemsTypeStatusPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["outstanding","in_progress","finished_issuer","finished_contractor","finished","cancelled","rejected","failed","deleted","reversed"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getCharactersCharacterIdContractsOKBodyItemsTypeStatusPropEnum = append(getCharactersCharacterIdContractsOKBodyItemsTypeStatusPropEnum, v)
	}
}

const (
	// GetCharactersCharacterIDContractsOKBodyItemsStatusOutstanding captures enum value "outstanding"
	GetCharactersCharacterIDContractsOKBodyItemsStatusOutstanding string = "outstanding"
	// GetCharactersCharacterIDContractsOKBodyItemsStatusInProgress captures enum value "in_progress"
	GetCharactersCharacterIDContractsOKBodyItemsStatusInProgress string = "in_progress"
	// GetCharactersCharacterIDContractsOKBodyItemsStatusFinishedIssuer captures enum value "finished_issuer"
	GetCharactersCharacterIDContractsOKBodyItemsStatusFinishedIssuer string = "finished_issuer"
	// GetCharactersCharacterIDContractsOKBodyItemsStatusFinishedContractor captures enum value "finished_contractor"
	GetCharactersCharacterIDContractsOKBodyItemsStatusFinishedContractor string = "finished_contractor"
	// GetCharactersCharacterIDContractsOKBodyItemsStatusFinished captures enum value "finished"
	GetCharactersCharacterIDContractsOKBodyItemsStatusFinished string = "finished"
	// GetCharactersCharacterIDContractsOKBodyItemsStatusCancelled captures enum value "cancelled"
	GetCharactersCharacterIDContractsOKBodyItemsStatusCancelled string = "cancelled"
	// GetCharactersCharacterIDContractsOKBodyItemsStatusRejected captures enum value "rejected"
	GetCharactersCharacterIDContractsOKBodyItemsStatusRejected string = "rejected"
	// GetCharactersCharacterIDContractsOKBodyItemsStatusFailed captures enum value "failed"
	GetCharactersCharacterIDContractsOKBodyItemsStatusFailed string = "failed"
	// GetCharactersCharacterIDContractsOKBodyItemsStatusDeleted captures enum value "deleted"
	GetCharactersCharacterIDContractsOKBodyItemsStatusDeleted string = "deleted"
	// GetCharactersCharacterIDContractsOKBodyItemsStatusReversed captures enum value "reversed"
	GetCharactersCharacterIDContractsOKBodyItemsStatusReversed string = "reversed"
)

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

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateStatus(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateStatusEnum("status", "body", *m.Status); err != nil {
		return err
	}

	return nil
}

var getCharactersCharacterIdContractsOKBodyItemsTypeTypePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["unknown","item_exchange","auction","courier","loan"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getCharactersCharacterIdContractsOKBodyItemsTypeTypePropEnum = append(getCharactersCharacterIdContractsOKBodyItemsTypeTypePropEnum, v)
	}
}

const (
	// GetCharactersCharacterIDContractsOKBodyItemsTypeUnknown captures enum value "unknown"
	GetCharactersCharacterIDContractsOKBodyItemsTypeUnknown string = "unknown"
	// GetCharactersCharacterIDContractsOKBodyItemsTypeItemExchange captures enum value "item_exchange"
	GetCharactersCharacterIDContractsOKBodyItemsTypeItemExchange string = "item_exchange"
	// GetCharactersCharacterIDContractsOKBodyItemsTypeAuction captures enum value "auction"
	GetCharactersCharacterIDContractsOKBodyItemsTypeAuction string = "auction"
	// GetCharactersCharacterIDContractsOKBodyItemsTypeCourier captures enum value "courier"
	GetCharactersCharacterIDContractsOKBodyItemsTypeCourier string = "courier"
	// GetCharactersCharacterIDContractsOKBodyItemsTypeLoan captures enum value "loan"
	GetCharactersCharacterIDContractsOKBodyItemsTypeLoan string = "loan"
)

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

func (m *GetCharactersCharacterIDContractsOKBodyItems) validateType(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateTypeEnum("type", "body", *m.Type); err != nil {
		return err
	}

	return nil
}

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

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