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

// PostFilingTypesReader is a Reader for the PostFilingTypes structure.
type PostFilingTypesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PostFilingTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPostFilingTypesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPostFilingTypesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPostFilingTypesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPostFilingTypesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPostFilingTypesUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPostFilingTypesInternalServerError()
		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())
	}
}

// NewPostFilingTypesOK creates a PostFilingTypesOK with default headers values
func NewPostFilingTypesOK() *PostFilingTypesOK {
	return &PostFilingTypesOK{}
}

/*PostFilingTypesOK handles this case with default header values.

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

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

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

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

// NewPostFilingTypesUnauthorized creates a PostFilingTypesUnauthorized with default headers values
func NewPostFilingTypesUnauthorized() *PostFilingTypesUnauthorized {
	return &PostFilingTypesUnauthorized{}
}

/*PostFilingTypesUnauthorized handles this case with default header values.

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

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

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

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

// NewPostFilingTypesForbidden creates a PostFilingTypesForbidden with default headers values
func NewPostFilingTypesForbidden() *PostFilingTypesForbidden {
	return &PostFilingTypesForbidden{}
}

/*PostFilingTypesForbidden handles this case with default header values.

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

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

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

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

// NewPostFilingTypesNotFound creates a PostFilingTypesNotFound with default headers values
func NewPostFilingTypesNotFound() *PostFilingTypesNotFound {
	return &PostFilingTypesNotFound{}
}

/*PostFilingTypesNotFound handles this case with default header values.

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

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

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

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

// NewPostFilingTypesUnprocessableEntity creates a PostFilingTypesUnprocessableEntity with default headers values
func NewPostFilingTypesUnprocessableEntity() *PostFilingTypesUnprocessableEntity {
	return &PostFilingTypesUnprocessableEntity{}
}

/*PostFilingTypesUnprocessableEntity handles this case with default header values.

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

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

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

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

// NewPostFilingTypesInternalServerError creates a PostFilingTypesInternalServerError with default headers values
func NewPostFilingTypesInternalServerError() *PostFilingTypesInternalServerError {
	return &PostFilingTypesInternalServerError{}
}

/*PostFilingTypesInternalServerError handles this case with default header values.

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

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

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

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