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

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

// GetMedicinalReader is a Reader for the GetMedicinal structure.
type GetMedicinalReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetMedicinalReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetMedicinalOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetMedicinalUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetMedicinalForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetMedicinalNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetMedicinalUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetMedicinalInternalServerError()
		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())
	}
}

// NewGetMedicinalOK creates a GetMedicinalOK with default headers values
func NewGetMedicinalOK() *GetMedicinalOK {
	return &GetMedicinalOK{}
}

/*GetMedicinalOK handles this case with default header values.

Taxnexus Response with TaxSummaryResponse Objects
*/
type GetMedicinalOK struct {
	Payload *plex_models.InvoiceSummaryResponse
}

func (o *GetMedicinalOK) Error() string {
	return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalOK  %+v", 200, o.Payload)
}

func (o *GetMedicinalOK) GetPayload() *plex_models.InvoiceSummaryResponse {
	return o.Payload
}

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

	o.Payload = new(plex_models.InvoiceSummaryResponse)

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

	return nil
}

// NewGetMedicinalUnauthorized creates a GetMedicinalUnauthorized with default headers values
func NewGetMedicinalUnauthorized() *GetMedicinalUnauthorized {
	return &GetMedicinalUnauthorized{}
}

/*GetMedicinalUnauthorized handles this case with default header values.

Access Unauthorized, invalid API-KEY was used
*/
type GetMedicinalUnauthorized struct {
	Payload *plex_models.Error
}

func (o *GetMedicinalUnauthorized) Error() string {
	return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalUnauthorized  %+v", 401, o.Payload)
}

func (o *GetMedicinalUnauthorized) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}

// NewGetMedicinalForbidden creates a GetMedicinalForbidden with default headers values
func NewGetMedicinalForbidden() *GetMedicinalForbidden {
	return &GetMedicinalForbidden{}
}

/*GetMedicinalForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetMedicinalForbidden struct {
	Payload *plex_models.Error
}

func (o *GetMedicinalForbidden) Error() string {
	return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalForbidden  %+v", 403, o.Payload)
}

func (o *GetMedicinalForbidden) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}

// NewGetMedicinalNotFound creates a GetMedicinalNotFound with default headers values
func NewGetMedicinalNotFound() *GetMedicinalNotFound {
	return &GetMedicinalNotFound{}
}

/*GetMedicinalNotFound handles this case with default header values.

Resource was not found
*/
type GetMedicinalNotFound struct {
	Payload *plex_models.Error
}

func (o *GetMedicinalNotFound) Error() string {
	return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalNotFound  %+v", 404, o.Payload)
}

func (o *GetMedicinalNotFound) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}

// NewGetMedicinalUnprocessableEntity creates a GetMedicinalUnprocessableEntity with default headers values
func NewGetMedicinalUnprocessableEntity() *GetMedicinalUnprocessableEntity {
	return &GetMedicinalUnprocessableEntity{}
}

/*GetMedicinalUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type GetMedicinalUnprocessableEntity struct {
	Payload *plex_models.Error
}

func (o *GetMedicinalUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetMedicinalUnprocessableEntity) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}

// NewGetMedicinalInternalServerError creates a GetMedicinalInternalServerError with default headers values
func NewGetMedicinalInternalServerError() *GetMedicinalInternalServerError {
	return &GetMedicinalInternalServerError{}
}

/*GetMedicinalInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetMedicinalInternalServerError struct {
	Payload *plex_models.Error
}

func (o *GetMedicinalInternalServerError) Error() string {
	return fmt.Sprintf("[GET /invoices/medicinal][%d] getMedicinalInternalServerError  %+v", 500, o.Payload)
}

func (o *GetMedicinalInternalServerError) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}
