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

// GetCharactersCharacterIDContractsContractIDBidsOKBodyItems get_characters_character_id_contracts_contract_id_bids_200_ok
//
// 200 ok object
// swagger:model getCharactersCharacterIdContractsContractIdBidsOKBodyItems

type GetCharactersCharacterIDContractsContractIDBidsOKBodyItems struct {

	// get_characters_character_id_contracts_contract_id_bids_amount
	//
	// The ammount bid
	// Required: true
	Amount *float32 `json:"amount"`

	// get_characters_character_id_contracts_contract_id_bids_bid_id
	//
	// Unique ID for the bid
	// Required: true
	BidID *int32 `json:"bid_id"`

	// get_characters_character_id_contracts_contract_id_bids_bidder_id
	//
	// Character ID of the bidder
	// Required: true
	BidderID *int32 `json:"bidder_id"`

	// get_characters_character_id_contracts_contract_id_bids_date_bid
	//
	// Datetime when the bid was placed
	// Required: true
	DateBid *strfmt.DateTime `json:"date_bid"`
}

/* polymorph getCharactersCharacterIdContractsContractIdBidsOKBodyItems amount false */

/* polymorph getCharactersCharacterIdContractsContractIdBidsOKBodyItems bid_id false */

/* polymorph getCharactersCharacterIdContractsContractIdBidsOKBodyItems bidder_id false */

/* polymorph getCharactersCharacterIdContractsContractIdBidsOKBodyItems date_bid false */

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

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

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

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

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

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

func (m *GetCharactersCharacterIDContractsContractIDBidsOKBodyItems) validateAmount(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDContractsContractIDBidsOKBodyItems) validateBidID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDContractsContractIDBidsOKBodyItems) validateBidderID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetCharactersCharacterIDContractsContractIDBidsOKBodyItems) validateDateBid(formats strfmt.Registry) error {

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

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

	return nil
}

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

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