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

// GetLabtestTypesReader is a Reader for the GetLabtestTypes structure.
type GetLabtestTypesReader struct {
	formats strfmt.Registry
}

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

// NewGetLabtestTypesOK creates a GetLabtestTypesOK with default headers values
func NewGetLabtestTypesOK() *GetLabtestTypesOK {
	return &GetLabtestTypesOK{}
}

/*GetLabtestTypesOK handles this case with default header values.

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

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

func (o *GetLabtestTypesOK) GetPayload() *metrc_gw_models.LabTestTypeResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.LabTestTypeResponse)

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

	return nil
}

// NewGetLabtestTypesUnauthorized creates a GetLabtestTypesUnauthorized with default headers values
func NewGetLabtestTypesUnauthorized() *GetLabtestTypesUnauthorized {
	return &GetLabtestTypesUnauthorized{}
}

/*GetLabtestTypesUnauthorized handles this case with default header values.

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

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

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

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

// NewGetLabtestTypesForbidden creates a GetLabtestTypesForbidden with default headers values
func NewGetLabtestTypesForbidden() *GetLabtestTypesForbidden {
	return &GetLabtestTypesForbidden{}
}

/*GetLabtestTypesForbidden handles this case with default header values.

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

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

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

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

// NewGetLabtestTypesNotFound creates a GetLabtestTypesNotFound with default headers values
func NewGetLabtestTypesNotFound() *GetLabtestTypesNotFound {
	return &GetLabtestTypesNotFound{}
}

/*GetLabtestTypesNotFound handles this case with default header values.

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

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

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

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

// NewGetLabtestTypesInternalServerError creates a GetLabtestTypesInternalServerError with default headers values
func NewGetLabtestTypesInternalServerError() *GetLabtestTypesInternalServerError {
	return &GetLabtestTypesInternalServerError{}
}

/*GetLabtestTypesInternalServerError handles this case with default header values.

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

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

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

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