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

// 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/sf-gate/sf_gate_models"
)

// GetTaxnexusCodesReader is a Reader for the GetTaxnexusCodes structure.
type GetTaxnexusCodesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetTaxnexusCodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetTaxnexusCodesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetTaxnexusCodesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetTaxnexusCodesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetTaxnexusCodesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetTaxnexusCodesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetTaxnexusCodesInternalServerError()
		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())
	}
}

// NewGetTaxnexusCodesOK creates a GetTaxnexusCodesOK with default headers values
func NewGetTaxnexusCodesOK() *GetTaxnexusCodesOK {
	return &GetTaxnexusCodesOK{}
}

/*GetTaxnexusCodesOK handles this case with default header values.

Taxnexus Response with an array of Taxnexus Code objects
*/
type GetTaxnexusCodesOK struct {
	Payload *sf_gate_models.TaxnexusCodeResponse
}

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

func (o *GetTaxnexusCodesOK) GetPayload() *sf_gate_models.TaxnexusCodeResponse {
	return o.Payload
}

func (o *GetTaxnexusCodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sf_gate_models.TaxnexusCodeResponse)

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

	return nil
}

// NewGetTaxnexusCodesUnauthorized creates a GetTaxnexusCodesUnauthorized with default headers values
func NewGetTaxnexusCodesUnauthorized() *GetTaxnexusCodesUnauthorized {
	return &GetTaxnexusCodesUnauthorized{}
}

/*GetTaxnexusCodesUnauthorized handles this case with default header values.

Access unauthorized, invalid API-KEY was used
*/
type GetTaxnexusCodesUnauthorized struct {
	Payload *sf_gate_models.Error
}

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

func (o *GetTaxnexusCodesUnauthorized) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetTaxnexusCodesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewGetTaxnexusCodesForbidden creates a GetTaxnexusCodesForbidden with default headers values
func NewGetTaxnexusCodesForbidden() *GetTaxnexusCodesForbidden {
	return &GetTaxnexusCodesForbidden{}
}

/*GetTaxnexusCodesForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetTaxnexusCodesForbidden struct {
	Payload *sf_gate_models.Error
}

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

func (o *GetTaxnexusCodesForbidden) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetTaxnexusCodesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewGetTaxnexusCodesNotFound creates a GetTaxnexusCodesNotFound with default headers values
func NewGetTaxnexusCodesNotFound() *GetTaxnexusCodesNotFound {
	return &GetTaxnexusCodesNotFound{}
}

/*GetTaxnexusCodesNotFound handles this case with default header values.

Resource was not found
*/
type GetTaxnexusCodesNotFound struct {
	Payload *sf_gate_models.Error
}

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

func (o *GetTaxnexusCodesNotFound) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetTaxnexusCodesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewGetTaxnexusCodesUnprocessableEntity creates a GetTaxnexusCodesUnprocessableEntity with default headers values
func NewGetTaxnexusCodesUnprocessableEntity() *GetTaxnexusCodesUnprocessableEntity {
	return &GetTaxnexusCodesUnprocessableEntity{}
}

/*GetTaxnexusCodesUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type GetTaxnexusCodesUnprocessableEntity struct {
	Payload *sf_gate_models.Error
}

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

func (o *GetTaxnexusCodesUnprocessableEntity) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetTaxnexusCodesUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}

// NewGetTaxnexusCodesInternalServerError creates a GetTaxnexusCodesInternalServerError with default headers values
func NewGetTaxnexusCodesInternalServerError() *GetTaxnexusCodesInternalServerError {
	return &GetTaxnexusCodesInternalServerError{}
}

/*GetTaxnexusCodesInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetTaxnexusCodesInternalServerError struct {
	Payload *sf_gate_models.Error
}

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

func (o *GetTaxnexusCodesInternalServerError) GetPayload() *sf_gate_models.Error {
	return o.Payload
}

func (o *GetTaxnexusCodesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(sf_gate_models.Error)

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

	return nil
}
