523 lines
17 KiB
Go
523 lines
17 KiB
Go
|
// Code generated by go-swagger; DO NOT EDIT.
|
||
|
|
||
|
// (c) 2012-2023 by Vernon Keenan
|
||
|
// 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/work/lib/api/research/research_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.
|
||
|
|
||
|
Response with CompanyProduct objects
|
||
|
*/
|
||
|
type PostCompanyProductsOK struct {
|
||
|
Payload *research_models.CompanyProductResponse
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post company products o k response has a 2xx status code
|
||
|
func (o *PostCompanyProductsOK) IsSuccess() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post company products o k response has a 3xx status code
|
||
|
func (o *PostCompanyProductsOK) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post company products o k response has a 4xx status code
|
||
|
func (o *PostCompanyProductsOK) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post company products o k response has a 5xx status code
|
||
|
func (o *PostCompanyProductsOK) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post company products o k response a status code equal to that given
|
||
|
func (o *PostCompanyProductsOK) IsCode(code int) bool {
|
||
|
return code == 200
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post company products o k response
|
||
|
func (o *PostCompanyProductsOK) Code() int {
|
||
|
return 200
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsOK) Error() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsOK) String() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsOK) GetPayload() *research_models.CompanyProductResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
o.Payload = new(research_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 *research_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post company products unauthorized response has a 2xx status code
|
||
|
func (o *PostCompanyProductsUnauthorized) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post company products unauthorized response has a 3xx status code
|
||
|
func (o *PostCompanyProductsUnauthorized) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post company products unauthorized response has a 4xx status code
|
||
|
func (o *PostCompanyProductsUnauthorized) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post company products unauthorized response has a 5xx status code
|
||
|
func (o *PostCompanyProductsUnauthorized) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post company products unauthorized response a status code equal to that given
|
||
|
func (o *PostCompanyProductsUnauthorized) IsCode(code int) bool {
|
||
|
return code == 401
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post company products unauthorized response
|
||
|
func (o *PostCompanyProductsUnauthorized) Code() int {
|
||
|
return 401
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsUnauthorized) Error() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsUnauthorized) String() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsUnauthorized) GetPayload() *research_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(research_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 *research_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post company products forbidden response has a 2xx status code
|
||
|
func (o *PostCompanyProductsForbidden) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post company products forbidden response has a 3xx status code
|
||
|
func (o *PostCompanyProductsForbidden) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post company products forbidden response has a 4xx status code
|
||
|
func (o *PostCompanyProductsForbidden) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post company products forbidden response has a 5xx status code
|
||
|
func (o *PostCompanyProductsForbidden) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post company products forbidden response a status code equal to that given
|
||
|
func (o *PostCompanyProductsForbidden) IsCode(code int) bool {
|
||
|
return code == 403
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post company products forbidden response
|
||
|
func (o *PostCompanyProductsForbidden) Code() int {
|
||
|
return 403
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsForbidden) Error() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsForbidden) String() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsForbidden) GetPayload() *research_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(research_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 *research_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post company products not found response has a 2xx status code
|
||
|
func (o *PostCompanyProductsNotFound) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post company products not found response has a 3xx status code
|
||
|
func (o *PostCompanyProductsNotFound) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post company products not found response has a 4xx status code
|
||
|
func (o *PostCompanyProductsNotFound) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post company products not found response has a 5xx status code
|
||
|
func (o *PostCompanyProductsNotFound) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post company products not found response a status code equal to that given
|
||
|
func (o *PostCompanyProductsNotFound) IsCode(code int) bool {
|
||
|
return code == 404
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post company products not found response
|
||
|
func (o *PostCompanyProductsNotFound) Code() int {
|
||
|
return 404
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsNotFound) Error() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsNotFound) String() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsNotFound) GetPayload() *research_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(research_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 *research_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post company products unprocessable entity response has a 2xx status code
|
||
|
func (o *PostCompanyProductsUnprocessableEntity) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post company products unprocessable entity response has a 3xx status code
|
||
|
func (o *PostCompanyProductsUnprocessableEntity) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post company products unprocessable entity response has a 4xx status code
|
||
|
func (o *PostCompanyProductsUnprocessableEntity) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post company products unprocessable entity response has a 5xx status code
|
||
|
func (o *PostCompanyProductsUnprocessableEntity) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post company products unprocessable entity response a status code equal to that given
|
||
|
func (o *PostCompanyProductsUnprocessableEntity) IsCode(code int) bool {
|
||
|
return code == 422
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post company products unprocessable entity response
|
||
|
func (o *PostCompanyProductsUnprocessableEntity) Code() int {
|
||
|
return 422
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsUnprocessableEntity) Error() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsUnprocessableEntity) String() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsUnprocessableEntity) GetPayload() *research_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(research_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 *research_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post company products internal server error response has a 2xx status code
|
||
|
func (o *PostCompanyProductsInternalServerError) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post company products internal server error response has a 3xx status code
|
||
|
func (o *PostCompanyProductsInternalServerError) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post company products internal server error response has a 4xx status code
|
||
|
func (o *PostCompanyProductsInternalServerError) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post company products internal server error response has a 5xx status code
|
||
|
func (o *PostCompanyProductsInternalServerError) IsServerError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post company products internal server error response a status code equal to that given
|
||
|
func (o *PostCompanyProductsInternalServerError) IsCode(code int) bool {
|
||
|
return code == 500
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post company products internal server error response
|
||
|
func (o *PostCompanyProductsInternalServerError) Code() int {
|
||
|
return 500
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsInternalServerError) String() string {
|
||
|
return fmt.Sprintf("[POST /companyproducts][%d] postCompanyProductsInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostCompanyProductsInternalServerError) GetPayload() *research_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(research_models.Error)
|
||
|
|
||
|
// response payload
|
||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|