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

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

// GetSalesAndUseTaxReturnReader is a Reader for the GetSalesAndUseTaxReturn structure.
type GetSalesAndUseTaxReturnReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetSalesAndUseTaxReturnReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetSalesAndUseTaxReturnOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetSalesAndUseTaxReturnUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetSalesAndUseTaxReturnForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetSalesAndUseTaxReturnNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetSalesAndUseTaxReturnUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetSalesAndUseTaxReturnInternalServerError()
		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())
	}
}

// NewGetSalesAndUseTaxReturnOK creates a GetSalesAndUseTaxReturnOK with default headers values
func NewGetSalesAndUseTaxReturnOK() *GetSalesAndUseTaxReturnOK {
	return &GetSalesAndUseTaxReturnOK{}
}

/*GetSalesAndUseTaxReturnOK handles this case with default header values.

The California CDTFA Sales and Use Tax Return
*/
type GetSalesAndUseTaxReturnOK struct {
	Payload *plex_models.TaxReturnResponse
}

func (o *GetSalesAndUseTaxReturnOK) Error() string {
	return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnOK  %+v", 200, o.Payload)
}

func (o *GetSalesAndUseTaxReturnOK) GetPayload() *plex_models.TaxReturnResponse {
	return o.Payload
}

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

	o.Payload = new(plex_models.TaxReturnResponse)

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

	return nil
}

// NewGetSalesAndUseTaxReturnUnauthorized creates a GetSalesAndUseTaxReturnUnauthorized with default headers values
func NewGetSalesAndUseTaxReturnUnauthorized() *GetSalesAndUseTaxReturnUnauthorized {
	return &GetSalesAndUseTaxReturnUnauthorized{}
}

/*GetSalesAndUseTaxReturnUnauthorized handles this case with default header values.

Access Unauthorized, invalid API-KEY was used
*/
type GetSalesAndUseTaxReturnUnauthorized struct {
	Payload *plex_models.Error
}

func (o *GetSalesAndUseTaxReturnUnauthorized) Error() string {
	return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnUnauthorized  %+v", 401, o.Payload)
}

func (o *GetSalesAndUseTaxReturnUnauthorized) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}

// NewGetSalesAndUseTaxReturnForbidden creates a GetSalesAndUseTaxReturnForbidden with default headers values
func NewGetSalesAndUseTaxReturnForbidden() *GetSalesAndUseTaxReturnForbidden {
	return &GetSalesAndUseTaxReturnForbidden{}
}

/*GetSalesAndUseTaxReturnForbidden handles this case with default header values.

Access forbidden, account lacks access
*/
type GetSalesAndUseTaxReturnForbidden struct {
	Payload *plex_models.Error
}

func (o *GetSalesAndUseTaxReturnForbidden) Error() string {
	return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnForbidden  %+v", 403, o.Payload)
}

func (o *GetSalesAndUseTaxReturnForbidden) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}

// NewGetSalesAndUseTaxReturnNotFound creates a GetSalesAndUseTaxReturnNotFound with default headers values
func NewGetSalesAndUseTaxReturnNotFound() *GetSalesAndUseTaxReturnNotFound {
	return &GetSalesAndUseTaxReturnNotFound{}
}

/*GetSalesAndUseTaxReturnNotFound handles this case with default header values.

Resource was not found
*/
type GetSalesAndUseTaxReturnNotFound struct {
	Payload *plex_models.Error
}

func (o *GetSalesAndUseTaxReturnNotFound) Error() string {
	return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnNotFound  %+v", 404, o.Payload)
}

func (o *GetSalesAndUseTaxReturnNotFound) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}

// NewGetSalesAndUseTaxReturnUnprocessableEntity creates a GetSalesAndUseTaxReturnUnprocessableEntity with default headers values
func NewGetSalesAndUseTaxReturnUnprocessableEntity() *GetSalesAndUseTaxReturnUnprocessableEntity {
	return &GetSalesAndUseTaxReturnUnprocessableEntity{}
}

/*GetSalesAndUseTaxReturnUnprocessableEntity handles this case with default header values.

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

func (o *GetSalesAndUseTaxReturnUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetSalesAndUseTaxReturnUnprocessableEntity) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}

// NewGetSalesAndUseTaxReturnInternalServerError creates a GetSalesAndUseTaxReturnInternalServerError with default headers values
func NewGetSalesAndUseTaxReturnInternalServerError() *GetSalesAndUseTaxReturnInternalServerError {
	return &GetSalesAndUseTaxReturnInternalServerError{}
}

/*GetSalesAndUseTaxReturnInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetSalesAndUseTaxReturnInternalServerError struct {
	Payload *plex_models.Error
}

func (o *GetSalesAndUseTaxReturnInternalServerError) Error() string {
	return fmt.Sprintf("[GET /taxreturns/salesanduse][%d] getSalesAndUseTaxReturnInternalServerError  %+v", 500, o.Payload)
}

func (o *GetSalesAndUseTaxReturnInternalServerError) GetPayload() *plex_models.Error {
	return o.Payload
}

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

	o.Payload = new(plex_models.Error)

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

	return nil
}
