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

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

// GetFilingTypesReader is a Reader for the GetFilingTypes structure.
type GetFilingTypesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetFilingTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetFilingTypesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetFilingTypesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetFilingTypesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetFilingTypesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetFilingTypesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetFilingTypesInternalServerError()
		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())
	}
}

// NewGetFilingTypesOK creates a GetFilingTypesOK with default headers values
func NewGetFilingTypesOK() *GetFilingTypesOK {
	return &GetFilingTypesOK{}
}

/*GetFilingTypesOK handles this case with default header values.

Taxnexus Response with an array of FilingType objects
*/
type GetFilingTypesOK struct {
	Payload *sf_gate_models.FilingTypeResponse
}

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

func (o *GetFilingTypesOK) GetPayload() *sf_gate_models.FilingTypeResponse {
	return o.Payload
}

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

	o.Payload = new(sf_gate_models.FilingTypeResponse)

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

	return nil
}

// NewGetFilingTypesUnauthorized creates a GetFilingTypesUnauthorized with default headers values
func NewGetFilingTypesUnauthorized() *GetFilingTypesUnauthorized {
	return &GetFilingTypesUnauthorized{}
}

/*GetFilingTypesUnauthorized handles this case with default header values.

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

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

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

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

// NewGetFilingTypesForbidden creates a GetFilingTypesForbidden with default headers values
func NewGetFilingTypesForbidden() *GetFilingTypesForbidden {
	return &GetFilingTypesForbidden{}
}

/*GetFilingTypesForbidden handles this case with default header values.

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

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

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

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

// NewGetFilingTypesNotFound creates a GetFilingTypesNotFound with default headers values
func NewGetFilingTypesNotFound() *GetFilingTypesNotFound {
	return &GetFilingTypesNotFound{}
}

/*GetFilingTypesNotFound handles this case with default header values.

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

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

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

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

// NewGetFilingTypesUnprocessableEntity creates a GetFilingTypesUnprocessableEntity with default headers values
func NewGetFilingTypesUnprocessableEntity() *GetFilingTypesUnprocessableEntity {
	return &GetFilingTypesUnprocessableEntity{}
}

/*GetFilingTypesUnprocessableEntity handles this case with default header values.

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

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

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

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

// NewGetFilingTypesInternalServerError creates a GetFilingTypesInternalServerError with default headers values
func NewGetFilingTypesInternalServerError() *GetFilingTypesInternalServerError {
	return &GetFilingTypesInternalServerError{}
}

/*GetFilingTypesInternalServerError handles this case with default header values.

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

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

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

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