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

// PostHarvestPackagesReader is a Reader for the PostHarvestPackages structure.
type PostHarvestPackagesReader struct {
	formats strfmt.Registry
}

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

// NewPostHarvestPackagesOK creates a PostHarvestPackagesOK with default headers values
func NewPostHarvestPackagesOK() *PostHarvestPackagesOK {
	return &PostHarvestPackagesOK{}
}

/*PostHarvestPackagesOK handles this case with default header values.

An array of HarvestPackage records with the new IDs
*/
type PostHarvestPackagesOK struct {
	Payload *metrc_gw_models.PlantResponse
}

func (o *PostHarvestPackagesOK) Error() string {
	return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesOK  %+v", 200, o.Payload)
}

func (o *PostHarvestPackagesOK) GetPayload() *metrc_gw_models.PlantResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.PlantResponse)

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

	return nil
}

// NewPostHarvestPackagesUnauthorized creates a PostHarvestPackagesUnauthorized with default headers values
func NewPostHarvestPackagesUnauthorized() *PostHarvestPackagesUnauthorized {
	return &PostHarvestPackagesUnauthorized{}
}

/*PostHarvestPackagesUnauthorized handles this case with default header values.

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

func (o *PostHarvestPackagesUnauthorized) Error() string {
	return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewPostHarvestPackagesForbidden creates a PostHarvestPackagesForbidden with default headers values
func NewPostHarvestPackagesForbidden() *PostHarvestPackagesForbidden {
	return &PostHarvestPackagesForbidden{}
}

/*PostHarvestPackagesForbidden handles this case with default header values.

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

func (o *PostHarvestPackagesForbidden) Error() string {
	return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesForbidden  %+v", 403, o.Payload)
}

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

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

// NewPostHarvestPackagesNotFound creates a PostHarvestPackagesNotFound with default headers values
func NewPostHarvestPackagesNotFound() *PostHarvestPackagesNotFound {
	return &PostHarvestPackagesNotFound{}
}

/*PostHarvestPackagesNotFound handles this case with default header values.

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

func (o *PostHarvestPackagesNotFound) Error() string {
	return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesNotFound  %+v", 404, o.Payload)
}

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

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

// NewPostHarvestPackagesInternalServerError creates a PostHarvestPackagesInternalServerError with default headers values
func NewPostHarvestPackagesInternalServerError() *PostHarvestPackagesInternalServerError {
	return &PostHarvestPackagesInternalServerError{}
}

/*PostHarvestPackagesInternalServerError handles this case with default header values.

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

func (o *PostHarvestPackagesInternalServerError) Error() string {
	return fmt.Sprintf("[POST /harvestpackages][%d] postHarvestPackagesInternalServerError  %+v", 500, o.Payload)
}

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

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