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

// PutPaymentMethodsReader is a Reader for the PutPaymentMethods structure.
type PutPaymentMethodsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutPaymentMethodsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutPaymentMethodsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutPaymentMethodsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutPaymentMethodsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutPaymentMethodsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutPaymentMethodsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutPaymentMethodsInternalServerError()
		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())
	}
}

// NewPutPaymentMethodsOK creates a PutPaymentMethodsOK with default headers values
func NewPutPaymentMethodsOK() *PutPaymentMethodsOK {
	return &PutPaymentMethodsOK{}
}

/*PutPaymentMethodsOK handles this case with default header values.

Taxnexus Response with an array of Message objects in response to a PUT
*/
type PutPaymentMethodsOK struct {
	AccessControlAllowOrigin string

	Payload *ops_models.PutResponse
}

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

func (o *PutPaymentMethodsOK) GetPayload() *ops_models.PutResponse {
	return o.Payload
}

func (o *PutPaymentMethodsOK) 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.PutResponse)

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

	return nil
}

// NewPutPaymentMethodsUnauthorized creates a PutPaymentMethodsUnauthorized with default headers values
func NewPutPaymentMethodsUnauthorized() *PutPaymentMethodsUnauthorized {
	return &PutPaymentMethodsUnauthorized{}
}

/*PutPaymentMethodsUnauthorized handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewPutPaymentMethodsForbidden creates a PutPaymentMethodsForbidden with default headers values
func NewPutPaymentMethodsForbidden() *PutPaymentMethodsForbidden {
	return &PutPaymentMethodsForbidden{}
}

/*PutPaymentMethodsForbidden handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewPutPaymentMethodsNotFound creates a PutPaymentMethodsNotFound with default headers values
func NewPutPaymentMethodsNotFound() *PutPaymentMethodsNotFound {
	return &PutPaymentMethodsNotFound{}
}

/*PutPaymentMethodsNotFound handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewPutPaymentMethodsUnprocessableEntity creates a PutPaymentMethodsUnprocessableEntity with default headers values
func NewPutPaymentMethodsUnprocessableEntity() *PutPaymentMethodsUnprocessableEntity {
	return &PutPaymentMethodsUnprocessableEntity{}
}

/*PutPaymentMethodsUnprocessableEntity handles this case with default header values.

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

	Payload *ops_models.Error
}

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

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

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

// NewPutPaymentMethodsInternalServerError creates a PutPaymentMethodsInternalServerError with default headers values
func NewPutPaymentMethodsInternalServerError() *PutPaymentMethodsInternalServerError {
	return &PutPaymentMethodsInternalServerError{}
}

/*PutPaymentMethodsInternalServerError handles this case with default header values.

Server Internal Error
*/
type PutPaymentMethodsInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *ops_models.Error
}

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

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

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