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

// GetPlantGrowthPhasesReader is a Reader for the GetPlantGrowthPhases structure.
type GetPlantGrowthPhasesReader struct {
	formats strfmt.Registry
}

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

// NewGetPlantGrowthPhasesOK creates a GetPlantGrowthPhasesOK with default headers values
func NewGetPlantGrowthPhasesOK() *GetPlantGrowthPhasesOK {
	return &GetPlantGrowthPhasesOK{}
}

/*GetPlantGrowthPhasesOK handles this case with default header values.

Plant Growth Phases were successfully retrieved
*/
type GetPlantGrowthPhasesOK struct {
	Payload *metrc_gw_models.PlantGrowthPhaseResponse
}

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

func (o *GetPlantGrowthPhasesOK) GetPayload() *metrc_gw_models.PlantGrowthPhaseResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.PlantGrowthPhaseResponse)

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

	return nil
}

// NewGetPlantGrowthPhasesUnauthorized creates a GetPlantGrowthPhasesUnauthorized with default headers values
func NewGetPlantGrowthPhasesUnauthorized() *GetPlantGrowthPhasesUnauthorized {
	return &GetPlantGrowthPhasesUnauthorized{}
}

/*GetPlantGrowthPhasesUnauthorized handles this case with default header values.

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

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

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

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

// NewGetPlantGrowthPhasesForbidden creates a GetPlantGrowthPhasesForbidden with default headers values
func NewGetPlantGrowthPhasesForbidden() *GetPlantGrowthPhasesForbidden {
	return &GetPlantGrowthPhasesForbidden{}
}

/*GetPlantGrowthPhasesForbidden handles this case with default header values.

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

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

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

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

// NewGetPlantGrowthPhasesNotFound creates a GetPlantGrowthPhasesNotFound with default headers values
func NewGetPlantGrowthPhasesNotFound() *GetPlantGrowthPhasesNotFound {
	return &GetPlantGrowthPhasesNotFound{}
}

/*GetPlantGrowthPhasesNotFound handles this case with default header values.

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

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

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

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

// NewGetPlantGrowthPhasesInternalServerError creates a GetPlantGrowthPhasesInternalServerError with default headers values
func NewGetPlantGrowthPhasesInternalServerError() *GetPlantGrowthPhasesInternalServerError {
	return &GetPlantGrowthPhasesInternalServerError{}
}

/*GetPlantGrowthPhasesInternalServerError handles this case with default header values.

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

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

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

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