lib/api/crm/crm_client/assets/post_assets_responses.go

324 lines
9.2 KiB
Go
Raw Normal View History

2022-09-03 03:34:04 +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/crm/crm_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 200:
result := NewPostAssetsOK()
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())
}
}
// NewPostAssetsOK creates a PostAssetsOK with default headers values
func NewPostAssetsOK() *PostAssetsOK {
return &PostAssetsOK{}
}
/* PostAssetsOK describes a response with status code 200, with default header values.
Taxnexus Response with Asset objects with Contacts
*/
type PostAssetsOK struct {
AccessControlAllowOrigin string
CacheControl string
Payload *crm_models.AssetResponse
}
func (o *PostAssetsOK) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsOK %+v", 200, o.Payload)
}
func (o *PostAssetsOK) GetPayload() *crm_models.AssetResponse {
return o.Payload
}
func (o *PostAssetsOK) 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
}
// hydrates response header Cache-Control
hdrCacheControl := response.GetHeader("Cache-Control")
if hdrCacheControl != "" {
o.CacheControl = hdrCacheControl
}
o.Payload = new(crm_models.AssetResponse)
// 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 *crm_models.Error
}
func (o *PostAssetsUnauthorized) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsUnauthorized %+v", 401, o.Payload)
}
func (o *PostAssetsUnauthorized) GetPayload() *crm_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(crm_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 *crm_models.Error
}
func (o *PostAssetsForbidden) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsForbidden %+v", 403, o.Payload)
}
func (o *PostAssetsForbidden) GetPayload() *crm_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(crm_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 *crm_models.Error
}
func (o *PostAssetsNotFound) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsNotFound %+v", 404, o.Payload)
}
func (o *PostAssetsNotFound) GetPayload() *crm_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(crm_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 *crm_models.Error
}
func (o *PostAssetsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostAssetsUnprocessableEntity) GetPayload() *crm_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(crm_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 *crm_models.Error
}
func (o *PostAssetsInternalServerError) Error() string {
return fmt.Sprintf("[POST /assets][%d] postAssetsInternalServerError %+v", 500, o.Payload)
}
func (o *PostAssetsInternalServerError) GetPayload() *crm_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(crm_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}