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

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

// GetLabtestStatesReader is a Reader for the GetLabtestStates structure.
type GetLabtestStatesReader struct {
	formats strfmt.Registry
}

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

// NewGetLabtestStatesOK creates a GetLabtestStatesOK with default headers values
func NewGetLabtestStatesOK() *GetLabtestStatesOK {
	return &GetLabtestStatesOK{}
}

/*GetLabtestStatesOK handles this case with default header values.

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

func (o *GetLabtestStatesOK) Error() string {
	return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesOK  %+v", 200, o.Payload)
}

func (o *GetLabtestStatesOK) GetPayload() *metrc_gw_models.LabTestStateResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.LabTestStateResponse)

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

	return nil
}

// NewGetLabtestStatesUnauthorized creates a GetLabtestStatesUnauthorized with default headers values
func NewGetLabtestStatesUnauthorized() *GetLabtestStatesUnauthorized {
	return &GetLabtestStatesUnauthorized{}
}

/*GetLabtestStatesUnauthorized handles this case with default header values.

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

func (o *GetLabtestStatesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetLabtestStatesForbidden creates a GetLabtestStatesForbidden with default headers values
func NewGetLabtestStatesForbidden() *GetLabtestStatesForbidden {
	return &GetLabtestStatesForbidden{}
}

/*GetLabtestStatesForbidden handles this case with default header values.

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

func (o *GetLabtestStatesForbidden) Error() string {
	return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetLabtestStatesNotFound creates a GetLabtestStatesNotFound with default headers values
func NewGetLabtestStatesNotFound() *GetLabtestStatesNotFound {
	return &GetLabtestStatesNotFound{}
}

/*GetLabtestStatesNotFound handles this case with default header values.

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

func (o *GetLabtestStatesNotFound) Error() string {
	return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetLabtestStatesInternalServerError creates a GetLabtestStatesInternalServerError with default headers values
func NewGetLabtestStatesInternalServerError() *GetLabtestStatesInternalServerError {
	return &GetLabtestStatesInternalServerError{}
}

/*GetLabtestStatesInternalServerError handles this case with default header values.

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

func (o *GetLabtestStatesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /labtests/states][%d] getLabtestStatesInternalServerError  %+v", 500, o.Payload)
}

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

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