mirror of https://github.com/vernonkeenan/lib
324 lines
9.1 KiB
Go
324 lines
9.1 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/crm/crm_models"
|
||
|
)
|
||
|
|
||
|
// PutAssetReader is a Reader for the PutAsset structure.
|
||
|
type PutAssetReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *PutAssetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 200:
|
||
|
result := NewPutAssetOK()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 401:
|
||
|
result := NewPutAssetUnauthorized()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 403:
|
||
|
result := NewPutAssetForbidden()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 404:
|
||
|
result := NewPutAssetNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 422:
|
||
|
result := NewPutAssetUnprocessableEntity()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 500:
|
||
|
result := NewPutAssetInternalServerError()
|
||
|
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())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPutAssetOK creates a PutAssetOK with default headers values
|
||
|
func NewPutAssetOK() *PutAssetOK {
|
||
|
return &PutAssetOK{}
|
||
|
}
|
||
|
|
||
|
/* PutAssetOK describes a response with status code 200, with default header values.
|
||
|
|
||
|
Taxnexus Response with Asset objects with Contacts
|
||
|
*/
|
||
|
type PutAssetOK struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
CacheControl string
|
||
|
|
||
|
Payload *crm_models.AssetResponse
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetOK) Error() string {
|
||
|
return fmt.Sprintf("[PUT /assets][%d] putAssetOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
func (o *PutAssetOK) GetPayload() *crm_models.AssetResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetOK) 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
|
||
|
}
|
||
|
|
||
|
// NewPutAssetUnauthorized creates a PutAssetUnauthorized with default headers values
|
||
|
func NewPutAssetUnauthorized() *PutAssetUnauthorized {
|
||
|
return &PutAssetUnauthorized{}
|
||
|
}
|
||
|
|
||
|
/* PutAssetUnauthorized describes a response with status code 401, with default header values.
|
||
|
|
||
|
Access unauthorized, invalid API-KEY was used
|
||
|
*/
|
||
|
type PutAssetUnauthorized struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetUnauthorized) Error() string {
|
||
|
return fmt.Sprintf("[PUT /assets][%d] putAssetUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
func (o *PutAssetUnauthorized) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetUnauthorized) 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
|
||
|
}
|
||
|
|
||
|
// NewPutAssetForbidden creates a PutAssetForbidden with default headers values
|
||
|
func NewPutAssetForbidden() *PutAssetForbidden {
|
||
|
return &PutAssetForbidden{}
|
||
|
}
|
||
|
|
||
|
/* PutAssetForbidden describes a response with status code 403, with default header values.
|
||
|
|
||
|
Access forbidden, account lacks access
|
||
|
*/
|
||
|
type PutAssetForbidden struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetForbidden) Error() string {
|
||
|
return fmt.Sprintf("[PUT /assets][%d] putAssetForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
func (o *PutAssetForbidden) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetForbidden) 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
|
||
|
}
|
||
|
|
||
|
// NewPutAssetNotFound creates a PutAssetNotFound with default headers values
|
||
|
func NewPutAssetNotFound() *PutAssetNotFound {
|
||
|
return &PutAssetNotFound{}
|
||
|
}
|
||
|
|
||
|
/* PutAssetNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
Resource was not found
|
||
|
*/
|
||
|
type PutAssetNotFound struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetNotFound) Error() string {
|
||
|
return fmt.Sprintf("[PUT /assets][%d] putAssetNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
func (o *PutAssetNotFound) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetNotFound) 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
|
||
|
}
|
||
|
|
||
|
// NewPutAssetUnprocessableEntity creates a PutAssetUnprocessableEntity with default headers values
|
||
|
func NewPutAssetUnprocessableEntity() *PutAssetUnprocessableEntity {
|
||
|
return &PutAssetUnprocessableEntity{}
|
||
|
}
|
||
|
|
||
|
/* PutAssetUnprocessableEntity describes a response with status code 422, with default header values.
|
||
|
|
||
|
Unprocessable Entity, likely a bad parameter
|
||
|
*/
|
||
|
type PutAssetUnprocessableEntity struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetUnprocessableEntity) Error() string {
|
||
|
return fmt.Sprintf("[PUT /assets][%d] putAssetUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
func (o *PutAssetUnprocessableEntity) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetUnprocessableEntity) 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
|
||
|
}
|
||
|
|
||
|
// NewPutAssetInternalServerError creates a PutAssetInternalServerError with default headers values
|
||
|
func NewPutAssetInternalServerError() *PutAssetInternalServerError {
|
||
|
return &PutAssetInternalServerError{}
|
||
|
}
|
||
|
|
||
|
/* PutAssetInternalServerError describes a response with status code 500, with default header values.
|
||
|
|
||
|
Server Internal Error
|
||
|
*/
|
||
|
type PutAssetInternalServerError struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[PUT /assets][%d] putAssetInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
func (o *PutAssetInternalServerError) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PutAssetInternalServerError) 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
|
||
|
}
|