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

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

// PutRatingEnginesReader is a Reader for the PutRatingEngines structure.
type PutRatingEnginesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutRatingEnginesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutRatingEnginesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutRatingEnginesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutRatingEnginesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutRatingEnginesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutRatingEnginesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutRatingEnginesInternalServerError()
		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())
	}
}

// NewPutRatingEnginesOK creates a PutRatingEnginesOK with default headers values
func NewPutRatingEnginesOK() *PutRatingEnginesOK {
	return &PutRatingEnginesOK{}
}

/*PutRatingEnginesOK handles this case with default header values.

Taxnexus Response with License objects
*/
type PutRatingEnginesOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *regs_models.LicenseTypeResponse
}

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

func (o *PutRatingEnginesOK) GetPayload() *regs_models.LicenseTypeResponse {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	// response header Cache-Control
	o.CacheControl = response.GetHeader("Cache-Control")

	o.Payload = new(regs_models.LicenseTypeResponse)

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

	return nil
}

// NewPutRatingEnginesUnauthorized creates a PutRatingEnginesUnauthorized with default headers values
func NewPutRatingEnginesUnauthorized() *PutRatingEnginesUnauthorized {
	return &PutRatingEnginesUnauthorized{}
}

/*PutRatingEnginesUnauthorized handles this case with default header values.

Access Unauthorized, invalid API-KEY was used
*/
type PutRatingEnginesUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

func (o *PutRatingEnginesUnauthorized) GetPayload() *regs_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(regs_models.Error)

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

	return nil
}

// NewPutRatingEnginesForbidden creates a PutRatingEnginesForbidden with default headers values
func NewPutRatingEnginesForbidden() *PutRatingEnginesForbidden {
	return &PutRatingEnginesForbidden{}
}

/*PutRatingEnginesForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type PutRatingEnginesForbidden struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

func (o *PutRatingEnginesForbidden) GetPayload() *regs_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(regs_models.Error)

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

	return nil
}

// NewPutRatingEnginesNotFound creates a PutRatingEnginesNotFound with default headers values
func NewPutRatingEnginesNotFound() *PutRatingEnginesNotFound {
	return &PutRatingEnginesNotFound{}
}

/*PutRatingEnginesNotFound handles this case with default header values.

Resource was not found
*/
type PutRatingEnginesNotFound struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

func (o *PutRatingEnginesNotFound) GetPayload() *regs_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(regs_models.Error)

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

	return nil
}

// NewPutRatingEnginesUnprocessableEntity creates a PutRatingEnginesUnprocessableEntity with default headers values
func NewPutRatingEnginesUnprocessableEntity() *PutRatingEnginesUnprocessableEntity {
	return &PutRatingEnginesUnprocessableEntity{}
}

/*PutRatingEnginesUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type PutRatingEnginesUnprocessableEntity struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

func (o *PutRatingEnginesUnprocessableEntity) Error() string {
	return fmt.Sprintf("[PUT /ratingengines][%d] putRatingEnginesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *PutRatingEnginesUnprocessableEntity) GetPayload() *regs_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(regs_models.Error)

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

	return nil
}

// NewPutRatingEnginesInternalServerError creates a PutRatingEnginesInternalServerError with default headers values
func NewPutRatingEnginesInternalServerError() *PutRatingEnginesInternalServerError {
	return &PutRatingEnginesInternalServerError{}
}

/*PutRatingEnginesInternalServerError handles this case with default header values.

Server Internal Error
*/
type PutRatingEnginesInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

func (o *PutRatingEnginesInternalServerError) GetPayload() *regs_models.Error {
	return o.Payload
}

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

	// response header Access-Control-Allow-Origin
	o.AccessControlAllowOrigin = response.GetHeader("Access-Control-Allow-Origin")

	o.Payload = new(regs_models.Error)

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

	return nil
}
