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

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

// GetRenderReportsReader is a Reader for the GetRenderReports structure.
type GetRenderReportsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetRenderReportsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetRenderReportsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetRenderReportsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetRenderReportsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetRenderReportsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetRenderReportsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetRenderReportsInternalServerError()
		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())
	}
}

// NewGetRenderReportsOK creates a GetRenderReportsOK with default headers values
func NewGetRenderReportsOK() *GetRenderReportsOK {
	return &GetRenderReportsOK{}
}

/*GetRenderReportsOK handles this case with default header values.

Rendered documents response
*/
type GetRenderReportsOK struct {
	AccessControlAllowOrigin string

	Payload *render_models.DocumentResponse
}

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

func (o *GetRenderReportsOK) GetPayload() *render_models.DocumentResponse {
	return o.Payload
}

func (o *GetRenderReportsOK) 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(render_models.DocumentResponse)

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

	return nil
}

// NewGetRenderReportsUnauthorized creates a GetRenderReportsUnauthorized with default headers values
func NewGetRenderReportsUnauthorized() *GetRenderReportsUnauthorized {
	return &GetRenderReportsUnauthorized{}
}

/*GetRenderReportsUnauthorized handles this case with default header values.

Access unauthorized, invalid API-KEY was used
*/
type GetRenderReportsUnauthorized struct {
	AccessControlAllowOrigin string

	Payload *render_models.Error
}

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

func (o *GetRenderReportsUnauthorized) GetPayload() *render_models.Error {
	return o.Payload
}

func (o *GetRenderReportsUnauthorized) 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(render_models.Error)

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

	return nil
}

// NewGetRenderReportsForbidden creates a GetRenderReportsForbidden with default headers values
func NewGetRenderReportsForbidden() *GetRenderReportsForbidden {
	return &GetRenderReportsForbidden{}
}

/*GetRenderReportsForbidden handles this case with default header values.

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

	Payload *render_models.Error
}

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

func (o *GetRenderReportsForbidden) GetPayload() *render_models.Error {
	return o.Payload
}

func (o *GetRenderReportsForbidden) 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(render_models.Error)

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

	return nil
}

// NewGetRenderReportsNotFound creates a GetRenderReportsNotFound with default headers values
func NewGetRenderReportsNotFound() *GetRenderReportsNotFound {
	return &GetRenderReportsNotFound{}
}

/*GetRenderReportsNotFound handles this case with default header values.

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

	Payload *render_models.Error
}

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

func (o *GetRenderReportsNotFound) GetPayload() *render_models.Error {
	return o.Payload
}

func (o *GetRenderReportsNotFound) 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(render_models.Error)

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

	return nil
}

// NewGetRenderReportsUnprocessableEntity creates a GetRenderReportsUnprocessableEntity with default headers values
func NewGetRenderReportsUnprocessableEntity() *GetRenderReportsUnprocessableEntity {
	return &GetRenderReportsUnprocessableEntity{}
}

/*GetRenderReportsUnprocessableEntity handles this case with default header values.

Unprocessable Entity, likely a bad parameter
*/
type GetRenderReportsUnprocessableEntity struct {
	AccessControlAllowOrigin string

	Payload *render_models.Error
}

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

func (o *GetRenderReportsUnprocessableEntity) GetPayload() *render_models.Error {
	return o.Payload
}

func (o *GetRenderReportsUnprocessableEntity) 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(render_models.Error)

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

	return nil
}

// NewGetRenderReportsInternalServerError creates a GetRenderReportsInternalServerError with default headers values
func NewGetRenderReportsInternalServerError() *GetRenderReportsInternalServerError {
	return &GetRenderReportsInternalServerError{}
}

/*GetRenderReportsInternalServerError handles this case with default header values.

Server Internal Error
*/
type GetRenderReportsInternalServerError struct {
	AccessControlAllowOrigin string

	Payload *render_models.Error
}

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

func (o *GetRenderReportsInternalServerError) GetPayload() *render_models.Error {
	return o.Payload
}

func (o *GetRenderReportsInternalServerError) 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(render_models.Error)

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

	return nil
}
