mirror of https://github.com/vernonkeenan/lib
324 lines
10 KiB
Go
324 lines
10 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 company_products
|
||
|
|
||
|
// 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"
|
||
|
)
|
||
|
|
||
|
// GetCompanyProductsReader is a Reader for the GetCompanyProducts structure.
|
||
|
type GetCompanyProductsReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *GetCompanyProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 200:
|
||
|
result := NewGetCompanyProductsOK()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 401:
|
||
|
result := NewGetCompanyProductsUnauthorized()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 403:
|
||
|
result := NewGetCompanyProductsForbidden()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 404:
|
||
|
result := NewGetCompanyProductsNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 422:
|
||
|
result := NewGetCompanyProductsUnprocessableEntity()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 500:
|
||
|
result := NewGetCompanyProductsInternalServerError()
|
||
|
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())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewGetCompanyProductsOK creates a GetCompanyProductsOK with default headers values
|
||
|
func NewGetCompanyProductsOK() *GetCompanyProductsOK {
|
||
|
return &GetCompanyProductsOK{}
|
||
|
}
|
||
|
|
||
|
/* GetCompanyProductsOK describes a response with status code 200, with default header values.
|
||
|
|
||
|
Taxnexus Response with an array of CompanyProduct objects
|
||
|
*/
|
||
|
type GetCompanyProductsOK struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
CacheControl string
|
||
|
|
||
|
Payload *sfgate_models.CompanyProductResponse
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsOK) Error() string {
|
||
|
return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
func (o *GetCompanyProductsOK) GetPayload() *sfgate_models.CompanyProductResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsOK) 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(sfgate_models.CompanyProductResponse)
|
||
|
|
||
|
// response payload
|
||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NewGetCompanyProductsUnauthorized creates a GetCompanyProductsUnauthorized with default headers values
|
||
|
func NewGetCompanyProductsUnauthorized() *GetCompanyProductsUnauthorized {
|
||
|
return &GetCompanyProductsUnauthorized{}
|
||
|
}
|
||
|
|
||
|
/* GetCompanyProductsUnauthorized describes a response with status code 401, with default header values.
|
||
|
|
||
|
Access unauthorized, invalid API-KEY was used
|
||
|
*/
|
||
|
type GetCompanyProductsUnauthorized struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *sfgate_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsUnauthorized) Error() string {
|
||
|
return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
func (o *GetCompanyProductsUnauthorized) GetPayload() *sfgate_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsUnauthorized) 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
|
||
|
}
|
||
|
|
||
|
// NewGetCompanyProductsForbidden creates a GetCompanyProductsForbidden with default headers values
|
||
|
func NewGetCompanyProductsForbidden() *GetCompanyProductsForbidden {
|
||
|
return &GetCompanyProductsForbidden{}
|
||
|
}
|
||
|
|
||
|
/* GetCompanyProductsForbidden describes a response with status code 403, with default header values.
|
||
|
|
||
|
Access forbidden, account lacks access
|
||
|
*/
|
||
|
type GetCompanyProductsForbidden struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *sfgate_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsForbidden) Error() string {
|
||
|
return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
func (o *GetCompanyProductsForbidden) GetPayload() *sfgate_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsForbidden) 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
|
||
|
}
|
||
|
|
||
|
// NewGetCompanyProductsNotFound creates a GetCompanyProductsNotFound with default headers values
|
||
|
func NewGetCompanyProductsNotFound() *GetCompanyProductsNotFound {
|
||
|
return &GetCompanyProductsNotFound{}
|
||
|
}
|
||
|
|
||
|
/* GetCompanyProductsNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
Resource was not found
|
||
|
*/
|
||
|
type GetCompanyProductsNotFound struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *sfgate_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsNotFound) Error() string {
|
||
|
return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
func (o *GetCompanyProductsNotFound) GetPayload() *sfgate_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsNotFound) 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
|
||
|
}
|
||
|
|
||
|
// NewGetCompanyProductsUnprocessableEntity creates a GetCompanyProductsUnprocessableEntity with default headers values
|
||
|
func NewGetCompanyProductsUnprocessableEntity() *GetCompanyProductsUnprocessableEntity {
|
||
|
return &GetCompanyProductsUnprocessableEntity{}
|
||
|
}
|
||
|
|
||
|
/* GetCompanyProductsUnprocessableEntity describes a response with status code 422, with default header values.
|
||
|
|
||
|
Unprocessable Entity, likely a bad parameter
|
||
|
*/
|
||
|
type GetCompanyProductsUnprocessableEntity struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *sfgate_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsUnprocessableEntity) Error() string {
|
||
|
return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
func (o *GetCompanyProductsUnprocessableEntity) GetPayload() *sfgate_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsUnprocessableEntity) 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
|
||
|
}
|
||
|
|
||
|
// NewGetCompanyProductsInternalServerError creates a GetCompanyProductsInternalServerError with default headers values
|
||
|
func NewGetCompanyProductsInternalServerError() *GetCompanyProductsInternalServerError {
|
||
|
return &GetCompanyProductsInternalServerError{}
|
||
|
}
|
||
|
|
||
|
/* GetCompanyProductsInternalServerError describes a response with status code 500, with default header values.
|
||
|
|
||
|
Server Internal Error
|
||
|
*/
|
||
|
type GetCompanyProductsInternalServerError struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *sfgate_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[GET /companyproducts][%d] getCompanyProductsInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
func (o *GetCompanyProductsInternalServerError) GetPayload() *sfgate_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *GetCompanyProductsInternalServerError) 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
|
||
|
}
|