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

// GetPdfsReader is a Reader for the GetPdfs structure.
type GetPdfsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetPdfsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
	switch response.Code() {
	case 200:
		result := NewGetPdfsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetPdfsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetPdfsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetPdfsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetPdfsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetPdfsInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		return nil, runtime.NewAPIError("[GET /pdfs/{pdfId}] getPdfs", response, response.Code())
	}
}

// NewGetPdfsOK creates a GetPdfsOK with default headers values
func NewGetPdfsOK() *GetPdfsOK {
	return &GetPdfsOK{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewGetPdfsUnauthorized creates a GetPdfsUnauthorized with default headers values
func NewGetPdfsUnauthorized() *GetPdfsUnauthorized {
	return &GetPdfsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewGetPdfsForbidden creates a GetPdfsForbidden with default headers values
func NewGetPdfsForbidden() *GetPdfsForbidden {
	return &GetPdfsForbidden{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewGetPdfsNotFound creates a GetPdfsNotFound with default headers values
func NewGetPdfsNotFound() *GetPdfsNotFound {
	return &GetPdfsNotFound{}
}

// GetPdfsNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
type GetPdfsNotFound struct {
	Payload *stash_models.Error
}

// IsSuccess returns true when this get pdfs not found response has a 2xx status code
func (o *GetPdfsNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get pdfs not found response has a 3xx status code
func (o *GetPdfsNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get pdfs not found response has a 4xx status code
func (o *GetPdfsNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get pdfs not found response has a 5xx status code
func (o *GetPdfsNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this get pdfs not found response a status code equal to that given
func (o *GetPdfsNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the get pdfs not found response
func (o *GetPdfsNotFound) Code() int {
	return 404
}

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

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

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

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

// NewGetPdfsUnprocessableEntity creates a GetPdfsUnprocessableEntity with default headers values
func NewGetPdfsUnprocessableEntity() *GetPdfsUnprocessableEntity {
	return &GetPdfsUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

// NewGetPdfsInternalServerError creates a GetPdfsInternalServerError with default headers values
func NewGetPdfsInternalServerError() *GetPdfsInternalServerError {
	return &GetPdfsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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