lib/api/sfgate/sfgate_client/observations/post_observations_responses.go

523 lines
16 KiB
Go
Raw Permalink 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/sfgate/sfgate_models"
)
// PostObservationsReader is a Reader for the PostObservations structure.
type PostObservationsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostObservationsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewPostObservationsCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostObservationsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostObservationsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostObservationsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostObservationsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostObservationsInternalServerError()
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())
}
}
// NewPostObservationsCreated creates a PostObservationsCreated with default headers values
func NewPostObservationsCreated() *PostObservationsCreated {
return &PostObservationsCreated{}
}
/*
PostObservationsCreated describes a response with status code 201, with default header values.
Response from Salesforce
*/
type PostObservationsCreated struct {
Payload *sfgate_models.SalesforcePostResponse
}
// IsSuccess returns true when this post observations created response has a 2xx status code
func (o *PostObservationsCreated) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post observations created response has a 3xx status code
func (o *PostObservationsCreated) IsRedirect() bool {
return false
}
// IsClientError returns true when this post observations created response has a 4xx status code
func (o *PostObservationsCreated) IsClientError() bool {
return false
}
// IsServerError returns true when this post observations created response has a 5xx status code
func (o *PostObservationsCreated) IsServerError() bool {
return false
}
// IsCode returns true when this post observations created response a status code equal to that given
func (o *PostObservationsCreated) IsCode(code int) bool {
return code == 201
}
// Code gets the status code for the post observations created response
func (o *PostObservationsCreated) Code() int {
return 201
}
func (o *PostObservationsCreated) Error() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsCreated %+v", 201, o.Payload)
}
func (o *PostObservationsCreated) String() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsCreated %+v", 201, o.Payload)
}
func (o *PostObservationsCreated) GetPayload() *sfgate_models.SalesforcePostResponse {
return o.Payload
}
func (o *PostObservationsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.SalesforcePostResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostObservationsUnauthorized creates a PostObservationsUnauthorized with default headers values
func NewPostObservationsUnauthorized() *PostObservationsUnauthorized {
return &PostObservationsUnauthorized{}
}
/*
PostObservationsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostObservationsUnauthorized struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post observations unauthorized response has a 2xx status code
func (o *PostObservationsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post observations unauthorized response has a 3xx status code
func (o *PostObservationsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post observations unauthorized response has a 4xx status code
func (o *PostObservationsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post observations unauthorized response has a 5xx status code
func (o *PostObservationsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post observations unauthorized response a status code equal to that given
func (o *PostObservationsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post observations unauthorized response
func (o *PostObservationsUnauthorized) Code() int {
return 401
}
func (o *PostObservationsUnauthorized) Error() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsUnauthorized %+v", 401, o.Payload)
}
func (o *PostObservationsUnauthorized) String() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsUnauthorized %+v", 401, o.Payload)
}
func (o *PostObservationsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostObservationsUnauthorized) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostObservationsForbidden creates a PostObservationsForbidden with default headers values
func NewPostObservationsForbidden() *PostObservationsForbidden {
return &PostObservationsForbidden{}
}
/*
PostObservationsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostObservationsForbidden struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post observations forbidden response has a 2xx status code
func (o *PostObservationsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post observations forbidden response has a 3xx status code
func (o *PostObservationsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post observations forbidden response has a 4xx status code
func (o *PostObservationsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post observations forbidden response has a 5xx status code
func (o *PostObservationsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post observations forbidden response a status code equal to that given
func (o *PostObservationsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post observations forbidden response
func (o *PostObservationsForbidden) Code() int {
return 403
}
func (o *PostObservationsForbidden) Error() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsForbidden %+v", 403, o.Payload)
}
func (o *PostObservationsForbidden) String() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsForbidden %+v", 403, o.Payload)
}
func (o *PostObservationsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostObservationsForbidden) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostObservationsNotFound creates a PostObservationsNotFound with default headers values
func NewPostObservationsNotFound() *PostObservationsNotFound {
return &PostObservationsNotFound{}
}
/*
PostObservationsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostObservationsNotFound struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post observations not found response has a 2xx status code
func (o *PostObservationsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post observations not found response has a 3xx status code
func (o *PostObservationsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post observations not found response has a 4xx status code
func (o *PostObservationsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post observations not found response has a 5xx status code
func (o *PostObservationsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post observations not found response a status code equal to that given
func (o *PostObservationsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post observations not found response
func (o *PostObservationsNotFound) Code() int {
return 404
}
func (o *PostObservationsNotFound) Error() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsNotFound %+v", 404, o.Payload)
}
func (o *PostObservationsNotFound) String() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsNotFound %+v", 404, o.Payload)
}
func (o *PostObservationsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostObservationsNotFound) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostObservationsUnprocessableEntity creates a PostObservationsUnprocessableEntity with default headers values
func NewPostObservationsUnprocessableEntity() *PostObservationsUnprocessableEntity {
return &PostObservationsUnprocessableEntity{}
}
/*
PostObservationsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostObservationsUnprocessableEntity struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post observations unprocessable entity response has a 2xx status code
func (o *PostObservationsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post observations unprocessable entity response has a 3xx status code
func (o *PostObservationsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post observations unprocessable entity response has a 4xx status code
func (o *PostObservationsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post observations unprocessable entity response has a 5xx status code
func (o *PostObservationsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post observations unprocessable entity response a status code equal to that given
func (o *PostObservationsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post observations unprocessable entity response
func (o *PostObservationsUnprocessableEntity) Code() int {
return 422
}
func (o *PostObservationsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostObservationsUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostObservationsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostObservationsUnprocessableEntity) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostObservationsInternalServerError creates a PostObservationsInternalServerError with default headers values
func NewPostObservationsInternalServerError() *PostObservationsInternalServerError {
return &PostObservationsInternalServerError{}
}
/*
PostObservationsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostObservationsInternalServerError struct {
AccessControlAllowOrigin string
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post observations internal server error response has a 2xx status code
func (o *PostObservationsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post observations internal server error response has a 3xx status code
func (o *PostObservationsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post observations internal server error response has a 4xx status code
func (o *PostObservationsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post observations internal server error response has a 5xx status code
func (o *PostObservationsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post observations internal server error response a status code equal to that given
func (o *PostObservationsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post observations internal server error response
func (o *PostObservationsInternalServerError) Code() int {
return 500
}
func (o *PostObservationsInternalServerError) Error() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsInternalServerError %+v", 500, o.Payload)
}
func (o *PostObservationsInternalServerError) String() string {
return fmt.Sprintf("[POST /observations][%d] postObservationsInternalServerError %+v", 500, o.Payload)
}
func (o *PostObservationsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostObservationsInternalServerError) 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(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}