// Code generated by go-swagger; DO NOT EDIT.

// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package 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"

	"code.tnxs.net/taxnexus/lib/api/sf-gate/sf_gate_models"
)

// PutOrdersReader is a Reader for the PutOrders structure.
type PutOrdersReader struct {
	formats strfmt.Registry
}

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

// NewPutOrdersOK creates a PutOrdersOK with default headers values
func NewPutOrdersOK() *PutOrdersOK {
	return &PutOrdersOK{}
}

/*PutOrdersOK handles this case with default header values.

An array of Order objects
*/
type PutOrdersOK struct {
	Payload *sf_gate_models.OrderResponse
}

func (o *PutOrdersOK) Error() string {
	return fmt.Sprintf("[PUT /orders][%d] putOrdersOK  %+v", 200, o.Payload)
}

func (o *PutOrdersOK) GetPayload() *sf_gate_models.OrderResponse {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.OrderResponse)

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

	return nil
}

// NewPutOrdersUnauthorized creates a PutOrdersUnauthorized with default headers values
func NewPutOrdersUnauthorized() *PutOrdersUnauthorized {
	return &PutOrdersUnauthorized{}
}

/*PutOrdersUnauthorized handles this case with default header values.

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

func (o *PutOrdersUnauthorized) Error() string {
	return fmt.Sprintf("[PUT /orders][%d] putOrdersUnauthorized  %+v", 401, o.Payload)
}

func (o *PutOrdersUnauthorized) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewPutOrdersForbidden creates a PutOrdersForbidden with default headers values
func NewPutOrdersForbidden() *PutOrdersForbidden {
	return &PutOrdersForbidden{}
}

/*PutOrdersForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type PutOrdersForbidden struct {
	Payload *sf_gate_models.Error
}

func (o *PutOrdersForbidden) Error() string {
	return fmt.Sprintf("[PUT /orders][%d] putOrdersForbidden  %+v", 403, o.Payload)
}

func (o *PutOrdersForbidden) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewPutOrdersNotFound creates a PutOrdersNotFound with default headers values
func NewPutOrdersNotFound() *PutOrdersNotFound {
	return &PutOrdersNotFound{}
}

/*PutOrdersNotFound handles this case with default header values.

Resource was not found
*/
type PutOrdersNotFound struct {
	Payload *sf_gate_models.Error
}

func (o *PutOrdersNotFound) Error() string {
	return fmt.Sprintf("[PUT /orders][%d] putOrdersNotFound  %+v", 404, o.Payload)
}

func (o *PutOrdersNotFound) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewPutOrdersInternalServerError creates a PutOrdersInternalServerError with default headers values
func NewPutOrdersInternalServerError() *PutOrdersInternalServerError {
	return &PutOrdersInternalServerError{}
}

/*PutOrdersInternalServerError handles this case with default header values.

Server Internal Error
*/
type PutOrdersInternalServerError struct {
	Payload *sf_gate_models.Error
}

func (o *PutOrdersInternalServerError) Error() string {
	return fmt.Sprintf("[PUT /orders][%d] putOrdersInternalServerError  %+v", 500, o.Payload)
}

func (o *PutOrdersInternalServerError) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}
