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

// DeleteRatingEngineReader is a Reader for the DeleteRatingEngine structure.
type DeleteRatingEngineReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteRatingEngineReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteRatingEngineOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeleteRatingEngineUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteRatingEngineForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteRatingEngineNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewDeleteRatingEngineUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteRatingEngineInternalServerError()
		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())
	}
}

// NewDeleteRatingEngineOK creates a DeleteRatingEngineOK with default headers values
func NewDeleteRatingEngineOK() *DeleteRatingEngineOK {
	return &DeleteRatingEngineOK{}
}

/*DeleteRatingEngineOK handles this case with default header values.

Taxnexus Response with Message Objects with Delete Status
*/
type DeleteRatingEngineOK struct {
	AccessControlAllowOrigin string

	Payload *regs_models.DeleteResponse
}

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

func (o *DeleteRatingEngineOK) GetPayload() *regs_models.DeleteResponse {
	return o.Payload
}

func (o *DeleteRatingEngineOK) 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.DeleteResponse)

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

	return nil
}

// NewDeleteRatingEngineUnauthorized creates a DeleteRatingEngineUnauthorized with default headers values
func NewDeleteRatingEngineUnauthorized() *DeleteRatingEngineUnauthorized {
	return &DeleteRatingEngineUnauthorized{}
}

/*DeleteRatingEngineUnauthorized handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewDeleteRatingEngineForbidden creates a DeleteRatingEngineForbidden with default headers values
func NewDeleteRatingEngineForbidden() *DeleteRatingEngineForbidden {
	return &DeleteRatingEngineForbidden{}
}

/*DeleteRatingEngineForbidden handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewDeleteRatingEngineNotFound creates a DeleteRatingEngineNotFound with default headers values
func NewDeleteRatingEngineNotFound() *DeleteRatingEngineNotFound {
	return &DeleteRatingEngineNotFound{}
}

/*DeleteRatingEngineNotFound handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewDeleteRatingEngineUnprocessableEntity creates a DeleteRatingEngineUnprocessableEntity with default headers values
func NewDeleteRatingEngineUnprocessableEntity() *DeleteRatingEngineUnprocessableEntity {
	return &DeleteRatingEngineUnprocessableEntity{}
}

/*DeleteRatingEngineUnprocessableEntity handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewDeleteRatingEngineInternalServerError creates a DeleteRatingEngineInternalServerError with default headers values
func NewDeleteRatingEngineInternalServerError() *DeleteRatingEngineInternalServerError {
	return &DeleteRatingEngineInternalServerError{}
}

/*DeleteRatingEngineInternalServerError handles this case with default header values.

Server Internal Error
*/
type DeleteRatingEngineInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

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

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