// Code generated by go-swagger; DO NOT EDIT.

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package stash_pdf

import (
	"encoding/json"
	stderrors "errors"
	"fmt"
	"io"

	"code.tnxs.net/vernonkeenan/lib/api/stash/stash_models"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
)

// ListPdfsReader is a Reader for the ListPdfs structure.
type ListPdfsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *ListPdfsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewListPdfsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewListPdfsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewListPdfsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewListPdfsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewListPdfsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /pdfs] listPdfs", response, response.Code())
	}
}

// NewListPdfsOK creates a ListPdfsOK with default headers values
func NewListPdfsOK() *ListPdfsOK {
	return &ListPdfsOK{}
}

// ListPdfsOK describes a response with status code 200, with default header values.
//
// Sanitized PDF metadata response
type ListPdfsOK struct {
	Payload *stash_models.DocumentResponse
}

// IsSuccess returns true when this list pdfs o k response has a 2xx status code
func (o *ListPdfsOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this list pdfs o k response has a 3xx status code
func (o *ListPdfsOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list pdfs o k response has a 4xx status code
func (o *ListPdfsOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this list pdfs o k response has a 5xx status code
func (o *ListPdfsOK) IsServerError() bool {
	return false
}

// IsCode returns true when this list pdfs o k response a status code equal to that given
func (o *ListPdfsOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the list pdfs o k response
func (o *ListPdfsOK) Code() int {
	return 200
}

func (o *ListPdfsOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsOK %s", 200, payload)
}

func (o *ListPdfsOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsOK %s", 200, payload)
}

func (o *ListPdfsOK) GetPayload() *stash_models.DocumentResponse {
	return o.Payload
}

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

	o.Payload = new(stash_models.DocumentResponse)

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

	return nil
}

// NewListPdfsUnauthorized creates a ListPdfsUnauthorized with default headers values
func NewListPdfsUnauthorized() *ListPdfsUnauthorized {
	return &ListPdfsUnauthorized{}
}

// ListPdfsUnauthorized describes a response with status code 401, with default header values.
//
// Access Unauthorized, invalid API-KEY was used
type ListPdfsUnauthorized struct {
	Payload *stash_models.Error
}

// IsSuccess returns true when this list pdfs unauthorized response has a 2xx status code
func (o *ListPdfsUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this list pdfs unauthorized response has a 3xx status code
func (o *ListPdfsUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list pdfs unauthorized response has a 4xx status code
func (o *ListPdfsUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this list pdfs unauthorized response has a 5xx status code
func (o *ListPdfsUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this list pdfs unauthorized response a status code equal to that given
func (o *ListPdfsUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the list pdfs unauthorized response
func (o *ListPdfsUnauthorized) Code() int {
	return 401
}

func (o *ListPdfsUnauthorized) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsUnauthorized %s", 401, payload)
}

func (o *ListPdfsUnauthorized) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsUnauthorized %s", 401, payload)
}

func (o *ListPdfsUnauthorized) GetPayload() *stash_models.Error {
	return o.Payload
}

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

	o.Payload = new(stash_models.Error)

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

	return nil
}

// NewListPdfsForbidden creates a ListPdfsForbidden with default headers values
func NewListPdfsForbidden() *ListPdfsForbidden {
	return &ListPdfsForbidden{}
}

// ListPdfsForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
type ListPdfsForbidden struct {
	Payload *stash_models.Error
}

// IsSuccess returns true when this list pdfs forbidden response has a 2xx status code
func (o *ListPdfsForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this list pdfs forbidden response has a 3xx status code
func (o *ListPdfsForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list pdfs forbidden response has a 4xx status code
func (o *ListPdfsForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this list pdfs forbidden response has a 5xx status code
func (o *ListPdfsForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this list pdfs forbidden response a status code equal to that given
func (o *ListPdfsForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the list pdfs forbidden response
func (o *ListPdfsForbidden) Code() int {
	return 403
}

func (o *ListPdfsForbidden) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsForbidden %s", 403, payload)
}

func (o *ListPdfsForbidden) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsForbidden %s", 403, payload)
}

func (o *ListPdfsForbidden) GetPayload() *stash_models.Error {
	return o.Payload
}

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

	o.Payload = new(stash_models.Error)

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

	return nil
}

// NewListPdfsUnprocessableEntity creates a ListPdfsUnprocessableEntity with default headers values
func NewListPdfsUnprocessableEntity() *ListPdfsUnprocessableEntity {
	return &ListPdfsUnprocessableEntity{}
}

// ListPdfsUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
type ListPdfsUnprocessableEntity struct {
	Payload *stash_models.Error
}

// IsSuccess returns true when this list pdfs unprocessable entity response has a 2xx status code
func (o *ListPdfsUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this list pdfs unprocessable entity response has a 3xx status code
func (o *ListPdfsUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list pdfs unprocessable entity response has a 4xx status code
func (o *ListPdfsUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this list pdfs unprocessable entity response has a 5xx status code
func (o *ListPdfsUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this list pdfs unprocessable entity response a status code equal to that given
func (o *ListPdfsUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the list pdfs unprocessable entity response
func (o *ListPdfsUnprocessableEntity) Code() int {
	return 422
}

func (o *ListPdfsUnprocessableEntity) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsUnprocessableEntity %s", 422, payload)
}

func (o *ListPdfsUnprocessableEntity) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsUnprocessableEntity %s", 422, payload)
}

func (o *ListPdfsUnprocessableEntity) GetPayload() *stash_models.Error {
	return o.Payload
}

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

	o.Payload = new(stash_models.Error)

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

	return nil
}

// NewListPdfsInternalServerError creates a ListPdfsInternalServerError with default headers values
func NewListPdfsInternalServerError() *ListPdfsInternalServerError {
	return &ListPdfsInternalServerError{}
}

// ListPdfsInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
type ListPdfsInternalServerError struct {
	Payload *stash_models.Error
}

// IsSuccess returns true when this list pdfs internal server error response has a 2xx status code
func (o *ListPdfsInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this list pdfs internal server error response has a 3xx status code
func (o *ListPdfsInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this list pdfs internal server error response has a 4xx status code
func (o *ListPdfsInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this list pdfs internal server error response has a 5xx status code
func (o *ListPdfsInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this list pdfs internal server error response a status code equal to that given
func (o *ListPdfsInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the list pdfs internal server error response
func (o *ListPdfsInternalServerError) Code() int {
	return 500
}

func (o *ListPdfsInternalServerError) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsInternalServerError %s", 500, payload)
}

func (o *ListPdfsInternalServerError) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[GET /pdfs][%d] listPdfsInternalServerError %s", 500, payload)
}

func (o *ListPdfsInternalServerError) GetPayload() *stash_models.Error {
	return o.Payload
}

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

	o.Payload = new(stash_models.Error)

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

	return nil
}
