mirror of https://github.com/vernonkeenan/lib
523 lines
16 KiB
Go
523 lines
16 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 assets
|
|
|
|
// 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"
|
|
)
|
|
|
|
// PostAssetsReader is a Reader for the PostAssets structure.
|
|
type PostAssetsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *PostAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 201:
|
|
result := NewPostAssetsCreated()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewPostAssetsUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewPostAssetsForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewPostAssetsNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewPostAssetsUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewPostAssetsInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewPostAssetsCreated creates a PostAssetsCreated with default headers values
|
|
func NewPostAssetsCreated() *PostAssetsCreated {
|
|
return &PostAssetsCreated{}
|
|
}
|
|
|
|
/*
|
|
PostAssetsCreated describes a response with status code 201, with default header values.
|
|
|
|
Response from Salesforce
|
|
*/
|
|
type PostAssetsCreated struct {
|
|
Payload *sfgate_models.SalesforcePostResponse
|
|
}
|
|
|
|
// IsSuccess returns true when this post assets created response has a 2xx status code
|
|
func (o *PostAssetsCreated) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this post assets created response has a 3xx status code
|
|
func (o *PostAssetsCreated) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post assets created response has a 4xx status code
|
|
func (o *PostAssetsCreated) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this post assets created response has a 5xx status code
|
|
func (o *PostAssetsCreated) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this post assets created response a status code equal to that given
|
|
func (o *PostAssetsCreated) IsCode(code int) bool {
|
|
return code == 201
|
|
}
|
|
|
|
// Code gets the status code for the post assets created response
|
|
func (o *PostAssetsCreated) Code() int {
|
|
return 201
|
|
}
|
|
|
|
func (o *PostAssetsCreated) Error() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsCreated %+v", 201, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsCreated) String() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsCreated %+v", 201, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsCreated) GetPayload() *sfgate_models.SalesforcePostResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostAssetsCreated) 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
|
|
}
|
|
|
|
// NewPostAssetsUnauthorized creates a PostAssetsUnauthorized with default headers values
|
|
func NewPostAssetsUnauthorized() *PostAssetsUnauthorized {
|
|
return &PostAssetsUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
PostAssetsUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access unauthorized, invalid API-KEY was used
|
|
*/
|
|
type PostAssetsUnauthorized struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this post assets unauthorized response has a 2xx status code
|
|
func (o *PostAssetsUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this post assets unauthorized response has a 3xx status code
|
|
func (o *PostAssetsUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post assets unauthorized response has a 4xx status code
|
|
func (o *PostAssetsUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this post assets unauthorized response has a 5xx status code
|
|
func (o *PostAssetsUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this post assets unauthorized response a status code equal to that given
|
|
func (o *PostAssetsUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the post assets unauthorized response
|
|
func (o *PostAssetsUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *PostAssetsUnauthorized) Error() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsUnauthorized) String() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsUnauthorized) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostAssetsUnauthorized) 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
|
|
}
|
|
|
|
// NewPostAssetsForbidden creates a PostAssetsForbidden with default headers values
|
|
func NewPostAssetsForbidden() *PostAssetsForbidden {
|
|
return &PostAssetsForbidden{}
|
|
}
|
|
|
|
/*
|
|
PostAssetsForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type PostAssetsForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this post assets forbidden response has a 2xx status code
|
|
func (o *PostAssetsForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this post assets forbidden response has a 3xx status code
|
|
func (o *PostAssetsForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post assets forbidden response has a 4xx status code
|
|
func (o *PostAssetsForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this post assets forbidden response has a 5xx status code
|
|
func (o *PostAssetsForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this post assets forbidden response a status code equal to that given
|
|
func (o *PostAssetsForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the post assets forbidden response
|
|
func (o *PostAssetsForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *PostAssetsForbidden) Error() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsForbidden) String() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsForbidden) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostAssetsForbidden) 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
|
|
}
|
|
|
|
// NewPostAssetsNotFound creates a PostAssetsNotFound with default headers values
|
|
func NewPostAssetsNotFound() *PostAssetsNotFound {
|
|
return &PostAssetsNotFound{}
|
|
}
|
|
|
|
/*
|
|
PostAssetsNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type PostAssetsNotFound struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this post assets not found response has a 2xx status code
|
|
func (o *PostAssetsNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this post assets not found response has a 3xx status code
|
|
func (o *PostAssetsNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post assets not found response has a 4xx status code
|
|
func (o *PostAssetsNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this post assets not found response has a 5xx status code
|
|
func (o *PostAssetsNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this post assets not found response a status code equal to that given
|
|
func (o *PostAssetsNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the post assets not found response
|
|
func (o *PostAssetsNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *PostAssetsNotFound) Error() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsNotFound) String() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsNotFound) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostAssetsNotFound) 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
|
|
}
|
|
|
|
// NewPostAssetsUnprocessableEntity creates a PostAssetsUnprocessableEntity with default headers values
|
|
func NewPostAssetsUnprocessableEntity() *PostAssetsUnprocessableEntity {
|
|
return &PostAssetsUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
PostAssetsUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type PostAssetsUnprocessableEntity struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this post assets unprocessable entity response has a 2xx status code
|
|
func (o *PostAssetsUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this post assets unprocessable entity response has a 3xx status code
|
|
func (o *PostAssetsUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post assets unprocessable entity response has a 4xx status code
|
|
func (o *PostAssetsUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this post assets unprocessable entity response has a 5xx status code
|
|
func (o *PostAssetsUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this post assets unprocessable entity response a status code equal to that given
|
|
func (o *PostAssetsUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the post assets unprocessable entity response
|
|
func (o *PostAssetsUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *PostAssetsUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsUnprocessableEntity) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostAssetsUnprocessableEntity) 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
|
|
}
|
|
|
|
// NewPostAssetsInternalServerError creates a PostAssetsInternalServerError with default headers values
|
|
func NewPostAssetsInternalServerError() *PostAssetsInternalServerError {
|
|
return &PostAssetsInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
PostAssetsInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type PostAssetsInternalServerError struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this post assets internal server error response has a 2xx status code
|
|
func (o *PostAssetsInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this post assets internal server error response has a 3xx status code
|
|
func (o *PostAssetsInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this post assets internal server error response has a 4xx status code
|
|
func (o *PostAssetsInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this post assets internal server error response has a 5xx status code
|
|
func (o *PostAssetsInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this post assets internal server error response a status code equal to that given
|
|
func (o *PostAssetsInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the post assets internal server error response
|
|
func (o *PostAssetsInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *PostAssetsInternalServerError) Error() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsInternalServerError) String() string {
|
|
return fmt.Sprintf("[POST /assets][%d] postAssetsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PostAssetsInternalServerError) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostAssetsInternalServerError) 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
|
|
}
|