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

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

// GetTaxTypesReader is a Reader for the GetTaxTypes structure.
type GetTaxTypesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetTaxTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetTaxTypesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetTaxTypesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetTaxTypesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetTaxTypesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetTaxTypesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetTaxTypesInternalServerError()
		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())
	}
}

// NewGetTaxTypesOK creates a GetTaxTypesOK with default headers values
func NewGetTaxTypesOK() *GetTaxTypesOK {
	return &GetTaxTypesOK{}
}

/*GetTaxTypesOK handles this case with default header values.

Taxnexus Response with an array of Tax Type objects
*/
type GetTaxTypesOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *geo_models.TaxTypeResponse
}

func (o *GetTaxTypesOK) Error() string {
	return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesOK  %+v", 200, o.Payload)
}

func (o *GetTaxTypesOK) GetPayload() *geo_models.TaxTypeResponse {
	return o.Payload
}

func (o *GetTaxTypesOK) 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(geo_models.TaxTypeResponse)

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

	return nil
}

// NewGetTaxTypesUnauthorized creates a GetTaxTypesUnauthorized with default headers values
func NewGetTaxTypesUnauthorized() *GetTaxTypesUnauthorized {
	return &GetTaxTypesUnauthorized{}
}

/*GetTaxTypesUnauthorized handles this case with default header values.

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

	Payload *geo_models.Error
}

func (o *GetTaxTypesUnauthorized) Error() string {
	return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesUnauthorized  %+v", 401, o.Payload)
}

func (o *GetTaxTypesUnauthorized) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *GetTaxTypesUnauthorized) 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(geo_models.Error)

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

	return nil
}

// NewGetTaxTypesForbidden creates a GetTaxTypesForbidden with default headers values
func NewGetTaxTypesForbidden() *GetTaxTypesForbidden {
	return &GetTaxTypesForbidden{}
}

/*GetTaxTypesForbidden handles this case with default header values.

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

	Payload *geo_models.Error
}

func (o *GetTaxTypesForbidden) Error() string {
	return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesForbidden  %+v", 403, o.Payload)
}

func (o *GetTaxTypesForbidden) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *GetTaxTypesForbidden) 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(geo_models.Error)

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

	return nil
}

// NewGetTaxTypesNotFound creates a GetTaxTypesNotFound with default headers values
func NewGetTaxTypesNotFound() *GetTaxTypesNotFound {
	return &GetTaxTypesNotFound{}
}

/*GetTaxTypesNotFound handles this case with default header values.

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

	Payload *geo_models.Error
}

func (o *GetTaxTypesNotFound) Error() string {
	return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesNotFound  %+v", 404, o.Payload)
}

func (o *GetTaxTypesNotFound) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *GetTaxTypesNotFound) 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(geo_models.Error)

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

	return nil
}

// NewGetTaxTypesUnprocessableEntity creates a GetTaxTypesUnprocessableEntity with default headers values
func NewGetTaxTypesUnprocessableEntity() *GetTaxTypesUnprocessableEntity {
	return &GetTaxTypesUnprocessableEntity{}
}

/*GetTaxTypesUnprocessableEntity handles this case with default header values.

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

	Payload *geo_models.Error
}

func (o *GetTaxTypesUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetTaxTypesUnprocessableEntity) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *GetTaxTypesUnprocessableEntity) 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(geo_models.Error)

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

	return nil
}

// NewGetTaxTypesInternalServerError creates a GetTaxTypesInternalServerError with default headers values
func NewGetTaxTypesInternalServerError() *GetTaxTypesInternalServerError {
	return &GetTaxTypesInternalServerError{}
}

/*GetTaxTypesInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetTaxTypesInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *geo_models.Error
}

func (o *GetTaxTypesInternalServerError) Error() string {
	return fmt.Sprintf("[GET /taxtypes][%d] getTaxTypesInternalServerError  %+v", 500, o.Payload)
}

func (o *GetTaxTypesInternalServerError) GetPayload() *geo_models.Error {
	return o.Payload
}

func (o *GetTaxTypesInternalServerError) 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(geo_models.Error)

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

	return nil
}
