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

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

// GetPackageAdjustmentReasonsReader is a Reader for the GetPackageAdjustmentReasons structure.
type GetPackageAdjustmentReasonsReader struct {
	formats strfmt.Registry
}

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

// NewGetPackageAdjustmentReasonsOK creates a GetPackageAdjustmentReasonsOK with default headers values
func NewGetPackageAdjustmentReasonsOK() *GetPackageAdjustmentReasonsOK {
	return &GetPackageAdjustmentReasonsOK{}
}

/*GetPackageAdjustmentReasonsOK handles this case with default header values.

A list of Package Types was succefully retrieved
*/
type GetPackageAdjustmentReasonsOK struct {
	Payload *metrc_gw_models.PackageAdjustmentReasonResponse
}

func (o *GetPackageAdjustmentReasonsOK) Error() string {
	return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsOK  %+v", 200, o.Payload)
}

func (o *GetPackageAdjustmentReasonsOK) GetPayload() *metrc_gw_models.PackageAdjustmentReasonResponse {
	return o.Payload
}

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

	o.Payload = new(metrc_gw_models.PackageAdjustmentReasonResponse)

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

	return nil
}

// NewGetPackageAdjustmentReasonsUnauthorized creates a GetPackageAdjustmentReasonsUnauthorized with default headers values
func NewGetPackageAdjustmentReasonsUnauthorized() *GetPackageAdjustmentReasonsUnauthorized {
	return &GetPackageAdjustmentReasonsUnauthorized{}
}

/*GetPackageAdjustmentReasonsUnauthorized handles this case with default header values.

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

func (o *GetPackageAdjustmentReasonsUnauthorized) Error() string {
	return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetPackageAdjustmentReasonsForbidden creates a GetPackageAdjustmentReasonsForbidden with default headers values
func NewGetPackageAdjustmentReasonsForbidden() *GetPackageAdjustmentReasonsForbidden {
	return &GetPackageAdjustmentReasonsForbidden{}
}

/*GetPackageAdjustmentReasonsForbidden handles this case with default header values.

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

func (o *GetPackageAdjustmentReasonsForbidden) Error() string {
	return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetPackageAdjustmentReasonsNotFound creates a GetPackageAdjustmentReasonsNotFound with default headers values
func NewGetPackageAdjustmentReasonsNotFound() *GetPackageAdjustmentReasonsNotFound {
	return &GetPackageAdjustmentReasonsNotFound{}
}

/*GetPackageAdjustmentReasonsNotFound handles this case with default header values.

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

func (o *GetPackageAdjustmentReasonsNotFound) Error() string {
	return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetPackageAdjustmentReasonsInternalServerError creates a GetPackageAdjustmentReasonsInternalServerError with default headers values
func NewGetPackageAdjustmentReasonsInternalServerError() *GetPackageAdjustmentReasonsInternalServerError {
	return &GetPackageAdjustmentReasonsInternalServerError{}
}

/*GetPackageAdjustmentReasonsInternalServerError handles this case with default header values.

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

func (o *GetPackageAdjustmentReasonsInternalServerError) Error() string {
	return fmt.Sprintf("[GET /packages/adjustmentreasons][%d] getPackageAdjustmentReasonsInternalServerError  %+v", 500, o.Payload)
}

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

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