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

// GetRatingEnginesReader is a Reader for the GetRatingEngines structure.
type GetRatingEnginesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetRatingEnginesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetRatingEnginesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetRatingEnginesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetRatingEnginesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetRatingEnginesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetRatingEnginesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetRatingEnginesInternalServerError()
		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())
	}
}

// NewGetRatingEnginesOK creates a GetRatingEnginesOK with default headers values
func NewGetRatingEnginesOK() *GetRatingEnginesOK {
	return &GetRatingEnginesOK{}
}

/*GetRatingEnginesOK handles this case with default header values.

Taxnexus Response with Rating Engine objects
*/
type GetRatingEnginesOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *regs_models.RatingEngineResponse
}

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

func (o *GetRatingEnginesOK) GetPayload() *regs_models.RatingEngineResponse {
	return o.Payload
}

func (o *GetRatingEnginesOK) 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.RatingEngineResponse)

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

	return nil
}

// NewGetRatingEnginesUnauthorized creates a GetRatingEnginesUnauthorized with default headers values
func NewGetRatingEnginesUnauthorized() *GetRatingEnginesUnauthorized {
	return &GetRatingEnginesUnauthorized{}
}

/*GetRatingEnginesUnauthorized handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewGetRatingEnginesForbidden creates a GetRatingEnginesForbidden with default headers values
func NewGetRatingEnginesForbidden() *GetRatingEnginesForbidden {
	return &GetRatingEnginesForbidden{}
}

/*GetRatingEnginesForbidden handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewGetRatingEnginesNotFound creates a GetRatingEnginesNotFound with default headers values
func NewGetRatingEnginesNotFound() *GetRatingEnginesNotFound {
	return &GetRatingEnginesNotFound{}
}

/*GetRatingEnginesNotFound handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewGetRatingEnginesUnprocessableEntity creates a GetRatingEnginesUnprocessableEntity with default headers values
func NewGetRatingEnginesUnprocessableEntity() *GetRatingEnginesUnprocessableEntity {
	return &GetRatingEnginesUnprocessableEntity{}
}

/*GetRatingEnginesUnprocessableEntity handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewGetRatingEnginesInternalServerError creates a GetRatingEnginesInternalServerError with default headers values
func NewGetRatingEnginesInternalServerError() *GetRatingEnginesInternalServerError {
	return &GetRatingEnginesInternalServerError{}
}

/*GetRatingEnginesInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetRatingEnginesInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

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

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