lib/api/stash/stash_client/stash_pdf/post_pdfs_responses.go

476 lines
14 KiB
Go
Raw Normal View History

2021-07-31 03:05:02 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-08-05 19:37:53 +00:00
// (c) 2012-2020 by Taxnexus, Inc.
2021-07-31 03:05:02 +00:00
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package stash_pdf
import (
"encoding/json"
stderrors "errors"
2021-07-31 03:05:02 +00:00
"fmt"
"io"
"code.tnxs.net/vernonkeenan/lib/api/stash/stash_models"
2021-07-31 03:05:02 +00:00
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// 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) (any, error) {
2021-07-31 03:05:02 +00:00
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("[POST /pdfs] postPdfs", response, response.Code())
2021-07-31 03:05:02 +00:00
}
}
// 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
2021-07-31 03:05:02 +00:00
type PostPdfsOK struct {
Payload *stash_models.DocumentResponse
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post pdfs o k response has a 2xx status code
func (o *PostPdfsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post pdfs o k response has a 3xx status code
func (o *PostPdfsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post pdfs o k response has a 4xx status code
func (o *PostPdfsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post pdfs o k response has a 5xx status code
func (o *PostPdfsOK) IsServerError() bool {
return false
}
// IsCode returns true when this post pdfs o k response a status code equal to that given
func (o *PostPdfsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post pdfs o k response
func (o *PostPdfsOK) Code() int {
return 200
}
2021-07-31 03:05:02 +00:00
func (o *PostPdfsOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsOK %s", 200, payload)
2021-07-31 03:05:02 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostPdfsOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsOK %s", 200, payload)
2023-03-22 20:49:01 +00:00
}
2021-07-31 03:05:02 +00:00
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 && !stderrors.Is(err, io.EOF) {
2021-07-31 03:05:02 +00:00
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
2021-07-31 03:05:02 +00:00
type PostPdfsUnauthorized struct {
Payload *stash_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post pdfs unauthorized response has a 2xx status code
func (o *PostPdfsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post pdfs unauthorized response has a 3xx status code
func (o *PostPdfsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post pdfs unauthorized response has a 4xx status code
func (o *PostPdfsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post pdfs unauthorized response has a 5xx status code
func (o *PostPdfsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post pdfs unauthorized response a status code equal to that given
func (o *PostPdfsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post pdfs unauthorized response
func (o *PostPdfsUnauthorized) Code() int {
return 401
}
2021-07-31 03:05:02 +00:00
func (o *PostPdfsUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsUnauthorized %s", 401, payload)
2021-07-31 03:05:02 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostPdfsUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsUnauthorized %s", 401, payload)
2023-03-22 20:49:01 +00:00
}
2021-07-31 03:05:02 +00:00
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 && !stderrors.Is(err, io.EOF) {
2021-07-31 03:05:02 +00:00
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
2021-07-31 03:05:02 +00:00
type PostPdfsForbidden struct {
Payload *stash_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post pdfs forbidden response has a 2xx status code
func (o *PostPdfsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post pdfs forbidden response has a 3xx status code
func (o *PostPdfsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post pdfs forbidden response has a 4xx status code
func (o *PostPdfsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post pdfs forbidden response has a 5xx status code
func (o *PostPdfsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post pdfs forbidden response a status code equal to that given
func (o *PostPdfsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post pdfs forbidden response
func (o *PostPdfsForbidden) Code() int {
return 403
}
2021-07-31 03:05:02 +00:00
func (o *PostPdfsForbidden) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsForbidden %s", 403, payload)
2021-07-31 03:05:02 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostPdfsForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsForbidden %s", 403, payload)
2023-03-22 20:49:01 +00:00
}
2021-07-31 03:05:02 +00:00
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 && !stderrors.Is(err, io.EOF) {
2021-07-31 03:05:02 +00:00
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
2021-07-31 03:05:02 +00:00
type PostPdfsNotFound struct {
Payload *stash_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post pdfs not found response has a 2xx status code
func (o *PostPdfsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post pdfs not found response has a 3xx status code
func (o *PostPdfsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post pdfs not found response has a 4xx status code
func (o *PostPdfsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post pdfs not found response has a 5xx status code
func (o *PostPdfsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post pdfs not found response a status code equal to that given
func (o *PostPdfsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post pdfs not found response
func (o *PostPdfsNotFound) Code() int {
return 404
}
2021-07-31 03:05:02 +00:00
func (o *PostPdfsNotFound) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsNotFound %s", 404, payload)
2021-07-31 03:05:02 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostPdfsNotFound) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsNotFound %s", 404, payload)
2023-03-22 20:49:01 +00:00
}
2021-07-31 03:05:02 +00:00
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 && !stderrors.Is(err, io.EOF) {
2021-07-31 03:05:02 +00:00
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
2021-07-31 03:05:02 +00:00
type PostPdfsUnprocessableEntity struct {
Payload *stash_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post pdfs unprocessable entity response has a 2xx status code
func (o *PostPdfsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post pdfs unprocessable entity response has a 3xx status code
func (o *PostPdfsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post pdfs unprocessable entity response has a 4xx status code
func (o *PostPdfsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post pdfs unprocessable entity response has a 5xx status code
func (o *PostPdfsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post pdfs unprocessable entity response a status code equal to that given
func (o *PostPdfsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post pdfs unprocessable entity response
func (o *PostPdfsUnprocessableEntity) Code() int {
return 422
}
2021-07-31 03:05:02 +00:00
func (o *PostPdfsUnprocessableEntity) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsUnprocessableEntity %s", 422, payload)
2021-07-31 03:05:02 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostPdfsUnprocessableEntity) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsUnprocessableEntity %s", 422, payload)
2023-03-22 20:49:01 +00:00
}
2021-07-31 03:05:02 +00:00
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 && !stderrors.Is(err, io.EOF) {
2021-07-31 03:05:02 +00:00
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
2021-07-31 03:05:02 +00:00
type PostPdfsInternalServerError struct {
Payload *stash_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post pdfs internal server error response has a 2xx status code
func (o *PostPdfsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post pdfs internal server error response has a 3xx status code
func (o *PostPdfsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post pdfs internal server error response has a 4xx status code
func (o *PostPdfsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post pdfs internal server error response has a 5xx status code
func (o *PostPdfsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post pdfs internal server error response a status code equal to that given
func (o *PostPdfsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post pdfs internal server error response
func (o *PostPdfsInternalServerError) Code() int {
return 500
}
2021-07-31 03:05:02 +00:00
func (o *PostPdfsInternalServerError) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsInternalServerError %s", 500, payload)
2021-07-31 03:05:02 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostPdfsInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /pdfs][%d] postPdfsInternalServerError %s", 500, payload)
2023-03-22 20:49:01 +00:00
}
2021-07-31 03:05:02 +00:00
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 && !stderrors.Is(err, io.EOF) {
2021-07-31 03:05:02 +00:00
return err
}
return nil
}