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"
|
|
)
|
|
|
|
// PostCompanyProductsReader is a Reader for the PostCompanyProducts structure.
|
|
type PostCompanyProductsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *PostCompanyProductsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewPostCompanyProductsOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewPostCompanyProductsUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewPostCompanyProductsForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewPostCompanyProductsNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewPostCompanyProductsUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewPostCompanyProductsInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewPostCompanyProductsOK creates a PostCompanyProductsOK with default headers values
|
|
func NewPostCompanyProductsOK() *PostCompanyProductsOK {
|
|
return &PostCompanyProductsOK{}
|
|
}
|
|
|
|
/* PostCompanyProductsOK describes a response with status code 200, with default header values.
|
|
|
|
Taxnexus Response with an array of CompanyProduct objects
|
|
*/
|
|
type PostCompanyProductsOK struct {
|
|
AccessControlAllowOrigin string
|
|
CacheControl string
|
|
|
|
Payload *sfgate_models.CompanyProductResponse
|
|
}
|
|
|
|
func (o *PostCompanyProductsOK) Error() string {
|
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsOK %+v", 200, o.Payload)
|
|
}
|
|
func (o *PostCompanyProductsOK) GetPayload() *sfgate_models.CompanyProductResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostCompanyProductsOK) 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
|
|
}
|
|
|
|
// NewPostCompanyProductsUnauthorized creates a PostCompanyProductsUnauthorized with default headers values
|
|
func NewPostCompanyProductsUnauthorized() *PostCompanyProductsUnauthorized {
|
|
return &PostCompanyProductsUnauthorized{}
|
|
}
|
|
|
|
/* PostCompanyProductsUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access unauthorized, invalid API-KEY was used
|
|
*/
|
|
type PostCompanyProductsUnauthorized struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
func (o *PostCompanyProductsUnauthorized) Error() string {
|
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
func (o *PostCompanyProductsUnauthorized) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostCompanyProductsUnauthorized) 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
|
|
}
|
|
|
|
// NewPostCompanyProductsForbidden creates a PostCompanyProductsForbidden with default headers values
|
|
func NewPostCompanyProductsForbidden() *PostCompanyProductsForbidden {
|
|
return &PostCompanyProductsForbidden{}
|
|
}
|
|
|
|
/* PostCompanyProductsForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type PostCompanyProductsForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
func (o *PostCompanyProductsForbidden) Error() string {
|
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsForbidden %+v", 403, o.Payload)
|
|
}
|
|
func (o *PostCompanyProductsForbidden) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostCompanyProductsForbidden) 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
|
|
}
|
|
|
|
// NewPostCompanyProductsNotFound creates a PostCompanyProductsNotFound with default headers values
|
|
func NewPostCompanyProductsNotFound() *PostCompanyProductsNotFound {
|
|
return &PostCompanyProductsNotFound{}
|
|
}
|
|
|
|
/* PostCompanyProductsNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type PostCompanyProductsNotFound struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
func (o *PostCompanyProductsNotFound) Error() string {
|
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsNotFound %+v", 404, o.Payload)
|
|
}
|
|
func (o *PostCompanyProductsNotFound) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostCompanyProductsNotFound) 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
|
|
}
|
|
|
|
// NewPostCompanyProductsUnprocessableEntity creates a PostCompanyProductsUnprocessableEntity with default headers values
|
|
func NewPostCompanyProductsUnprocessableEntity() *PostCompanyProductsUnprocessableEntity {
|
|
return &PostCompanyProductsUnprocessableEntity{}
|
|
}
|
|
|
|
/* PostCompanyProductsUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type PostCompanyProductsUnprocessableEntity struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
func (o *PostCompanyProductsUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
func (o *PostCompanyProductsUnprocessableEntity) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostCompanyProductsUnprocessableEntity) 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
|
|
}
|
|
|
|
// NewPostCompanyProductsInternalServerError creates a PostCompanyProductsInternalServerError with default headers values
|
|
func NewPostCompanyProductsInternalServerError() *PostCompanyProductsInternalServerError {
|
|
return &PostCompanyProductsInternalServerError{}
|
|
}
|
|
|
|
/* PostCompanyProductsInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type PostCompanyProductsInternalServerError struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
func (o *PostCompanyProductsInternalServerError) Error() string {
|
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
func (o *PostCompanyProductsInternalServerError) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PostCompanyProductsInternalServerError) 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
|
|
}
|