// Code generated by go-swagger; DO NOT EDIT. // All Code Copyright(c) 2018-2021 by Taxnexus, Inc. // All rights reserved worldwide. // Proprietary product; unlicensed use is not allowed package stash_pdf // 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" "code.tnxs.net/taxnexus/lib/api/stash/stash_models" ) // PostPdfsReader is a Reader for the PostPdfs structure. type PostPdfsReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *PostPdfsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewPostPdfsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewPostPdfsUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewPostPdfsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewPostPdfsNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewPostPdfsUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewPostPdfsInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } // NewPostPdfsOK creates a PostPdfsOK with default headers values func NewPostPdfsOK() *PostPdfsOK { return &PostPdfsOK{} } /* PostPdfsOK describes a response with status code 200, with default header values. Rendered documents response */ type PostPdfsOK struct { Payload *stash_models.DocumentResponse } func (o *PostPdfsOK) Error() string { return fmt.Sprintf("[POST /pdfs][%d] postPdfsOK %+v", 200, o.Payload) } func (o *PostPdfsOK) GetPayload() *stash_models.DocumentResponse { return o.Payload } func (o *PostPdfsOK) 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 && err != io.EOF { return err } return nil } // NewPostPdfsUnauthorized creates a PostPdfsUnauthorized with default headers values func NewPostPdfsUnauthorized() *PostPdfsUnauthorized { return &PostPdfsUnauthorized{} } /* PostPdfsUnauthorized describes a response with status code 401, with default header values. Access Unauthorized, invalid API-KEY was used */ type PostPdfsUnauthorized struct { Payload *stash_models.Error } func (o *PostPdfsUnauthorized) Error() string { return fmt.Sprintf("[POST /pdfs][%d] postPdfsUnauthorized %+v", 401, o.Payload) } func (o *PostPdfsUnauthorized) GetPayload() *stash_models.Error { return o.Payload } func (o *PostPdfsUnauthorized) 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 && err != io.EOF { return err } return nil } // NewPostPdfsForbidden creates a PostPdfsForbidden with default headers values func NewPostPdfsForbidden() *PostPdfsForbidden { return &PostPdfsForbidden{} } /* PostPdfsForbidden describes a response with status code 403, with default header values. Access forbidden, account lacks access */ type PostPdfsForbidden struct { Payload *stash_models.Error } func (o *PostPdfsForbidden) Error() string { return fmt.Sprintf("[POST /pdfs][%d] postPdfsForbidden %+v", 403, o.Payload) } func (o *PostPdfsForbidden) GetPayload() *stash_models.Error { return o.Payload } func (o *PostPdfsForbidden) 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 && err != io.EOF { return err } return nil } // NewPostPdfsNotFound creates a PostPdfsNotFound with default headers values func NewPostPdfsNotFound() *PostPdfsNotFound { return &PostPdfsNotFound{} } /* PostPdfsNotFound describes a response with status code 404, with default header values. Resource was not found */ type PostPdfsNotFound struct { Payload *stash_models.Error } func (o *PostPdfsNotFound) Error() string { return fmt.Sprintf("[POST /pdfs][%d] postPdfsNotFound %+v", 404, o.Payload) } func (o *PostPdfsNotFound) GetPayload() *stash_models.Error { return o.Payload } func (o *PostPdfsNotFound) 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 && err != io.EOF { return err } return nil } // NewPostPdfsUnprocessableEntity creates a PostPdfsUnprocessableEntity with default headers values func NewPostPdfsUnprocessableEntity() *PostPdfsUnprocessableEntity { return &PostPdfsUnprocessableEntity{} } /* PostPdfsUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity, likely a bad parameter */ type PostPdfsUnprocessableEntity struct { Payload *stash_models.Error } func (o *PostPdfsUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /pdfs][%d] postPdfsUnprocessableEntity %+v", 422, o.Payload) } func (o *PostPdfsUnprocessableEntity) GetPayload() *stash_models.Error { return o.Payload } func (o *PostPdfsUnprocessableEntity) 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 && err != io.EOF { return err } return nil } // NewPostPdfsInternalServerError creates a PostPdfsInternalServerError with default headers values func NewPostPdfsInternalServerError() *PostPdfsInternalServerError { return &PostPdfsInternalServerError{} } /* PostPdfsInternalServerError describes a response with status code 500, with default header values. Server Internal Error */ type PostPdfsInternalServerError struct { Payload *stash_models.Error } func (o *PostPdfsInternalServerError) Error() string { return fmt.Sprintf("[POST /pdfs][%d] postPdfsInternalServerError %+v", 500, o.Payload) } func (o *PostPdfsInternalServerError) GetPayload() *stash_models.Error { return o.Payload } func (o *PostPdfsInternalServerError) 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 && err != io.EOF { return err } return nil }