// Code generated by go-swagger; DO NOT EDIT.

// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package blaze_models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"strconv"

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

// ProductsResponse products response
//
// swagger:model ProductsResponse
type ProductsResponse struct {

	// limit
	Limit float64 `json:"limit,omitempty"`

	// skip
	Skip float64 `json:"skip,omitempty"`

	// total
	Total float64 `json:"total,omitempty"`

	// values
	Values []*ProductsResponseValuesItems0 `json:"values"`
}

// Validate validates this products response
func (m *ProductsResponse) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *ProductsResponse) validateValues(formats strfmt.Registry) error {

	if swag.IsZero(m.Values) { // not required
		return nil
	}

	for i := 0; i < len(m.Values); i++ {
		if swag.IsZero(m.Values[i]) { // not required
			continue
		}

		if m.Values[i] != nil {
			if err := m.Values[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("values" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

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

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

// ProductsResponseValuesItems0 products response values items0
//
// swagger:model ProductsResponseValuesItems0
type ProductsResponseValuesItems0 struct {

	// active
	Active bool `json:"active,omitempty"`

	// assets
	Assets []*ProductsResponseValuesItems0AssetsItems0 `json:"assets"`

	// automatic re order
	AutomaticReOrder bool `json:"automaticReOrder,omitempty"`

	// brand
	Brand string `json:"brand,omitempty"`

	// brand Id
	BrandID string `json:"brandId,omitempty"`

	// bundle items
	BundleItems []string `json:"bundleItems"`

	// by gram
	ByGram bool `json:"byGram,omitempty"`

	// by prepackage
	ByPrepackage bool `json:"byPrepackage,omitempty"`

	// cannabis type
	CannabisType string `json:"cannabisType,omitempty"`

	// category
	Category *ProductsResponseValuesItems0Category `json:"category,omitempty"`

	// category Id
	CategoryID string `json:"categoryId,omitempty"`

	// cbd
	Cbd float64 `json:"cbd,omitempty"`

	// cbda
	Cbda float64 `json:"cbda,omitempty"`

	// cbn
	Cbn float64 `json:"cbn,omitempty"`

	// company Id
	CompanyID string `json:"companyId,omitempty"`

	// company link Id
	CompanyLinkID string `json:"companyLinkId,omitempty"`

	// created
	Created int64 `json:"created,omitempty"`

	// custom gram type
	CustomGramType string `json:"customGramType,omitempty"`

	// custom tax info
	CustomTaxInfo string `json:"customTaxInfo,omitempty"`

	// custom weight
	CustomWeight float64 `json:"customWeight,omitempty"`

	// deleted
	Deleted bool `json:"deleted,omitempty"`

	// description
	Description string `json:"description,omitempty"`

	// dirty
	Dirty bool `json:"dirty,omitempty"`

	// discountable
	Discountable bool `json:"discountable,omitempty"`

	// enable excise tax
	EnableExciseTax bool `json:"enableExciseTax,omitempty"`

	// enable mix match
	EnableMixMatch bool `json:"enableMixMatch,omitempty"`

	// enable weedmap
	EnableWeedmap bool `json:"enableWeedmap,omitempty"`

	// flower type
	FlowerType string `json:"flowerType,omitempty"`

	// genetics
	Genetics string `json:"genetics,omitempty"`

	// id
	ID string `json:"id,omitempty"`

	// import Id
	ImportID string `json:"importId,omitempty"`

	// import src
	ImportSrc string `json:"importSrc,omitempty"`

	// low inventory notification
	LowInventoryNotification bool `json:"lowInventoryNotification,omitempty"`

	// low threshold
	LowThreshold float64 `json:"lowThreshold,omitempty"`

	// medical conditions
	MedicalConditions []string `json:"medicalConditions"`

	// medicinal
	Medicinal bool `json:"medicinal,omitempty"`

	// modified
	Modified int64 `json:"modified,omitempty"`

	// name
	Name string `json:"name,omitempty"`

	// notes
	Notes []string `json:"notes"`

	// potency
	Potency bool `json:"potency,omitempty"`

	// potency amount
	PotencyAmount string `json:"potencyAmount,omitempty"`

	// price breaks
	PriceBreaks []string `json:"priceBreaks"`

	// price includes a l excise
	PriceIncludesALExcise bool `json:"priceIncludesALExcise,omitempty"`

	// price includes excise
	PriceIncludesExcise bool `json:"priceIncludesExcise,omitempty"`

	// price ranges
	PriceRanges []*ProductsResponseValuesItems0PriceRangesItems0 `json:"priceRanges"`

	// pricing template Id
	PricingTemplateID string `json:"pricingTemplateId,omitempty"`

	// product sale type
	ProductSaleType string `json:"productSaleType,omitempty"`

	// product type
	ProductType string `json:"productType,omitempty"`

	// qb desktop item ref
	QbDesktopItemRef string `json:"qbDesktopItemRef,omitempty"`

	// qb item ref
	QbItemRef string `json:"qbItemRef,omitempty"`

	// quantities
	Quantities []*ProductsResponseValuesItems0QuantitiesItems0 `json:"quantities"`

	// re order level
	ReOrderLevel float64 `json:"reOrderLevel,omitempty"`

	// shop Id
	ShopID string `json:"shopId,omitempty"`

	// show in widget
	ShowInWidget bool `json:"showInWidget,omitempty"`

	// sku
	Sku string `json:"sku,omitempty"`

	// tags
	Tags []string `json:"tags"`

	// tax order
	TaxOrder string `json:"taxOrder,omitempty"`

	// tax tables
	TaxTables []string `json:"taxTables"`

	// tax type
	TaxType string `json:"taxType,omitempty"`

	// thc
	Thc float64 `json:"thc,omitempty"`

	// thca
	Thca float64 `json:"thca,omitempty"`

	// unit price
	UnitPrice float64 `json:"unitPrice,omitempty"`

	// unit value
	UnitValue float64 `json:"unitValue,omitempty"`

	// updated
	Updated bool `json:"updated,omitempty"`

	// vendor
	Vendor string `json:"vendor,omitempty"`

	// vendor Id
	VendorID string `json:"vendorId,omitempty"`

	// weight per unit
	WeightPerUnit string `json:"weightPerUnit,omitempty"`
}

// Validate validates this products response values items0
func (m *ProductsResponseValuesItems0) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

func (m *ProductsResponseValuesItems0) validateAssets(formats strfmt.Registry) error {

	if swag.IsZero(m.Assets) { // not required
		return nil
	}

	for i := 0; i < len(m.Assets); i++ {
		if swag.IsZero(m.Assets[i]) { // not required
			continue
		}

		if m.Assets[i] != nil {
			if err := m.Assets[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("assets" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

func (m *ProductsResponseValuesItems0) validateCategory(formats strfmt.Registry) error {

	if swag.IsZero(m.Category) { // not required
		return nil
	}

	if m.Category != nil {
		if err := m.Category.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("category")
			}
			return err
		}
	}

	return nil
}

func (m *ProductsResponseValuesItems0) validatePriceRanges(formats strfmt.Registry) error {

	if swag.IsZero(m.PriceRanges) { // not required
		return nil
	}

	for i := 0; i < len(m.PriceRanges); i++ {
		if swag.IsZero(m.PriceRanges[i]) { // not required
			continue
		}

		if m.PriceRanges[i] != nil {
			if err := m.PriceRanges[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("priceRanges" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

func (m *ProductsResponseValuesItems0) validateQuantities(formats strfmt.Registry) error {

	if swag.IsZero(m.Quantities) { // not required
		return nil
	}

	for i := 0; i < len(m.Quantities); i++ {
		if swag.IsZero(m.Quantities[i]) { // not required
			continue
		}

		if m.Quantities[i] != nil {
			if err := m.Quantities[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("quantities" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

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

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

// ProductsResponseValuesItems0AssetsItems0 products response values items0 assets items0
//
// swagger:model ProductsResponseValuesItems0AssetsItems0
type ProductsResponseValuesItems0AssetsItems0 struct {

	// active
	Active bool `json:"active,omitempty"`

	// asset type
	AssetType string `json:"assetType,omitempty"`

	// company Id
	CompanyID string `json:"companyId,omitempty"`

	// created
	Created int64 `json:"created,omitempty"`

	// deleted
	Deleted bool `json:"deleted,omitempty"`

	// id
	ID string `json:"id,omitempty"`

	// key
	Key string `json:"key,omitempty"`

	// large URL
	LargeURL string `json:"largeURL,omitempty"`

	// large x2 URL
	LargeX2URL string `json:"largeX2URL,omitempty"`

	// medium URL
	MediumURL string `json:"mediumURL,omitempty"`

	// modified
	Modified int64 `json:"modified,omitempty"`

	// name
	Name string `json:"name,omitempty"`

	// priority
	Priority float64 `json:"priority,omitempty"`

	// secured
	Secured bool `json:"secured,omitempty"`

	// thumb URL
	ThumbURL string `json:"thumbURL,omitempty"`

	// type
	Type string `json:"type,omitempty"`

	// updated
	Updated bool `json:"updated,omitempty"`
}

// Validate validates this products response values items0 assets items0
func (m *ProductsResponseValuesItems0AssetsItems0) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

// ProductsResponseValuesItems0Category products response values items0 category
//
// swagger:model ProductsResponseValuesItems0Category
type ProductsResponseValuesItems0Category struct {

	// active
	Active bool `json:"active,omitempty"`

	// cannabis
	Cannabis bool `json:"cannabis,omitempty"`

	// cannabis type
	CannabisType string `json:"cannabisType,omitempty"`

	// company Id
	CompanyID string `json:"companyId,omitempty"`

	// created
	Created int64 `json:"created,omitempty"`

	// deleted
	Deleted bool `json:"deleted,omitempty"`

	// dirty
	Dirty bool `json:"dirty,omitempty"`

	// id
	ID string `json:"id,omitempty"`

	// low threshold
	LowThreshold string `json:"lowThreshold,omitempty"`

	// modified
	Modified int64 `json:"modified,omitempty"`

	// name
	Name string `json:"name,omitempty"`

	// photo
	Photo *ProductsResponseValuesItems0CategoryPhoto `json:"photo,omitempty"`

	// priority
	Priority float64 `json:"priority,omitempty"`

	// shop Id
	ShopID string `json:"shopId,omitempty"`

	// unit type
	UnitType string `json:"unitType,omitempty"`

	// updated
	Updated bool `json:"updated,omitempty"`
}

// Validate validates this products response values items0 category
func (m *ProductsResponseValuesItems0Category) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *ProductsResponseValuesItems0Category) validatePhoto(formats strfmt.Registry) error {

	if swag.IsZero(m.Photo) { // not required
		return nil
	}

	if m.Photo != nil {
		if err := m.Photo.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("category" + "." + "photo")
			}
			return err
		}
	}

	return nil
}

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

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

// ProductsResponseValuesItems0CategoryPhoto products response values items0 category photo
//
// swagger:model ProductsResponseValuesItems0CategoryPhoto
type ProductsResponseValuesItems0CategoryPhoto struct {

	// active
	Active bool `json:"active,omitempty"`

	// asset type
	AssetType string `json:"assetType,omitempty"`

	// company Id
	CompanyID string `json:"companyId,omitempty"`

	// created
	Created int64 `json:"created,omitempty"`

	// deleted
	Deleted bool `json:"deleted,omitempty"`

	// id
	ID string `json:"id,omitempty"`

	// key
	Key string `json:"key,omitempty"`

	// large URL
	LargeURL string `json:"largeURL,omitempty"`

	// large x2 URL
	LargeX2URL string `json:"largeX2URL,omitempty"`

	// medium URL
	MediumURL string `json:"mediumURL,omitempty"`

	// modified
	Modified int64 `json:"modified,omitempty"`

	// name
	Name string `json:"name,omitempty"`

	// orig URL
	OrigURL string `json:"origURL,omitempty"`

	// priority
	Priority float64 `json:"priority,omitempty"`

	// public URL
	PublicURL string `json:"publicURL,omitempty"`

	// secured
	Secured bool `json:"secured,omitempty"`

	// thumb URL
	ThumbURL string `json:"thumbURL,omitempty"`

	// type
	Type string `json:"type,omitempty"`

	// updated
	Updated bool `json:"updated,omitempty"`
}

// Validate validates this products response values items0 category photo
func (m *ProductsResponseValuesItems0CategoryPhoto) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

// ProductsResponseValuesItems0PriceRangesItems0 products response values items0 price ranges items0
//
// swagger:model ProductsResponseValuesItems0PriceRangesItems0
type ProductsResponseValuesItems0PriceRangesItems0 struct {

	// id
	ID string `json:"id,omitempty"`

	// price
	Price float64 `json:"price,omitempty"`

	// priority
	Priority float64 `json:"priority,omitempty"`

	// weight tolerance
	WeightTolerance *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance `json:"weightTolerance,omitempty"`

	// weight tolerance Id
	WeightToleranceID string `json:"weightToleranceId,omitempty"`
}

// Validate validates this products response values items0 price ranges items0
func (m *ProductsResponseValuesItems0PriceRangesItems0) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *ProductsResponseValuesItems0PriceRangesItems0) validateWeightTolerance(formats strfmt.Registry) error {

	if swag.IsZero(m.WeightTolerance) { // not required
		return nil
	}

	if m.WeightTolerance != nil {
		if err := m.WeightTolerance.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("weightTolerance")
			}
			return err
		}
	}

	return nil
}

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

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

// ProductsResponseValuesItems0PriceRangesItems0WeightTolerance products response values items0 price ranges items0 weight tolerance
//
// swagger:model ProductsResponseValuesItems0PriceRangesItems0WeightTolerance
type ProductsResponseValuesItems0PriceRangesItems0WeightTolerance struct {

	// company Id
	CompanyID string `json:"companyId,omitempty"`

	// created
	Created int64 `json:"created,omitempty"`

	// deleted
	Deleted bool `json:"deleted,omitempty"`

	// enabled
	Enabled bool `json:"enabled,omitempty"`

	// end weight
	EndWeight float64 `json:"endWeight,omitempty"`

	// id
	ID string `json:"id,omitempty"`

	// modified
	Modified int64 `json:"modified,omitempty"`

	// name
	Name string `json:"name,omitempty"`

	// priority
	Priority float64 `json:"priority,omitempty"`

	// start weight
	StartWeight float64 `json:"startWeight,omitempty"`

	// unit value
	UnitValue float64 `json:"unitValue,omitempty"`

	// updated
	Updated bool `json:"updated,omitempty"`

	// weight key
	WeightKey string `json:"weightKey,omitempty"`

	// weight value
	WeightValue float64 `json:"weightValue,omitempty"`
}

// Validate validates this products response values items0 price ranges items0 weight tolerance
func (m *ProductsResponseValuesItems0PriceRangesItems0WeightTolerance) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

// ProductsResponseValuesItems0QuantitiesItems0 products response values items0 quantities items0
//
// swagger:model ProductsResponseValuesItems0QuantitiesItems0
type ProductsResponseValuesItems0QuantitiesItems0 struct {

	// company Id
	CompanyID string `json:"companyId,omitempty"`

	// created
	Created int64 `json:"created,omitempty"`

	// deleted
	Deleted bool `json:"deleted,omitempty"`

	// dirty
	Dirty bool `json:"dirty,omitempty"`

	// id
	ID string `json:"id,omitempty"`

	// inventory Id
	InventoryID string `json:"inventoryId,omitempty"`

	// modified
	Modified int64 `json:"modified,omitempty"`

	// quantity
	Quantity float64 `json:"quantity,omitempty"`

	// shop Id
	ShopID string `json:"shopId,omitempty"`

	// updated
	Updated bool `json:"updated,omitempty"`
}

// Validate validates this products response values items0 quantities items0
func (m *ProductsResponseValuesItems0QuantitiesItems0) Validate(formats strfmt.Registry) error {
	return nil
}

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

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