lib/api/members/members_client/documents/get_documents_responses.go

487 lines
15 KiB
Go
Raw Normal View History

2023-09-23 17:19:44 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package documents
// 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/work/lib/api/members/members_models"
)
// GetDocumentsReader is a Reader for the GetDocuments structure.
type GetDocumentsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetDocumentsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetDocumentsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetDocumentsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetDocumentsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetDocumentsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetDocumentsInternalServerError()
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())
}
}
// NewGetDocumentsOK creates a GetDocumentsOK with default headers values
func NewGetDocumentsOK() *GetDocumentsOK {
return &GetDocumentsOK{}
}
/*
GetDocumentsOK describes a response with status code 200, with default header values.
Document Response Object
*/
type GetDocumentsOK struct {
Payload *members_models.DocumentResponse
}
// IsSuccess returns true when this get documents o k response has a 2xx status code
func (o *GetDocumentsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get documents o k response has a 3xx status code
func (o *GetDocumentsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get documents o k response has a 4xx status code
func (o *GetDocumentsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get documents o k response has a 5xx status code
func (o *GetDocumentsOK) IsServerError() bool {
return false
}
// IsCode returns true when this get documents o k response a status code equal to that given
func (o *GetDocumentsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get documents o k response
func (o *GetDocumentsOK) Code() int {
return 200
}
func (o *GetDocumentsOK) Error() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsOK %+v", 200, o.Payload)
}
func (o *GetDocumentsOK) String() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsOK %+v", 200, o.Payload)
}
func (o *GetDocumentsOK) GetPayload() *members_models.DocumentResponse {
return o.Payload
}
func (o *GetDocumentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.DocumentResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetDocumentsUnauthorized creates a GetDocumentsUnauthorized with default headers values
func NewGetDocumentsUnauthorized() *GetDocumentsUnauthorized {
return &GetDocumentsUnauthorized{}
}
/*
GetDocumentsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type GetDocumentsUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get documents unauthorized response has a 2xx status code
func (o *GetDocumentsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get documents unauthorized response has a 3xx status code
func (o *GetDocumentsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get documents unauthorized response has a 4xx status code
func (o *GetDocumentsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get documents unauthorized response has a 5xx status code
func (o *GetDocumentsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get documents unauthorized response a status code equal to that given
func (o *GetDocumentsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get documents unauthorized response
func (o *GetDocumentsUnauthorized) Code() int {
return 401
}
func (o *GetDocumentsUnauthorized) Error() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsUnauthorized %+v", 401, o.Payload)
}
func (o *GetDocumentsUnauthorized) String() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsUnauthorized %+v", 401, o.Payload)
}
func (o *GetDocumentsUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetDocumentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetDocumentsForbidden creates a GetDocumentsForbidden with default headers values
func NewGetDocumentsForbidden() *GetDocumentsForbidden {
return &GetDocumentsForbidden{}
}
/*
GetDocumentsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetDocumentsForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this get documents forbidden response has a 2xx status code
func (o *GetDocumentsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get documents forbidden response has a 3xx status code
func (o *GetDocumentsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get documents forbidden response has a 4xx status code
func (o *GetDocumentsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get documents forbidden response has a 5xx status code
func (o *GetDocumentsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get documents forbidden response a status code equal to that given
func (o *GetDocumentsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get documents forbidden response
func (o *GetDocumentsForbidden) Code() int {
return 403
}
func (o *GetDocumentsForbidden) Error() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsForbidden %+v", 403, o.Payload)
}
func (o *GetDocumentsForbidden) String() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsForbidden %+v", 403, o.Payload)
}
func (o *GetDocumentsForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetDocumentsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Access-Control-Allow-Origin
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
if hdrAccessControlAllowOrigin != "" {
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
}
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetDocumentsNotFound creates a GetDocumentsNotFound with default headers values
func NewGetDocumentsNotFound() *GetDocumentsNotFound {
return &GetDocumentsNotFound{}
}
/*
GetDocumentsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetDocumentsNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get documents not found response has a 2xx status code
func (o *GetDocumentsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get documents not found response has a 3xx status code
func (o *GetDocumentsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get documents not found response has a 4xx status code
func (o *GetDocumentsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get documents not found response has a 5xx status code
func (o *GetDocumentsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get documents not found response a status code equal to that given
func (o *GetDocumentsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get documents not found response
func (o *GetDocumentsNotFound) Code() int {
return 404
}
func (o *GetDocumentsNotFound) Error() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsNotFound %+v", 404, o.Payload)
}
func (o *GetDocumentsNotFound) String() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsNotFound %+v", 404, o.Payload)
}
func (o *GetDocumentsNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetDocumentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetDocumentsUnprocessableEntity creates a GetDocumentsUnprocessableEntity with default headers values
func NewGetDocumentsUnprocessableEntity() *GetDocumentsUnprocessableEntity {
return &GetDocumentsUnprocessableEntity{}
}
/*
GetDocumentsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetDocumentsUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get documents unprocessable entity response has a 2xx status code
func (o *GetDocumentsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get documents unprocessable entity response has a 3xx status code
func (o *GetDocumentsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get documents unprocessable entity response has a 4xx status code
func (o *GetDocumentsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get documents unprocessable entity response has a 5xx status code
func (o *GetDocumentsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get documents unprocessable entity response a status code equal to that given
func (o *GetDocumentsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get documents unprocessable entity response
func (o *GetDocumentsUnprocessableEntity) Code() int {
return 422
}
func (o *GetDocumentsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetDocumentsUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetDocumentsUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetDocumentsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetDocumentsInternalServerError creates a GetDocumentsInternalServerError with default headers values
func NewGetDocumentsInternalServerError() *GetDocumentsInternalServerError {
return &GetDocumentsInternalServerError{}
}
/*
GetDocumentsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetDocumentsInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this get documents internal server error response has a 2xx status code
func (o *GetDocumentsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get documents internal server error response has a 3xx status code
func (o *GetDocumentsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get documents internal server error response has a 4xx status code
func (o *GetDocumentsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get documents internal server error response has a 5xx status code
func (o *GetDocumentsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get documents internal server error response a status code equal to that given
func (o *GetDocumentsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get documents internal server error response
func (o *GetDocumentsInternalServerError) Code() int {
return 500
}
func (o *GetDocumentsInternalServerError) Error() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsInternalServerError %+v", 500, o.Payload)
}
func (o *GetDocumentsInternalServerError) String() string {
return fmt.Sprintf("[GET /documents][%d] getDocumentsInternalServerError %+v", 500, o.Payload)
}
func (o *GetDocumentsInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *GetDocumentsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}