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

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

// DeletePaymentMethodReader is a Reader for the DeletePaymentMethod structure.
type DeletePaymentMethodReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *DeletePaymentMethodReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewDeletePaymentMethodOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewDeletePaymentMethodUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewDeletePaymentMethodForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewDeletePaymentMethodNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewDeletePaymentMethodUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewDeletePaymentMethodInternalServerError()
		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())
	}
}

// NewDeletePaymentMethodOK creates a DeletePaymentMethodOK with default headers values
func NewDeletePaymentMethodOK() *DeletePaymentMethodOK {
	return &DeletePaymentMethodOK{}
}

/*DeletePaymentMethodOK handles this case with default header values.

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

	Payload *ops_models.DeleteResponse
}

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

func (o *DeletePaymentMethodOK) GetPayload() *ops_models.DeleteResponse {
	return o.Payload
}

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

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

	return nil
}

// NewDeletePaymentMethodUnauthorized creates a DeletePaymentMethodUnauthorized with default headers values
func NewDeletePaymentMethodUnauthorized() *DeletePaymentMethodUnauthorized {
	return &DeletePaymentMethodUnauthorized{}
}

/*DeletePaymentMethodUnauthorized handles this case with default header values.

Access unauthorized, invalid API-KEY was used
*/
type DeletePaymentMethodUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

func (o *DeletePaymentMethodUnauthorized) GetPayload() *ops_models.Error {
	return o.Payload
}

func (o *DeletePaymentMethodUnauthorized) 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(ops_models.Error)

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

	return nil
}

// NewDeletePaymentMethodForbidden creates a DeletePaymentMethodForbidden with default headers values
func NewDeletePaymentMethodForbidden() *DeletePaymentMethodForbidden {
	return &DeletePaymentMethodForbidden{}
}

/*DeletePaymentMethodForbidden handles this case with default header values.

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

	Payload *ops_models.Error
}

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

func (o *DeletePaymentMethodForbidden) GetPayload() *ops_models.Error {
	return o.Payload
}

func (o *DeletePaymentMethodForbidden) 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(ops_models.Error)

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

	return nil
}

// NewDeletePaymentMethodNotFound creates a DeletePaymentMethodNotFound with default headers values
func NewDeletePaymentMethodNotFound() *DeletePaymentMethodNotFound {
	return &DeletePaymentMethodNotFound{}
}

/*DeletePaymentMethodNotFound handles this case with default header values.

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

	Payload *ops_models.Error
}

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

func (o *DeletePaymentMethodNotFound) GetPayload() *ops_models.Error {
	return o.Payload
}

func (o *DeletePaymentMethodNotFound) 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(ops_models.Error)

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

	return nil
}

// NewDeletePaymentMethodUnprocessableEntity creates a DeletePaymentMethodUnprocessableEntity with default headers values
func NewDeletePaymentMethodUnprocessableEntity() *DeletePaymentMethodUnprocessableEntity {
	return &DeletePaymentMethodUnprocessableEntity{}
}

/*DeletePaymentMethodUnprocessableEntity handles this case with default header values.

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

	Payload *ops_models.Error
}

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

func (o *DeletePaymentMethodUnprocessableEntity) GetPayload() *ops_models.Error {
	return o.Payload
}

func (o *DeletePaymentMethodUnprocessableEntity) 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(ops_models.Error)

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

	return nil
}

// NewDeletePaymentMethodInternalServerError creates a DeletePaymentMethodInternalServerError with default headers values
func NewDeletePaymentMethodInternalServerError() *DeletePaymentMethodInternalServerError {
	return &DeletePaymentMethodInternalServerError{}
}

/*DeletePaymentMethodInternalServerError handles this case with default header values.

Server Internal Error
*/
type DeletePaymentMethodInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

func (o *DeletePaymentMethodInternalServerError) GetPayload() *ops_models.Error {
	return o.Payload
}

func (o *DeletePaymentMethodInternalServerError) 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(ops_models.Error)

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

	return nil
}
