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

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

// PutPlantBatchesReader is a Reader for the PutPlantBatches structure.
type PutPlantBatchesReader struct {
	formats strfmt.Registry
}

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

// NewPutPlantBatchesOK creates a PutPlantBatchesOK with default headers values
func NewPutPlantBatchesOK() *PutPlantBatchesOK {
	return &PutPlantBatchesOK{}
}

/*PutPlantBatchesOK handles this case with default header values.

An array of Plant Batches records
*/
type PutPlantBatchesOK struct {
	Payload *metrc_gw_models.PlantBatchResponse
}

func (o *PutPlantBatchesOK) Error() string {
	return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesOK  %+v", 200, o.Payload)
}

func (o *PutPlantBatchesOK) GetPayload() *metrc_gw_models.PlantBatchResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.PlantBatchResponse)

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

	return nil
}

// NewPutPlantBatchesUnauthorized creates a PutPlantBatchesUnauthorized with default headers values
func NewPutPlantBatchesUnauthorized() *PutPlantBatchesUnauthorized {
	return &PutPlantBatchesUnauthorized{}
}

/*PutPlantBatchesUnauthorized handles this case with default header values.

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

func (o *PutPlantBatchesUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPutPlantBatchesForbidden creates a PutPlantBatchesForbidden with default headers values
func NewPutPlantBatchesForbidden() *PutPlantBatchesForbidden {
	return &PutPlantBatchesForbidden{}
}

/*PutPlantBatchesForbidden handles this case with default header values.

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

func (o *PutPlantBatchesForbidden) Error() string {
	return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesForbidden  %+v", 403, o.Payload)
}

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

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

// NewPutPlantBatchesNotFound creates a PutPlantBatchesNotFound with default headers values
func NewPutPlantBatchesNotFound() *PutPlantBatchesNotFound {
	return &PutPlantBatchesNotFound{}
}

/*PutPlantBatchesNotFound handles this case with default header values.

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

func (o *PutPlantBatchesNotFound) Error() string {
	return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesNotFound  %+v", 404, o.Payload)
}

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

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

// NewPutPlantBatchesInternalServerError creates a PutPlantBatchesInternalServerError with default headers values
func NewPutPlantBatchesInternalServerError() *PutPlantBatchesInternalServerError {
	return &PutPlantBatchesInternalServerError{}
}

/*PutPlantBatchesInternalServerError handles this case with default header values.

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

func (o *PutPlantBatchesInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /plantbatches][%d] putPlantBatchesInternalServerError  %+v", 500, o.Payload)
}

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

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