lib/api/research/research_client/observations/put_observation_responses.go

523 lines
16 KiB
Go
Raw Normal View History

// 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 observations
// 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/research/research_models"
)
// PutObservationReader is a Reader for the PutObservation structure.
type PutObservationReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutObservationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutObservationOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutObservationUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutObservationForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutObservationNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutObservationUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutObservationInternalServerError()
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())
}
}
// NewPutObservationOK creates a PutObservationOK with default headers values
func NewPutObservationOK() *PutObservationOK {
return &PutObservationOK{}
}
/*
PutObservationOK describes a response with status code 200, with default header values.
Response with Observation objects
*/
type PutObservationOK struct {
Payload *research_models.ObservationResponse
}
// IsSuccess returns true when this put observation o k response has a 2xx status code
func (o *PutObservationOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this put observation o k response has a 3xx status code
func (o *PutObservationOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this put observation o k response has a 4xx status code
func (o *PutObservationOK) IsClientError() bool {
return false
}
// IsServerError returns true when this put observation o k response has a 5xx status code
func (o *PutObservationOK) IsServerError() bool {
return false
}
// IsCode returns true when this put observation o k response a status code equal to that given
func (o *PutObservationOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the put observation o k response
func (o *PutObservationOK) Code() int {
return 200
}
func (o *PutObservationOK) Error() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationOK %+v", 200, o.Payload)
}
func (o *PutObservationOK) String() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationOK %+v", 200, o.Payload)
}
func (o *PutObservationOK) GetPayload() *research_models.ObservationResponse {
return o.Payload
}
func (o *PutObservationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(research_models.ObservationResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutObservationUnauthorized creates a PutObservationUnauthorized with default headers values
func NewPutObservationUnauthorized() *PutObservationUnauthorized {
return &PutObservationUnauthorized{}
}
/*
PutObservationUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PutObservationUnauthorized struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this put observation unauthorized response has a 2xx status code
func (o *PutObservationUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put observation unauthorized response has a 3xx status code
func (o *PutObservationUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this put observation unauthorized response has a 4xx status code
func (o *PutObservationUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this put observation unauthorized response has a 5xx status code
func (o *PutObservationUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this put observation unauthorized response a status code equal to that given
func (o *PutObservationUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the put observation unauthorized response
func (o *PutObservationUnauthorized) Code() int {
return 401
}
func (o *PutObservationUnauthorized) Error() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationUnauthorized %+v", 401, o.Payload)
}
func (o *PutObservationUnauthorized) String() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationUnauthorized %+v", 401, o.Payload)
}
func (o *PutObservationUnauthorized) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutObservationUnauthorized) 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(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutObservationForbidden creates a PutObservationForbidden with default headers values
func NewPutObservationForbidden() *PutObservationForbidden {
return &PutObservationForbidden{}
}
/*
PutObservationForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutObservationForbidden struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this put observation forbidden response has a 2xx status code
func (o *PutObservationForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put observation forbidden response has a 3xx status code
func (o *PutObservationForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this put observation forbidden response has a 4xx status code
func (o *PutObservationForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this put observation forbidden response has a 5xx status code
func (o *PutObservationForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this put observation forbidden response a status code equal to that given
func (o *PutObservationForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the put observation forbidden response
func (o *PutObservationForbidden) Code() int {
return 403
}
func (o *PutObservationForbidden) Error() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationForbidden %+v", 403, o.Payload)
}
func (o *PutObservationForbidden) String() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationForbidden %+v", 403, o.Payload)
}
func (o *PutObservationForbidden) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutObservationForbidden) 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(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutObservationNotFound creates a PutObservationNotFound with default headers values
func NewPutObservationNotFound() *PutObservationNotFound {
return &PutObservationNotFound{}
}
/*
PutObservationNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutObservationNotFound struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this put observation not found response has a 2xx status code
func (o *PutObservationNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put observation not found response has a 3xx status code
func (o *PutObservationNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this put observation not found response has a 4xx status code
func (o *PutObservationNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this put observation not found response has a 5xx status code
func (o *PutObservationNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this put observation not found response a status code equal to that given
func (o *PutObservationNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the put observation not found response
func (o *PutObservationNotFound) Code() int {
return 404
}
func (o *PutObservationNotFound) Error() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationNotFound %+v", 404, o.Payload)
}
func (o *PutObservationNotFound) String() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationNotFound %+v", 404, o.Payload)
}
func (o *PutObservationNotFound) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutObservationNotFound) 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(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutObservationUnprocessableEntity creates a PutObservationUnprocessableEntity with default headers values
func NewPutObservationUnprocessableEntity() *PutObservationUnprocessableEntity {
return &PutObservationUnprocessableEntity{}
}
/*
PutObservationUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutObservationUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this put observation unprocessable entity response has a 2xx status code
func (o *PutObservationUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put observation unprocessable entity response has a 3xx status code
func (o *PutObservationUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this put observation unprocessable entity response has a 4xx status code
func (o *PutObservationUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this put observation unprocessable entity response has a 5xx status code
func (o *PutObservationUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this put observation unprocessable entity response a status code equal to that given
func (o *PutObservationUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the put observation unprocessable entity response
func (o *PutObservationUnprocessableEntity) Code() int {
return 422
}
func (o *PutObservationUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutObservationUnprocessableEntity) String() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutObservationUnprocessableEntity) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutObservationUnprocessableEntity) 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(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutObservationInternalServerError creates a PutObservationInternalServerError with default headers values
func NewPutObservationInternalServerError() *PutObservationInternalServerError {
return &PutObservationInternalServerError{}
}
/*
PutObservationInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutObservationInternalServerError struct {
AccessControlAllowOrigin string
Payload *research_models.Error
}
// IsSuccess returns true when this put observation internal server error response has a 2xx status code
func (o *PutObservationInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put observation internal server error response has a 3xx status code
func (o *PutObservationInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this put observation internal server error response has a 4xx status code
func (o *PutObservationInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this put observation internal server error response has a 5xx status code
func (o *PutObservationInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this put observation internal server error response a status code equal to that given
func (o *PutObservationInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the put observation internal server error response
func (o *PutObservationInternalServerError) Code() int {
return 500
}
func (o *PutObservationInternalServerError) Error() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationInternalServerError %+v", 500, o.Payload)
}
func (o *PutObservationInternalServerError) String() string {
return fmt.Sprintf("[PUT /observations][%d] putObservationInternalServerError %+v", 500, o.Payload)
}
func (o *PutObservationInternalServerError) GetPayload() *research_models.Error {
return o.Payload
}
func (o *PutObservationInternalServerError) 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(research_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}