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

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

// GetCustomerTypesReader is a Reader for the GetCustomerTypes structure.
type GetCustomerTypesReader struct {
	formats strfmt.Registry
}

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

// NewGetCustomerTypesOK creates a GetCustomerTypesOK with default headers values
func NewGetCustomerTypesOK() *GetCustomerTypesOK {
	return &GetCustomerTypesOK{}
}

/*GetCustomerTypesOK handles this case with default header values.

A list of active Customer Types was succefully retrieved
*/
type GetCustomerTypesOK struct {
	Payload *metrc_gw_models.CustomerTypeResponse
}

func (o *GetCustomerTypesOK) Error() string {
	return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesOK  %+v", 200, o.Payload)
}

func (o *GetCustomerTypesOK) GetPayload() *metrc_gw_models.CustomerTypeResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.CustomerTypeResponse)

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

	return nil
}

// NewGetCustomerTypesUnauthorized creates a GetCustomerTypesUnauthorized with default headers values
func NewGetCustomerTypesUnauthorized() *GetCustomerTypesUnauthorized {
	return &GetCustomerTypesUnauthorized{}
}

/*GetCustomerTypesUnauthorized handles this case with default header values.

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

func (o *GetCustomerTypesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetCustomerTypesForbidden creates a GetCustomerTypesForbidden with default headers values
func NewGetCustomerTypesForbidden() *GetCustomerTypesForbidden {
	return &GetCustomerTypesForbidden{}
}

/*GetCustomerTypesForbidden handles this case with default header values.

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

func (o *GetCustomerTypesForbidden) Error() string {
	return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetCustomerTypesNotFound creates a GetCustomerTypesNotFound with default headers values
func NewGetCustomerTypesNotFound() *GetCustomerTypesNotFound {
	return &GetCustomerTypesNotFound{}
}

/*GetCustomerTypesNotFound handles this case with default header values.

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

func (o *GetCustomerTypesNotFound) Error() string {
	return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetCustomerTypesInternalServerError creates a GetCustomerTypesInternalServerError with default headers values
func NewGetCustomerTypesInternalServerError() *GetCustomerTypesInternalServerError {
	return &GetCustomerTypesInternalServerError{}
}

/*GetCustomerTypesInternalServerError handles this case with default header values.

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

func (o *GetCustomerTypesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /sales/customertypes][%d] getCustomerTypesInternalServerError  %+v", 500, o.Payload)
}

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

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