// 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 items

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

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/taxnexus/go/lib/api/metrc-gw/metrc_gw_models"
)

// GetItemProductCategoriesReader is a Reader for the GetItemProductCategories structure.
type GetItemProductCategoriesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetItemProductCategoriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetItemProductCategoriesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetItemProductCategoriesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetItemProductCategoriesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetItemProductCategoriesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetItemProductCategoriesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, runtime.NewAPIError("unknown error", response, response.Code())
	}
}

// NewGetItemProductCategoriesOK creates a GetItemProductCategoriesOK with default headers values
func NewGetItemProductCategoriesOK() *GetItemProductCategoriesOK {
	return &GetItemProductCategoriesOK{}
}

/*GetItemProductCategoriesOK handles this case with default header values.

A list of Item Product Categories was succefully retrieved
*/
type GetItemProductCategoriesOK struct {
	Payload *metrc_gw_models.ProductCategoryResponse
}

func (o *GetItemProductCategoriesOK) Error() string {
	return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesOK  %+v", 200, o.Payload)
}

func (o *GetItemProductCategoriesOK) GetPayload() *metrc_gw_models.ProductCategoryResponse {
	return o.Payload
}

func (o *GetItemProductCategoriesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(metrc_gw_models.ProductCategoryResponse)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetItemProductCategoriesUnauthorized creates a GetItemProductCategoriesUnauthorized with default headers values
func NewGetItemProductCategoriesUnauthorized() *GetItemProductCategoriesUnauthorized {
	return &GetItemProductCategoriesUnauthorized{}
}

/*GetItemProductCategoriesUnauthorized handles this case with default header values.

Access unauthorized, invalid API-KEY was used
*/
type GetItemProductCategoriesUnauthorized struct {
	Payload *metrc_gw_models.Error
}

func (o *GetItemProductCategoriesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesUnauthorized  %+v", 401, o.Payload)
}

func (o *GetItemProductCategoriesUnauthorized) GetPayload() *metrc_gw_models.Error {
	return o.Payload
}

func (o *GetItemProductCategoriesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(metrc_gw_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetItemProductCategoriesForbidden creates a GetItemProductCategoriesForbidden with default headers values
func NewGetItemProductCategoriesForbidden() *GetItemProductCategoriesForbidden {
	return &GetItemProductCategoriesForbidden{}
}

/*GetItemProductCategoriesForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetItemProductCategoriesForbidden struct {
	Payload *metrc_gw_models.Error
}

func (o *GetItemProductCategoriesForbidden) Error() string {
	return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesForbidden  %+v", 403, o.Payload)
}

func (o *GetItemProductCategoriesForbidden) GetPayload() *metrc_gw_models.Error {
	return o.Payload
}

func (o *GetItemProductCategoriesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(metrc_gw_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetItemProductCategoriesNotFound creates a GetItemProductCategoriesNotFound with default headers values
func NewGetItemProductCategoriesNotFound() *GetItemProductCategoriesNotFound {
	return &GetItemProductCategoriesNotFound{}
}

/*GetItemProductCategoriesNotFound handles this case with default header values.

Resource was not found
*/
type GetItemProductCategoriesNotFound struct {
	Payload *metrc_gw_models.Error
}

func (o *GetItemProductCategoriesNotFound) Error() string {
	return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesNotFound  %+v", 404, o.Payload)
}

func (o *GetItemProductCategoriesNotFound) GetPayload() *metrc_gw_models.Error {
	return o.Payload
}

func (o *GetItemProductCategoriesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(metrc_gw_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetItemProductCategoriesInternalServerError creates a GetItemProductCategoriesInternalServerError with default headers values
func NewGetItemProductCategoriesInternalServerError() *GetItemProductCategoriesInternalServerError {
	return &GetItemProductCategoriesInternalServerError{}
}

/*GetItemProductCategoriesInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetItemProductCategoriesInternalServerError struct {
	Payload *metrc_gw_models.Error
}

func (o *GetItemProductCategoriesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /items/productcategories][%d] getItemProductCategoriesInternalServerError  %+v", 500, o.Payload)
}

func (o *GetItemProductCategoriesInternalServerError) GetPayload() *metrc_gw_models.Error {
	return o.Payload
}

func (o *GetItemProductCategoriesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(metrc_gw_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}
