mirror of https://github.com/vernonkeenan/lib
324 lines
9.2 KiB
Go
324 lines
9.2 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"
|
||
|
)
|
||
|
|
||
|
// GetAssetsReader is a Reader for the GetAssets structure.
|
||
|
type GetAssetsReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *GetAssetsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 200:
|
||
|
result := NewGetAssetsOK()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 401:
|
||
|
result := NewGetAssetsUnauthorized()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 403:
|
||
|
result := NewGetAssetsForbidden()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 404:
|
||
|
result := NewGetAssetsNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 422:
|
||
|
result := NewGetAssetsUnprocessableEntity()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 500:
|
||
|
result := NewGetAssetsInternalServerError()
|
||
|
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())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewGetAssetsOK creates a GetAssetsOK with default headers values
|
||
|
func NewGetAssetsOK() *GetAssetsOK {
|
||
|
return &GetAssetsOK{}
|
||
|
}
|
||
|
|
||
|
/* GetAssetsOK describes a response with status code 200, with default header values.
|
||
|
|
||
|
Taxnexus Response with Asset objects with Contacts
|
||
|
*/
|
||
|
type GetAssetsOK struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
CacheControl string
|
||
|
|
||
|
Payload *crm_models.AssetResponse
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsOK) Error() string {
|
||
|
return fmt.Sprintf("[GET /assets][%d] getAssetsOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
func (o *GetAssetsOK) GetPayload() *crm_models.AssetResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsOK) 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
|
||
|
}
|
||
|
|
||
|
// NewGetAssetsUnauthorized creates a GetAssetsUnauthorized with default headers values
|
||
|
func NewGetAssetsUnauthorized() *GetAssetsUnauthorized {
|
||
|
return &GetAssetsUnauthorized{}
|
||
|
}
|
||
|
|
||
|
/* GetAssetsUnauthorized describes a response with status code 401, with default header values.
|
||
|
|
||
|
Access unauthorized, invalid API-KEY was used
|
||
|
*/
|
||
|
type GetAssetsUnauthorized struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsUnauthorized) Error() string {
|
||
|
return fmt.Sprintf("[GET /assets][%d] getAssetsUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
func (o *GetAssetsUnauthorized) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsUnauthorized) 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
|
||
|
}
|
||
|
|
||
|
// NewGetAssetsForbidden creates a GetAssetsForbidden with default headers values
|
||
|
func NewGetAssetsForbidden() *GetAssetsForbidden {
|
||
|
return &GetAssetsForbidden{}
|
||
|
}
|
||
|
|
||
|
/* GetAssetsForbidden describes a response with status code 403, with default header values.
|
||
|
|
||
|
Access forbidden, account lacks access
|
||
|
*/
|
||
|
type GetAssetsForbidden struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsForbidden) Error() string {
|
||
|
return fmt.Sprintf("[GET /assets][%d] getAssetsForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
func (o *GetAssetsForbidden) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsForbidden) 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
|
||
|
}
|
||
|
|
||
|
// NewGetAssetsNotFound creates a GetAssetsNotFound with default headers values
|
||
|
func NewGetAssetsNotFound() *GetAssetsNotFound {
|
||
|
return &GetAssetsNotFound{}
|
||
|
}
|
||
|
|
||
|
/* GetAssetsNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
Resource was not found
|
||
|
*/
|
||
|
type GetAssetsNotFound struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsNotFound) Error() string {
|
||
|
return fmt.Sprintf("[GET /assets][%d] getAssetsNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
func (o *GetAssetsNotFound) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsNotFound) 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
|
||
|
}
|
||
|
|
||
|
// NewGetAssetsUnprocessableEntity creates a GetAssetsUnprocessableEntity with default headers values
|
||
|
func NewGetAssetsUnprocessableEntity() *GetAssetsUnprocessableEntity {
|
||
|
return &GetAssetsUnprocessableEntity{}
|
||
|
}
|
||
|
|
||
|
/* GetAssetsUnprocessableEntity describes a response with status code 422, with default header values.
|
||
|
|
||
|
Unprocessable Entity, likely a bad parameter
|
||
|
*/
|
||
|
type GetAssetsUnprocessableEntity struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsUnprocessableEntity) Error() string {
|
||
|
return fmt.Sprintf("[GET /assets][%d] getAssetsUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
func (o *GetAssetsUnprocessableEntity) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsUnprocessableEntity) 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
|
||
|
}
|
||
|
|
||
|
// NewGetAssetsInternalServerError creates a GetAssetsInternalServerError with default headers values
|
||
|
func NewGetAssetsInternalServerError() *GetAssetsInternalServerError {
|
||
|
return &GetAssetsInternalServerError{}
|
||
|
}
|
||
|
|
||
|
/* GetAssetsInternalServerError describes a response with status code 500, with default header values.
|
||
|
|
||
|
Server Internal Error
|
||
|
*/
|
||
|
type GetAssetsInternalServerError struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *crm_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[GET /assets][%d] getAssetsInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
func (o *GetAssetsInternalServerError) GetPayload() *crm_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetAssetsInternalServerError) 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
|
||
|
}
|