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

// PostTaxTypeAccountsReader is a Reader for the PostTaxTypeAccounts structure.
type PostTaxTypeAccountsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostTaxTypeAccountsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostTaxTypeAccountsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostTaxTypeAccountsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostTaxTypeAccountsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostTaxTypeAccountsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostTaxTypeAccountsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostTaxTypeAccountsInternalServerError()
		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())
	}
}

// NewPostTaxTypeAccountsOK creates a PostTaxTypeAccountsOK with default headers values
func NewPostTaxTypeAccountsOK() *PostTaxTypeAccountsOK {
	return &PostTaxTypeAccountsOK{}
}

/*PostTaxTypeAccountsOK handles this case with default header values.

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

	CacheControl string

	Payload *regs_models.TaxTypeAccountResponse
}

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

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

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

// NewPostTaxTypeAccountsUnauthorized creates a PostTaxTypeAccountsUnauthorized with default headers values
func NewPostTaxTypeAccountsUnauthorized() *PostTaxTypeAccountsUnauthorized {
	return &PostTaxTypeAccountsUnauthorized{}
}

/*PostTaxTypeAccountsUnauthorized handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewPostTaxTypeAccountsForbidden creates a PostTaxTypeAccountsForbidden with default headers values
func NewPostTaxTypeAccountsForbidden() *PostTaxTypeAccountsForbidden {
	return &PostTaxTypeAccountsForbidden{}
}

/*PostTaxTypeAccountsForbidden handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewPostTaxTypeAccountsNotFound creates a PostTaxTypeAccountsNotFound with default headers values
func NewPostTaxTypeAccountsNotFound() *PostTaxTypeAccountsNotFound {
	return &PostTaxTypeAccountsNotFound{}
}

/*PostTaxTypeAccountsNotFound handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewPostTaxTypeAccountsUnprocessableEntity creates a PostTaxTypeAccountsUnprocessableEntity with default headers values
func NewPostTaxTypeAccountsUnprocessableEntity() *PostTaxTypeAccountsUnprocessableEntity {
	return &PostTaxTypeAccountsUnprocessableEntity{}
}

/*PostTaxTypeAccountsUnprocessableEntity handles this case with default header values.

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

	Payload *regs_models.Error
}

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

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

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

// NewPostTaxTypeAccountsInternalServerError creates a PostTaxTypeAccountsInternalServerError with default headers values
func NewPostTaxTypeAccountsInternalServerError() *PostTaxTypeAccountsInternalServerError {
	return &PostTaxTypeAccountsInternalServerError{}
}

/*PostTaxTypeAccountsInternalServerError handles this case with default header values.

Server Internal Error
*/
type PostTaxTypeAccountsInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

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

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