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

// GetBrandsReader is a Reader for the GetBrands structure.
type GetBrandsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetBrandsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 401:
		result := NewGetBrandsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetBrandsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetBrandsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetBrandsInternalServerError()
		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())
	}
}

// NewGetBrandsUnauthorized creates a GetBrandsUnauthorized with default headers values
func NewGetBrandsUnauthorized() *GetBrandsUnauthorized {
	return &GetBrandsUnauthorized{}
}

/*GetBrandsUnauthorized handles this case with default header values.

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

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

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

func (o *GetBrandsUnauthorized) 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
}

// NewGetBrandsForbidden creates a GetBrandsForbidden with default headers values
func NewGetBrandsForbidden() *GetBrandsForbidden {
	return &GetBrandsForbidden{}
}

/*GetBrandsForbidden handles this case with default header values.

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

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

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

func (o *GetBrandsForbidden) 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
}

// NewGetBrandsNotFound creates a GetBrandsNotFound with default headers values
func NewGetBrandsNotFound() *GetBrandsNotFound {
	return &GetBrandsNotFound{}
}

/*GetBrandsNotFound handles this case with default header values.

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

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

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

func (o *GetBrandsNotFound) 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
}

// NewGetBrandsInternalServerError creates a GetBrandsInternalServerError with default headers values
func NewGetBrandsInternalServerError() *GetBrandsInternalServerError {
	return &GetBrandsInternalServerError{}
}

/*GetBrandsInternalServerError handles this case with default header values.

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

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

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

func (o *GetBrandsInternalServerError) 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
}
