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

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package financial_statements

import (
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"

	"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// DeleteFinancialStatementReader is a Reader for the DeleteFinancialStatement structure.
type DeleteFinancialStatementReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeleteFinancialStatementReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewDeleteFinancialStatementOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeleteFinancialStatementUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeleteFinancialStatementForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeleteFinancialStatementNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewDeleteFinancialStatementUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeleteFinancialStatementInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[DELETE /financialstatements] deleteFinancialStatement", response, response.Code())
	}
}

// NewDeleteFinancialStatementOK creates a DeleteFinancialStatementOK with default headers values
func NewDeleteFinancialStatementOK() *DeleteFinancialStatementOK {
	return &DeleteFinancialStatementOK{}
}

// DeleteFinancialStatementOK describes a response with status code 200, with default header values.
//
// Response with Message Objects with Delete Status
type DeleteFinancialStatementOK struct {
	AccessControlAllowOrigin string

	Payload *research_models.DeleteResponse
}

// IsSuccess returns true when this delete financial statement o k response has a 2xx status code
func (o *DeleteFinancialStatementOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this delete financial statement o k response has a 3xx status code
func (o *DeleteFinancialStatementOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete financial statement o k response has a 4xx status code
func (o *DeleteFinancialStatementOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete financial statement o k response has a 5xx status code
func (o *DeleteFinancialStatementOK) IsServerError() bool {
	return false
}

// IsCode returns true when this delete financial statement o k response a status code equal to that given
func (o *DeleteFinancialStatementOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the delete financial statement o k response
func (o *DeleteFinancialStatementOK) Code() int {
	return 200
}

func (o *DeleteFinancialStatementOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementOK %s", 200, payload)
}

func (o *DeleteFinancialStatementOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementOK %s", 200, payload)
}

func (o *DeleteFinancialStatementOK) GetPayload() *research_models.DeleteResponse {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.DeleteResponse)

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

	return nil
}

// NewDeleteFinancialStatementUnauthorized creates a DeleteFinancialStatementUnauthorized with default headers values
func NewDeleteFinancialStatementUnauthorized() *DeleteFinancialStatementUnauthorized {
	return &DeleteFinancialStatementUnauthorized{}
}

// DeleteFinancialStatementUnauthorized describes a response with status code 401, with default header values.
//
// Access unauthorized, invalid API-KEY was used
type DeleteFinancialStatementUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete financial statement unauthorized response has a 2xx status code
func (o *DeleteFinancialStatementUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete financial statement unauthorized response has a 3xx status code
func (o *DeleteFinancialStatementUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete financial statement unauthorized response has a 4xx status code
func (o *DeleteFinancialStatementUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete financial statement unauthorized response has a 5xx status code
func (o *DeleteFinancialStatementUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this delete financial statement unauthorized response a status code equal to that given
func (o *DeleteFinancialStatementUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the delete financial statement unauthorized response
func (o *DeleteFinancialStatementUnauthorized) Code() int {
	return 401
}

func (o *DeleteFinancialStatementUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementUnauthorized %s", 401, payload)
}

func (o *DeleteFinancialStatementUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementUnauthorized %s", 401, payload)
}

func (o *DeleteFinancialStatementUnauthorized) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}

// NewDeleteFinancialStatementForbidden creates a DeleteFinancialStatementForbidden with default headers values
func NewDeleteFinancialStatementForbidden() *DeleteFinancialStatementForbidden {
	return &DeleteFinancialStatementForbidden{}
}

// DeleteFinancialStatementForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type DeleteFinancialStatementForbidden struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete financial statement forbidden response has a 2xx status code
func (o *DeleteFinancialStatementForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete financial statement forbidden response has a 3xx status code
func (o *DeleteFinancialStatementForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete financial statement forbidden response has a 4xx status code
func (o *DeleteFinancialStatementForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete financial statement forbidden response has a 5xx status code
func (o *DeleteFinancialStatementForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this delete financial statement forbidden response a status code equal to that given
func (o *DeleteFinancialStatementForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the delete financial statement forbidden response
func (o *DeleteFinancialStatementForbidden) Code() int {
	return 403
}

func (o *DeleteFinancialStatementForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementForbidden %s", 403, payload)
}

func (o *DeleteFinancialStatementForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementForbidden %s", 403, payload)
}

func (o *DeleteFinancialStatementForbidden) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}

// NewDeleteFinancialStatementNotFound creates a DeleteFinancialStatementNotFound with default headers values
func NewDeleteFinancialStatementNotFound() *DeleteFinancialStatementNotFound {
	return &DeleteFinancialStatementNotFound{}
}

// DeleteFinancialStatementNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type DeleteFinancialStatementNotFound struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete financial statement not found response has a 2xx status code
func (o *DeleteFinancialStatementNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete financial statement not found response has a 3xx status code
func (o *DeleteFinancialStatementNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete financial statement not found response has a 4xx status code
func (o *DeleteFinancialStatementNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete financial statement not found response has a 5xx status code
func (o *DeleteFinancialStatementNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this delete financial statement not found response a status code equal to that given
func (o *DeleteFinancialStatementNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the delete financial statement not found response
func (o *DeleteFinancialStatementNotFound) Code() int {
	return 404
}

func (o *DeleteFinancialStatementNotFound) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementNotFound %s", 404, payload)
}

func (o *DeleteFinancialStatementNotFound) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementNotFound %s", 404, payload)
}

func (o *DeleteFinancialStatementNotFound) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}

// NewDeleteFinancialStatementUnprocessableEntity creates a DeleteFinancialStatementUnprocessableEntity with default headers values
func NewDeleteFinancialStatementUnprocessableEntity() *DeleteFinancialStatementUnprocessableEntity {
	return &DeleteFinancialStatementUnprocessableEntity{}
}

// DeleteFinancialStatementUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type DeleteFinancialStatementUnprocessableEntity struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete financial statement unprocessable entity response has a 2xx status code
func (o *DeleteFinancialStatementUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete financial statement unprocessable entity response has a 3xx status code
func (o *DeleteFinancialStatementUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete financial statement unprocessable entity response has a 4xx status code
func (o *DeleteFinancialStatementUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this delete financial statement unprocessable entity response has a 5xx status code
func (o *DeleteFinancialStatementUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this delete financial statement unprocessable entity response a status code equal to that given
func (o *DeleteFinancialStatementUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the delete financial statement unprocessable entity response
func (o *DeleteFinancialStatementUnprocessableEntity) Code() int {
	return 422
}

func (o *DeleteFinancialStatementUnprocessableEntity) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementUnprocessableEntity %s", 422, payload)
}

func (o *DeleteFinancialStatementUnprocessableEntity) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementUnprocessableEntity %s", 422, payload)
}

func (o *DeleteFinancialStatementUnprocessableEntity) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}

// NewDeleteFinancialStatementInternalServerError creates a DeleteFinancialStatementInternalServerError with default headers values
func NewDeleteFinancialStatementInternalServerError() *DeleteFinancialStatementInternalServerError {
	return &DeleteFinancialStatementInternalServerError{}
}

// DeleteFinancialStatementInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type DeleteFinancialStatementInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *research_models.Error
}

// IsSuccess returns true when this delete financial statement internal server error response has a 2xx status code
func (o *DeleteFinancialStatementInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this delete financial statement internal server error response has a 3xx status code
func (o *DeleteFinancialStatementInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this delete financial statement internal server error response has a 4xx status code
func (o *DeleteFinancialStatementInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this delete financial statement internal server error response has a 5xx status code
func (o *DeleteFinancialStatementInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this delete financial statement internal server error response a status code equal to that given
func (o *DeleteFinancialStatementInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the delete financial statement internal server error response
func (o *DeleteFinancialStatementInternalServerError) Code() int {
	return 500
}

func (o *DeleteFinancialStatementInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementInternalServerError %s", 500, payload)
}

func (o *DeleteFinancialStatementInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[DELETE /financialstatements][%d] deleteFinancialStatementInternalServerError %s", 500, payload)
}

func (o *DeleteFinancialStatementInternalServerError) GetPayload() *research_models.Error {
	return o.Payload
}

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

	// hydrates response header Access-Control-Allow-Origin
	hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")

	if hdrAccessControlAllowOrigin != "" {
		o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
	}

	o.Payload = new(research_models.Error)

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

	return nil
}
