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

487 lines
15 KiB
Go

// 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
// 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/vernonkeenan/lib/api/members/members_models"
)
// PostDocumentsReader is a Reader for the PostDocuments structure.
type PostDocumentsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostDocumentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostDocumentsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostDocumentsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostDocumentsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostDocumentsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostDocumentsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostDocumentsInternalServerError()
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())
}
}
// NewPostDocumentsOK creates a PostDocumentsOK with default headers values
func NewPostDocumentsOK() *PostDocumentsOK {
return &PostDocumentsOK{}
}
/*
PostDocumentsOK describes a response with status code 200, with default header values.
Document Response Object
*/
type PostDocumentsOK struct {
Payload *members_models.DocumentResponse
}
// IsSuccess returns true when this post documents o k response has a 2xx status code
func (o *PostDocumentsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post documents o k response has a 3xx status code
func (o *PostDocumentsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post documents o k response has a 4xx status code
func (o *PostDocumentsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post documents o k response has a 5xx status code
func (o *PostDocumentsOK) IsServerError() bool {
return false
}
// IsCode returns true when this post documents o k response a status code equal to that given
func (o *PostDocumentsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post documents o k response
func (o *PostDocumentsOK) Code() int {
return 200
}
func (o *PostDocumentsOK) Error() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsOK %+v", 200, o.Payload)
}
func (o *PostDocumentsOK) String() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsOK %+v", 200, o.Payload)
}
func (o *PostDocumentsOK) GetPayload() *members_models.DocumentResponse {
return o.Payload
}
func (o *PostDocumentsOK) 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
}
// NewPostDocumentsUnauthorized creates a PostDocumentsUnauthorized with default headers values
func NewPostDocumentsUnauthorized() *PostDocumentsUnauthorized {
return &PostDocumentsUnauthorized{}
}
/*
PostDocumentsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostDocumentsUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post documents unauthorized response has a 2xx status code
func (o *PostDocumentsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post documents unauthorized response has a 3xx status code
func (o *PostDocumentsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post documents unauthorized response has a 4xx status code
func (o *PostDocumentsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post documents unauthorized response has a 5xx status code
func (o *PostDocumentsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post documents unauthorized response a status code equal to that given
func (o *PostDocumentsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post documents unauthorized response
func (o *PostDocumentsUnauthorized) Code() int {
return 401
}
func (o *PostDocumentsUnauthorized) Error() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsUnauthorized %+v", 401, o.Payload)
}
func (o *PostDocumentsUnauthorized) String() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsUnauthorized %+v", 401, o.Payload)
}
func (o *PostDocumentsUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostDocumentsUnauthorized) 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
}
// NewPostDocumentsForbidden creates a PostDocumentsForbidden with default headers values
func NewPostDocumentsForbidden() *PostDocumentsForbidden {
return &PostDocumentsForbidden{}
}
/*
PostDocumentsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostDocumentsForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this post documents forbidden response has a 2xx status code
func (o *PostDocumentsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post documents forbidden response has a 3xx status code
func (o *PostDocumentsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post documents forbidden response has a 4xx status code
func (o *PostDocumentsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post documents forbidden response has a 5xx status code
func (o *PostDocumentsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post documents forbidden response a status code equal to that given
func (o *PostDocumentsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post documents forbidden response
func (o *PostDocumentsForbidden) Code() int {
return 403
}
func (o *PostDocumentsForbidden) Error() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsForbidden %+v", 403, o.Payload)
}
func (o *PostDocumentsForbidden) String() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsForbidden %+v", 403, o.Payload)
}
func (o *PostDocumentsForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostDocumentsForbidden) 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
}
// NewPostDocumentsNotFound creates a PostDocumentsNotFound with default headers values
func NewPostDocumentsNotFound() *PostDocumentsNotFound {
return &PostDocumentsNotFound{}
}
/*
PostDocumentsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostDocumentsNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post documents not found response has a 2xx status code
func (o *PostDocumentsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post documents not found response has a 3xx status code
func (o *PostDocumentsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post documents not found response has a 4xx status code
func (o *PostDocumentsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post documents not found response has a 5xx status code
func (o *PostDocumentsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post documents not found response a status code equal to that given
func (o *PostDocumentsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post documents not found response
func (o *PostDocumentsNotFound) Code() int {
return 404
}
func (o *PostDocumentsNotFound) Error() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsNotFound %+v", 404, o.Payload)
}
func (o *PostDocumentsNotFound) String() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsNotFound %+v", 404, o.Payload)
}
func (o *PostDocumentsNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostDocumentsNotFound) 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
}
// NewPostDocumentsUnprocessableEntity creates a PostDocumentsUnprocessableEntity with default headers values
func NewPostDocumentsUnprocessableEntity() *PostDocumentsUnprocessableEntity {
return &PostDocumentsUnprocessableEntity{}
}
/*
PostDocumentsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostDocumentsUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post documents unprocessable entity response has a 2xx status code
func (o *PostDocumentsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post documents unprocessable entity response has a 3xx status code
func (o *PostDocumentsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post documents unprocessable entity response has a 4xx status code
func (o *PostDocumentsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post documents unprocessable entity response has a 5xx status code
func (o *PostDocumentsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post documents unprocessable entity response a status code equal to that given
func (o *PostDocumentsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post documents unprocessable entity response
func (o *PostDocumentsUnprocessableEntity) Code() int {
return 422
}
func (o *PostDocumentsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostDocumentsUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostDocumentsUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostDocumentsUnprocessableEntity) 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
}
// NewPostDocumentsInternalServerError creates a PostDocumentsInternalServerError with default headers values
func NewPostDocumentsInternalServerError() *PostDocumentsInternalServerError {
return &PostDocumentsInternalServerError{}
}
/*
PostDocumentsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostDocumentsInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post documents internal server error response has a 2xx status code
func (o *PostDocumentsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post documents internal server error response has a 3xx status code
func (o *PostDocumentsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post documents internal server error response has a 4xx status code
func (o *PostDocumentsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post documents internal server error response has a 5xx status code
func (o *PostDocumentsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post documents internal server error response a status code equal to that given
func (o *PostDocumentsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post documents internal server error response
func (o *PostDocumentsInternalServerError) Code() int {
return 500
}
func (o *PostDocumentsInternalServerError) Error() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsInternalServerError %+v", 500, o.Payload)
}
func (o *PostDocumentsInternalServerError) String() string {
return fmt.Sprintf("[POST /documents][%d] postDocumentsInternalServerError %+v", 500, o.Payload)
}
func (o *PostDocumentsInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostDocumentsInternalServerError) 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
}