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

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

// GetHarvestWasteTypesReader is a Reader for the GetHarvestWasteTypes structure.
type GetHarvestWasteTypesReader struct {
	formats strfmt.Registry
}

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

// NewGetHarvestWasteTypesOK creates a GetHarvestWasteTypesOK with default headers values
func NewGetHarvestWasteTypesOK() *GetHarvestWasteTypesOK {
	return &GetHarvestWasteTypesOK{}
}

/*GetHarvestWasteTypesOK handles this case with default header values.

A list of Harvest Waste Types was succefully retrieved
*/
type GetHarvestWasteTypesOK struct {
	Payload *metrc_gw_models.HarvestWasteTypeResponse
}

func (o *GetHarvestWasteTypesOK) Error() string {
	return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesOK  %+v", 200, o.Payload)
}

func (o *GetHarvestWasteTypesOK) GetPayload() *metrc_gw_models.HarvestWasteTypeResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.HarvestWasteTypeResponse)

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

	return nil
}

// NewGetHarvestWasteTypesUnauthorized creates a GetHarvestWasteTypesUnauthorized with default headers values
func NewGetHarvestWasteTypesUnauthorized() *GetHarvestWasteTypesUnauthorized {
	return &GetHarvestWasteTypesUnauthorized{}
}

/*GetHarvestWasteTypesUnauthorized handles this case with default header values.

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

func (o *GetHarvestWasteTypesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetHarvestWasteTypesForbidden creates a GetHarvestWasteTypesForbidden with default headers values
func NewGetHarvestWasteTypesForbidden() *GetHarvestWasteTypesForbidden {
	return &GetHarvestWasteTypesForbidden{}
}

/*GetHarvestWasteTypesForbidden handles this case with default header values.

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

func (o *GetHarvestWasteTypesForbidden) Error() string {
	return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetHarvestWasteTypesNotFound creates a GetHarvestWasteTypesNotFound with default headers values
func NewGetHarvestWasteTypesNotFound() *GetHarvestWasteTypesNotFound {
	return &GetHarvestWasteTypesNotFound{}
}

/*GetHarvestWasteTypesNotFound handles this case with default header values.

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

func (o *GetHarvestWasteTypesNotFound) Error() string {
	return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetHarvestWasteTypesInternalServerError creates a GetHarvestWasteTypesInternalServerError with default headers values
func NewGetHarvestWasteTypesInternalServerError() *GetHarvestWasteTypesInternalServerError {
	return &GetHarvestWasteTypesInternalServerError{}
}

/*GetHarvestWasteTypesInternalServerError handles this case with default header values.

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

func (o *GetHarvestWasteTypesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /harvests/wastetypes][%d] getHarvestWasteTypesInternalServerError  %+v", 500, o.Payload)
}

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

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