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

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

// GetPurchaseOrderListReader is a Reader for the GetPurchaseOrderList structure.
type GetPurchaseOrderListReader struct {
	formats strfmt.Registry
}

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

// NewGetPurchaseOrderListOK creates a GetPurchaseOrderListOK with default headers values
func NewGetPurchaseOrderListOK() *GetPurchaseOrderListOK {
	return &GetPurchaseOrderListOK{}
}

/*GetPurchaseOrderListOK handles this case with default header values.

Shop was successfully retrieved
*/
type GetPurchaseOrderListOK struct {
	Payload *blaze_models.PurchaseOrderListResponse
}

func (o *GetPurchaseOrderListOK) Error() string {
	return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListOK  %+v", 200, o.Payload)
}

func (o *GetPurchaseOrderListOK) GetPayload() *blaze_models.PurchaseOrderListResponse {
	return o.Payload
}

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

	o.Payload = new(blaze_models.PurchaseOrderListResponse)

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

	return nil
}

// NewGetPurchaseOrderListUnauthorized creates a GetPurchaseOrderListUnauthorized with default headers values
func NewGetPurchaseOrderListUnauthorized() *GetPurchaseOrderListUnauthorized {
	return &GetPurchaseOrderListUnauthorized{}
}

/*GetPurchaseOrderListUnauthorized handles this case with default header values.

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

func (o *GetPurchaseOrderListUnauthorized) Error() string {
	return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListUnauthorized  %+v", 401, o.Payload)
}

func (o *GetPurchaseOrderListUnauthorized) GetPayload() *blaze_models.Error {
	return o.Payload
}

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

	o.Payload = new(blaze_models.Error)

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

	return nil
}

// NewGetPurchaseOrderListForbidden creates a GetPurchaseOrderListForbidden with default headers values
func NewGetPurchaseOrderListForbidden() *GetPurchaseOrderListForbidden {
	return &GetPurchaseOrderListForbidden{}
}

/*GetPurchaseOrderListForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetPurchaseOrderListForbidden struct {
	Payload *blaze_models.Error
}

func (o *GetPurchaseOrderListForbidden) Error() string {
	return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListForbidden  %+v", 403, o.Payload)
}

func (o *GetPurchaseOrderListForbidden) GetPayload() *blaze_models.Error {
	return o.Payload
}

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

	o.Payload = new(blaze_models.Error)

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

	return nil
}

// NewGetPurchaseOrderListNotFound creates a GetPurchaseOrderListNotFound with default headers values
func NewGetPurchaseOrderListNotFound() *GetPurchaseOrderListNotFound {
	return &GetPurchaseOrderListNotFound{}
}

/*GetPurchaseOrderListNotFound handles this case with default header values.

Resource was not found
*/
type GetPurchaseOrderListNotFound struct {
	Payload *blaze_models.Error
}

func (o *GetPurchaseOrderListNotFound) Error() string {
	return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListNotFound  %+v", 404, o.Payload)
}

func (o *GetPurchaseOrderListNotFound) GetPayload() *blaze_models.Error {
	return o.Payload
}

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

	o.Payload = new(blaze_models.Error)

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

	return nil
}

// NewGetPurchaseOrderListInternalServerError creates a GetPurchaseOrderListInternalServerError with default headers values
func NewGetPurchaseOrderListInternalServerError() *GetPurchaseOrderListInternalServerError {
	return &GetPurchaseOrderListInternalServerError{}
}

/*GetPurchaseOrderListInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetPurchaseOrderListInternalServerError struct {
	Payload *blaze_models.Error
}

func (o *GetPurchaseOrderListInternalServerError) Error() string {
	return fmt.Sprintf("[GET /partner/store/purchaseOrder/list][%d] getPurchaseOrderListInternalServerError  %+v", 500, o.Payload)
}

func (o *GetPurchaseOrderListInternalServerError) GetPayload() *blaze_models.Error {
	return o.Payload
}

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

	o.Payload = new(blaze_models.Error)

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

	return nil
}
