lib/api/sfgate/sfgate_client/assets/post_assets_responses.go

478 lines
14 KiB
Go
Raw Normal View History

2022-09-05 00:01:32 +00:00
// 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() {
2023-03-28 17:47:34 +00:00
case 201:
result := NewPostAssetsCreated()
2022-09-05 00:01:32 +00:00
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())
}
}
2023-03-28 17:47:34 +00:00
// NewPostAssetsCreated creates a PostAssetsCreated with default headers values
func NewPostAssetsCreated() *PostAssetsCreated {
return &PostAssetsCreated{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
2023-03-28 17:47:34 +00:00
PostAssetsCreated describes a response with status code 201, with default header values.
2022-09-05 00:01:32 +00:00
2023-03-28 17:47:34 +00:00
Response from Salesforce
2022-09-05 00:01:32 +00:00
*/
2023-03-28 17:47:34 +00:00
type PostAssetsCreated struct {
Payload *sfgate_models.SalesforcePostResponse
2022-09-05 00:01:32 +00:00
}
2023-03-28 17:47:34 +00:00
// IsSuccess returns true when this post assets created response has a 2xx status code
func (o *PostAssetsCreated) IsSuccess() bool {
2023-03-22 20:49:01 +00:00
return true
}
2023-03-28 17:47:34 +00:00
// IsRedirect returns true when this post assets created response has a 3xx status code
func (o *PostAssetsCreated) IsRedirect() bool {
2023-03-22 20:49:01 +00:00
return false
}
2023-03-28 17:47:34 +00:00
// IsClientError returns true when this post assets created response has a 4xx status code
func (o *PostAssetsCreated) IsClientError() bool {
2023-03-22 20:49:01 +00:00
return false
}
2023-03-28 17:47:34 +00:00
// IsServerError returns true when this post assets created response has a 5xx status code
func (o *PostAssetsCreated) IsServerError() bool {
2023-03-22 20:49:01 +00:00
return false
}
2023-03-28 17:47:34 +00:00
// 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
2023-03-22 20:49:01 +00:00
}
2023-03-28 17:47:34 +00:00
// Code gets the status code for the post assets created response
func (o *PostAssetsCreated) Code() int {
return 201
2023-03-22 20:49:01 +00:00
}
2023-03-28 17:47:34 +00:00
func (o *PostAssetsCreated) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsCreated %+v", 201, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
2023-03-28 17:47:34 +00:00
func (o *PostAssetsCreated) String() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsCreated %+v", 201, o.Payload)
2023-03-22 20:49:01 +00:00
}
2023-03-28 17:47:34 +00:00
func (o *PostAssetsCreated) GetPayload() *sfgate_models.SalesforcePostResponse {
2022-09-05 00:01:32 +00:00
return o.Payload
}
2023-03-28 17:47:34 +00:00
func (o *PostAssetsCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2022-09-05 00:01:32 +00:00
2023-03-28 17:47:34 +00:00
o.Payload = new(sfgate_models.SalesforcePostResponse)
2022-09-05 00:01:32 +00:00
// 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{}
}
2023-03-22 20:49:01 +00:00
/*
PostAssetsUnauthorized describes a response with status code 401, with default header values.
2022-09-05 00:01:32 +00:00
Access unauthorized, invalid API-KEY was used
*/
type PostAssetsUnauthorized struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// 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
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsUnauthorized) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsUnauthorized %+v", 401, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *PostAssetsUnauthorized) String() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsUnauthorized %+v", 401, o.Payload)
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostAssetsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
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{}
}
2023-03-22 20:49:01 +00:00
/*
PostAssetsForbidden describes a response with status code 403, with default header values.
2022-09-05 00:01:32 +00:00
Access forbidden, account lacks access
*/
type PostAssetsForbidden struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// 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
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsForbidden) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsForbidden %+v", 403, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *PostAssetsForbidden) String() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsForbidden %+v", 403, o.Payload)
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostAssetsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
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{}
}
2023-03-22 20:49:01 +00:00
/*
PostAssetsNotFound describes a response with status code 404, with default header values.
2022-09-05 00:01:32 +00:00
Resource was not found
*/
type PostAssetsNotFound struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// 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
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsNotFound) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsNotFound %+v", 404, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *PostAssetsNotFound) String() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsNotFound %+v", 404, o.Payload)
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostAssetsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
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{}
}
2023-03-22 20:49:01 +00:00
/*
PostAssetsUnprocessableEntity describes a response with status code 422, with default header values.
2022-09-05 00:01:32 +00:00
Unprocessable Entity, likely a bad parameter
*/
type PostAssetsUnprocessableEntity struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// 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
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsUnprocessableEntity %+v", 422, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *PostAssetsUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsUnprocessableEntity %+v", 422, o.Payload)
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostAssetsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
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{}
}
2023-03-22 20:49:01 +00:00
/*
PostAssetsInternalServerError describes a response with status code 500, with default header values.
2022-09-05 00:01:32 +00:00
Server Internal Error
*/
type PostAssetsInternalServerError struct {
Payload *sfgate_models.Error
}
2023-03-22 20:49:01 +00:00
// 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
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsInternalServerError) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsInternalServerError %+v", 500, o.Payload)
}
2023-03-22 20:49:01 +00:00
func (o *PostAssetsInternalServerError) String() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsInternalServerError %+v", 500, o.Payload)
}
2022-09-05 00:01:32 +00:00
func (o *PostAssetsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostAssetsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
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
}