// 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_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/regs/regs_models"
)

// PutFilingTypesReader is a Reader for the PutFilingTypes structure.
type PutFilingTypesReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutFilingTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutFilingTypesOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutFilingTypesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutFilingTypesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutFilingTypesNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutFilingTypesInternalServerError()
		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())
	}
}

// NewPutFilingTypesOK creates a PutFilingTypesOK with default headers values
func NewPutFilingTypesOK() *PutFilingTypesOK {
	return &PutFilingTypesOK{}
}

/*PutFilingTypesOK handles this case with default header values.

Taxnexus Response with an array of FilingType objects
*/
type PutFilingTypesOK struct {
	AccessControlAllowOrigin string

	CacheControl string

	Payload *regs_models.FilingTypeResponse
}

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

func (o *PutFilingTypesOK) GetPayload() *regs_models.FilingTypeResponse {
	return o.Payload
}

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

	o.Payload = new(regs_models.FilingTypeResponse)

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

	return nil
}

// NewPutFilingTypesUnauthorized creates a PutFilingTypesUnauthorized with default headers values
func NewPutFilingTypesUnauthorized() *PutFilingTypesUnauthorized {
	return &PutFilingTypesUnauthorized{}
}

/*PutFilingTypesUnauthorized handles this case with default header values.

Access Unauthorized, invalid API-KEY was used
*/
type PutFilingTypesUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

func (o *PutFilingTypesUnauthorized) GetPayload() *regs_models.Error {
	return o.Payload
}

func (o *PutFilingTypesUnauthorized) 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(regs_models.Error)

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

	return nil
}

// NewPutFilingTypesForbidden creates a PutFilingTypesForbidden with default headers values
func NewPutFilingTypesForbidden() *PutFilingTypesForbidden {
	return &PutFilingTypesForbidden{}
}

/*PutFilingTypesForbidden handles this case with default header values.

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

	Payload *regs_models.Error
}

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

func (o *PutFilingTypesForbidden) GetPayload() *regs_models.Error {
	return o.Payload
}

func (o *PutFilingTypesForbidden) 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(regs_models.Error)

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

	return nil
}

// NewPutFilingTypesNotFound creates a PutFilingTypesNotFound with default headers values
func NewPutFilingTypesNotFound() *PutFilingTypesNotFound {
	return &PutFilingTypesNotFound{}
}

/*PutFilingTypesNotFound handles this case with default header values.

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

	Payload *regs_models.Error
}

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

func (o *PutFilingTypesNotFound) GetPayload() *regs_models.Error {
	return o.Payload
}

func (o *PutFilingTypesNotFound) 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(regs_models.Error)

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

	return nil
}

// NewPutFilingTypesInternalServerError creates a PutFilingTypesInternalServerError with default headers values
func NewPutFilingTypesInternalServerError() *PutFilingTypesInternalServerError {
	return &PutFilingTypesInternalServerError{}
}

/*PutFilingTypesInternalServerError handles this case with default header values.

Server Internal Error
*/
type PutFilingTypesInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *regs_models.Error
}

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

func (o *PutFilingTypesInternalServerError) GetPayload() *regs_models.Error {
	return o.Payload
}

func (o *PutFilingTypesInternalServerError) 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(regs_models.Error)

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

	return nil
}
