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

// GetTaxTypesObservableReader is a Reader for the GetTaxTypesObservable structure.
type GetTaxTypesObservableReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetTaxTypesObservableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetTaxTypesObservableOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetTaxTypesObservableUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetTaxTypesObservableForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetTaxTypesObservableNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetTaxTypesObservableUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetTaxTypesObservableInternalServerError()
		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())
	}
}

// NewGetTaxTypesObservableOK creates a GetTaxTypesObservableOK with default headers values
func NewGetTaxTypesObservableOK() *GetTaxTypesObservableOK {
	return &GetTaxTypesObservableOK{}
}

/*GetTaxTypesObservableOK handles this case with default header values.

Observable array response to a taxtype retrieval
*/
type GetTaxTypesObservableOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload []*geo_models.TaxType
}

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

func (o *GetTaxTypesObservableOK) GetPayload() []*geo_models.TaxType {
	return o.Payload
}

func (o *GetTaxTypesObservableOK) 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")

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

	return nil
}

// NewGetTaxTypesObservableUnauthorized creates a GetTaxTypesObservableUnauthorized with default headers values
func NewGetTaxTypesObservableUnauthorized() *GetTaxTypesObservableUnauthorized {
	return &GetTaxTypesObservableUnauthorized{}
}

/*GetTaxTypesObservableUnauthorized handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetTaxTypesObservableForbidden creates a GetTaxTypesObservableForbidden with default headers values
func NewGetTaxTypesObservableForbidden() *GetTaxTypesObservableForbidden {
	return &GetTaxTypesObservableForbidden{}
}

/*GetTaxTypesObservableForbidden handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetTaxTypesObservableNotFound creates a GetTaxTypesObservableNotFound with default headers values
func NewGetTaxTypesObservableNotFound() *GetTaxTypesObservableNotFound {
	return &GetTaxTypesObservableNotFound{}
}

/*GetTaxTypesObservableNotFound handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetTaxTypesObservableUnprocessableEntity creates a GetTaxTypesObservableUnprocessableEntity with default headers values
func NewGetTaxTypesObservableUnprocessableEntity() *GetTaxTypesObservableUnprocessableEntity {
	return &GetTaxTypesObservableUnprocessableEntity{}
}

/*GetTaxTypesObservableUnprocessableEntity handles this case with default header values.

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

	Payload *geo_models.Error
}

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

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

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

// NewGetTaxTypesObservableInternalServerError creates a GetTaxTypesObservableInternalServerError with default headers values
func NewGetTaxTypesObservableInternalServerError() *GetTaxTypesObservableInternalServerError {
	return &GetTaxTypesObservableInternalServerError{}
}

/*GetTaxTypesObservableInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetTaxTypesObservableInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *geo_models.Error
}

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

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

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