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

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

// PutTaxTypeAccountsReader is a Reader for the PutTaxTypeAccounts structure.
type PutTaxTypeAccountsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutTaxTypeAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutTaxTypeAccountsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutTaxTypeAccountsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutTaxTypeAccountsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutTaxTypeAccountsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutTaxTypeAccountsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutTaxTypeAccountsInternalServerError()
		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())
	}
}

// NewPutTaxTypeAccountsOK creates a PutTaxTypeAccountsOK with default headers values
func NewPutTaxTypeAccountsOK() *PutTaxTypeAccountsOK {
	return &PutTaxTypeAccountsOK{}
}

/*PutTaxTypeAccountsOK handles this case with default header values.

Taxnexus Response with Tax Type Account objects
*/
type PutTaxTypeAccountsOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *regs_models.TaxTypeAccountResponse
}

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

func (o *PutTaxTypeAccountsOK) GetPayload() *regs_models.TaxTypeAccountResponse {
	return o.Payload
}

func (o *PutTaxTypeAccountsOK) 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.TaxTypeAccountResponse)

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

	return nil
}

// NewPutTaxTypeAccountsUnauthorized creates a PutTaxTypeAccountsUnauthorized with default headers values
func NewPutTaxTypeAccountsUnauthorized() *PutTaxTypeAccountsUnauthorized {
	return &PutTaxTypeAccountsUnauthorized{}
}

/*PutTaxTypeAccountsUnauthorized handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewPutTaxTypeAccountsForbidden creates a PutTaxTypeAccountsForbidden with default headers values
func NewPutTaxTypeAccountsForbidden() *PutTaxTypeAccountsForbidden {
	return &PutTaxTypeAccountsForbidden{}
}

/*PutTaxTypeAccountsForbidden handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewPutTaxTypeAccountsNotFound creates a PutTaxTypeAccountsNotFound with default headers values
func NewPutTaxTypeAccountsNotFound() *PutTaxTypeAccountsNotFound {
	return &PutTaxTypeAccountsNotFound{}
}

/*PutTaxTypeAccountsNotFound handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewPutTaxTypeAccountsUnprocessableEntity creates a PutTaxTypeAccountsUnprocessableEntity with default headers values
func NewPutTaxTypeAccountsUnprocessableEntity() *PutTaxTypeAccountsUnprocessableEntity {
	return &PutTaxTypeAccountsUnprocessableEntity{}
}

/*PutTaxTypeAccountsUnprocessableEntity handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewPutTaxTypeAccountsInternalServerError creates a PutTaxTypeAccountsInternalServerError with default headers values
func NewPutTaxTypeAccountsInternalServerError() *PutTaxTypeAccountsInternalServerError {
	return &PutTaxTypeAccountsInternalServerError{}
}

/*PutTaxTypeAccountsInternalServerError handles this case with default header values.

Server Internal Error
*/
type PutTaxTypeAccountsInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

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

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