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

// GetLoyaltyStoresCorporationIDOffersOKBodyItemsRequiredItemsItems get_loyalty_stores_corporation_id_offers_required_item
//
// required_item object
// swagger:model getLoyaltyStoresCorporationIdOffersOKBodyItemsRequiredItemsItems

type GetLoyaltyStoresCorporationIDOffersOKBodyItemsRequiredItemsItems struct {

	// get_loyalty_stores_corporation_id_offers_quantity
	//
	// quantity integer
	// Required: true
	Quantity *int32 `json:"quantity"`

	// get_loyalty_stores_corporation_id_offers_type_id
	//
	// type_id integer
	// Required: true
	TypeID *int32 `json:"type_id"`
}

/* polymorph getLoyaltyStoresCorporationIdOffersOKBodyItemsRequiredItemsItems quantity false */

/* polymorph getLoyaltyStoresCorporationIdOffersOKBodyItemsRequiredItemsItems type_id false */

// Validate validates this get loyalty stores corporation Id offers o k body items required items items
func (m *GetLoyaltyStoresCorporationIDOffersOKBodyItemsRequiredItemsItems) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *GetLoyaltyStoresCorporationIDOffersOKBodyItemsRequiredItemsItems) validateQuantity(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetLoyaltyStoresCorporationIDOffersOKBodyItemsRequiredItemsItems) validateTypeID(formats strfmt.Registry) error {

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

	return nil
}

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

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