lib/api/sfgate/sfgate_client/documents/put_documents_responses.go

476 lines
15 KiB
Go
Raw Normal View History

2023-05-29 15:13:02 +00:00
// 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 documents
import (
"encoding/json"
stderrors "errors"
2023-05-29 15:13:02 +00:00
"fmt"
"io"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
2023-05-29 15:13:02 +00:00
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// PutDocumentsReader is a Reader for the PutDocuments structure.
type PutDocumentsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
2023-05-29 15:13:02 +00:00
switch response.Code() {
case 200:
result := NewPutDocumentsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutDocumentsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutDocumentsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutDocumentsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutDocumentsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutDocumentsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[PUT /documents] putDocuments", response, response.Code())
2023-05-29 15:13:02 +00:00
}
}
// NewPutDocumentsOK creates a PutDocumentsOK with default headers values
func NewPutDocumentsOK() *PutDocumentsOK {
return &PutDocumentsOK{}
}
// PutDocumentsOK describes a response with status code 200, with default header values.
//
// Response with Document objects
2023-05-29 15:13:02 +00:00
type PutDocumentsOK struct {
Payload *sfgate_models.DocumentResponse
}
// IsSuccess returns true when this put documents o k response has a 2xx status code
func (o *PutDocumentsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this put documents o k response has a 3xx status code
func (o *PutDocumentsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this put documents o k response has a 4xx status code
func (o *PutDocumentsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this put documents o k response has a 5xx status code
func (o *PutDocumentsOK) IsServerError() bool {
return false
}
// IsCode returns true when this put documents o k response a status code equal to that given
func (o *PutDocumentsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the put documents o k response
func (o *PutDocumentsOK) Code() int {
return 200
}
func (o *PutDocumentsOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsOK %s", 200, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsOK %s", 200, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsOK) GetPayload() *sfgate_models.DocumentResponse {
return o.Payload
}
func (o *PutDocumentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.DocumentResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
2023-05-29 15:13:02 +00:00
return err
}
return nil
}
// NewPutDocumentsUnauthorized creates a PutDocumentsUnauthorized with default headers values
func NewPutDocumentsUnauthorized() *PutDocumentsUnauthorized {
return &PutDocumentsUnauthorized{}
}
// PutDocumentsUnauthorized describes a response with status code 401, with default header values.
//
// Access unauthorized, invalid API-KEY was used
2023-05-29 15:13:02 +00:00
type PutDocumentsUnauthorized struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this put documents unauthorized response has a 2xx status code
func (o *PutDocumentsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put documents unauthorized response has a 3xx status code
func (o *PutDocumentsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this put documents unauthorized response has a 4xx status code
func (o *PutDocumentsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this put documents unauthorized response has a 5xx status code
func (o *PutDocumentsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this put documents unauthorized response a status code equal to that given
func (o *PutDocumentsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the put documents unauthorized response
func (o *PutDocumentsUnauthorized) Code() int {
return 401
}
func (o *PutDocumentsUnauthorized) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnauthorized %s", 401, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnauthorized %s", 401, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PutDocumentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
2023-05-29 15:13:02 +00:00
return err
}
return nil
}
// NewPutDocumentsForbidden creates a PutDocumentsForbidden with default headers values
func NewPutDocumentsForbidden() *PutDocumentsForbidden {
return &PutDocumentsForbidden{}
}
// PutDocumentsForbidden describes a response with status code 403, with default header values.
//
// Access forbidden, account lacks access
2023-05-29 15:13:02 +00:00
type PutDocumentsForbidden struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this put documents forbidden response has a 2xx status code
func (o *PutDocumentsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put documents forbidden response has a 3xx status code
func (o *PutDocumentsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this put documents forbidden response has a 4xx status code
func (o *PutDocumentsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this put documents forbidden response has a 5xx status code
func (o *PutDocumentsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this put documents forbidden response a status code equal to that given
func (o *PutDocumentsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the put documents forbidden response
func (o *PutDocumentsForbidden) Code() int {
return 403
}
func (o *PutDocumentsForbidden) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsForbidden %s", 403, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsForbidden %s", 403, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PutDocumentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
2023-05-29 15:13:02 +00:00
return err
}
return nil
}
// NewPutDocumentsNotFound creates a PutDocumentsNotFound with default headers values
func NewPutDocumentsNotFound() *PutDocumentsNotFound {
return &PutDocumentsNotFound{}
}
// PutDocumentsNotFound describes a response with status code 404, with default header values.
//
// Resource was not found
2023-05-29 15:13:02 +00:00
type PutDocumentsNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this put documents not found response has a 2xx status code
func (o *PutDocumentsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put documents not found response has a 3xx status code
func (o *PutDocumentsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this put documents not found response has a 4xx status code
func (o *PutDocumentsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this put documents not found response has a 5xx status code
func (o *PutDocumentsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this put documents not found response a status code equal to that given
func (o *PutDocumentsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the put documents not found response
func (o *PutDocumentsNotFound) Code() int {
return 404
}
func (o *PutDocumentsNotFound) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsNotFound %s", 404, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsNotFound) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsNotFound %s", 404, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PutDocumentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
2023-05-29 15:13:02 +00:00
return err
}
return nil
}
// NewPutDocumentsUnprocessableEntity creates a PutDocumentsUnprocessableEntity with default headers values
func NewPutDocumentsUnprocessableEntity() *PutDocumentsUnprocessableEntity {
return &PutDocumentsUnprocessableEntity{}
}
// PutDocumentsUnprocessableEntity describes a response with status code 422, with default header values.
//
// Unprocessable Entity, likely a bad parameter
2023-05-29 15:13:02 +00:00
type PutDocumentsUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this put documents unprocessable entity response has a 2xx status code
func (o *PutDocumentsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put documents unprocessable entity response has a 3xx status code
func (o *PutDocumentsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this put documents unprocessable entity response has a 4xx status code
func (o *PutDocumentsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this put documents unprocessable entity response has a 5xx status code
func (o *PutDocumentsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this put documents unprocessable entity response a status code equal to that given
func (o *PutDocumentsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the put documents unprocessable entity response
func (o *PutDocumentsUnprocessableEntity) Code() int {
return 422
}
func (o *PutDocumentsUnprocessableEntity) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnprocessableEntity %s", 422, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsUnprocessableEntity) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsUnprocessableEntity %s", 422, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PutDocumentsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
2023-05-29 15:13:02 +00:00
return err
}
return nil
}
// NewPutDocumentsInternalServerError creates a PutDocumentsInternalServerError with default headers values
func NewPutDocumentsInternalServerError() *PutDocumentsInternalServerError {
return &PutDocumentsInternalServerError{}
}
// PutDocumentsInternalServerError describes a response with status code 500, with default header values.
//
// Server Internal Error
2023-05-29 15:13:02 +00:00
type PutDocumentsInternalServerError struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this put documents internal server error response has a 2xx status code
func (o *PutDocumentsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put documents internal server error response has a 3xx status code
func (o *PutDocumentsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this put documents internal server error response has a 4xx status code
func (o *PutDocumentsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this put documents internal server error response has a 5xx status code
func (o *PutDocumentsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this put documents internal server error response a status code equal to that given
func (o *PutDocumentsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the put documents internal server error response
func (o *PutDocumentsInternalServerError) Code() int {
return 500
}
func (o *PutDocumentsInternalServerError) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsInternalServerError %s", 500, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[PUT /documents][%d] putDocumentsInternalServerError %s", 500, payload)
2023-05-29 15:13:02 +00:00
}
func (o *PutDocumentsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PutDocumentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
2023-05-29 15:13:02 +00:00
return err
}
return nil
}