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

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

// GetPlantWasteReasonsReader is a Reader for the GetPlantWasteReasons structure.
type GetPlantWasteReasonsReader struct {
	formats strfmt.Registry
}

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

// NewGetPlantWasteReasonsOK creates a GetPlantWasteReasonsOK with default headers values
func NewGetPlantWasteReasonsOK() *GetPlantWasteReasonsOK {
	return &GetPlantWasteReasonsOK{}
}

/*GetPlantWasteReasonsOK handles this case with default header values.

Plant Waste Reasons were successfully retrieved
*/
type GetPlantWasteReasonsOK struct {
	Payload *metrc_gw_models.PlantWasteReasonResponse
}

func (o *GetPlantWasteReasonsOK) Error() string {
	return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsOK  %+v", 200, o.Payload)
}

func (o *GetPlantWasteReasonsOK) GetPayload() *metrc_gw_models.PlantWasteReasonResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.PlantWasteReasonResponse)

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

	return nil
}

// NewGetPlantWasteReasonsUnauthorized creates a GetPlantWasteReasonsUnauthorized with default headers values
func NewGetPlantWasteReasonsUnauthorized() *GetPlantWasteReasonsUnauthorized {
	return &GetPlantWasteReasonsUnauthorized{}
}

/*GetPlantWasteReasonsUnauthorized handles this case with default header values.

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

func (o *GetPlantWasteReasonsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetPlantWasteReasonsForbidden creates a GetPlantWasteReasonsForbidden with default headers values
func NewGetPlantWasteReasonsForbidden() *GetPlantWasteReasonsForbidden {
	return &GetPlantWasteReasonsForbidden{}
}

/*GetPlantWasteReasonsForbidden handles this case with default header values.

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

func (o *GetPlantWasteReasonsForbidden) Error() string {
	return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetPlantWasteReasonsNotFound creates a GetPlantWasteReasonsNotFound with default headers values
func NewGetPlantWasteReasonsNotFound() *GetPlantWasteReasonsNotFound {
	return &GetPlantWasteReasonsNotFound{}
}

/*GetPlantWasteReasonsNotFound handles this case with default header values.

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

func (o *GetPlantWasteReasonsNotFound) Error() string {
	return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetPlantWasteReasonsInternalServerError creates a GetPlantWasteReasonsInternalServerError with default headers values
func NewGetPlantWasteReasonsInternalServerError() *GetPlantWasteReasonsInternalServerError {
	return &GetPlantWasteReasonsInternalServerError{}
}

/*GetPlantWasteReasonsInternalServerError handles this case with default header values.

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

func (o *GetPlantWasteReasonsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /plants/wastereasons][%d] getPlantWasteReasonsInternalServerError  %+v", 500, o.Payload)
}

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

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