mirror of https://github.com/vernonkeenan/lib
324 lines
9.7 KiB
Go
324 lines
9.7 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 industries
|
||
|
|
||
|
// 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/research/research_models"
|
||
|
)
|
||
|
|
||
|
// PostIndustriesReader is a Reader for the PostIndustries structure.
|
||
|
type PostIndustriesReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *PostIndustriesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 200:
|
||
|
result := NewPostIndustriesOK()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 401:
|
||
|
result := NewPostIndustriesUnauthorized()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 403:
|
||
|
result := NewPostIndustriesForbidden()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 404:
|
||
|
result := NewPostIndustriesNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 422:
|
||
|
result := NewPostIndustriesUnprocessableEntity()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 500:
|
||
|
result := NewPostIndustriesInternalServerError()
|
||
|
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())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPostIndustriesOK creates a PostIndustriesOK with default headers values
|
||
|
func NewPostIndustriesOK() *PostIndustriesOK {
|
||
|
return &PostIndustriesOK{}
|
||
|
}
|
||
|
|
||
|
/* PostIndustriesOK describes a response with status code 200, with default header values.
|
||
|
|
||
|
Taxnexus Response with Industry objects
|
||
|
*/
|
||
|
type PostIndustriesOK struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
CacheControl string
|
||
|
|
||
|
Payload *research_models.IndustryResponse
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesOK) Error() string {
|
||
|
return fmt.Sprintf("[POST /industries][%d] postIndustriesOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
func (o *PostIndustriesOK) GetPayload() *research_models.IndustryResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesOK) 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(research_models.IndustryResponse)
|
||
|
|
||
|
// response payload
|
||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NewPostIndustriesUnauthorized creates a PostIndustriesUnauthorized with default headers values
|
||
|
func NewPostIndustriesUnauthorized() *PostIndustriesUnauthorized {
|
||
|
return &PostIndustriesUnauthorized{}
|
||
|
}
|
||
|
|
||
|
/* PostIndustriesUnauthorized describes a response with status code 401, with default header values.
|
||
|
|
||
|
Access unauthorized, invalid API-KEY was used
|
||
|
*/
|
||
|
type PostIndustriesUnauthorized struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesUnauthorized) Error() string {
|
||
|
return fmt.Sprintf("[POST /industries][%d] postIndustriesUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
func (o *PostIndustriesUnauthorized) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesUnauthorized) 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
|
||
|
}
|
||
|
|
||
|
// NewPostIndustriesForbidden creates a PostIndustriesForbidden with default headers values
|
||
|
func NewPostIndustriesForbidden() *PostIndustriesForbidden {
|
||
|
return &PostIndustriesForbidden{}
|
||
|
}
|
||
|
|
||
|
/* PostIndustriesForbidden describes a response with status code 403, with default header values.
|
||
|
|
||
|
Access forbidden, account lacks access
|
||
|
*/
|
||
|
type PostIndustriesForbidden struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesForbidden) Error() string {
|
||
|
return fmt.Sprintf("[POST /industries][%d] postIndustriesForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
func (o *PostIndustriesForbidden) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesForbidden) 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
|
||
|
}
|
||
|
|
||
|
// NewPostIndustriesNotFound creates a PostIndustriesNotFound with default headers values
|
||
|
func NewPostIndustriesNotFound() *PostIndustriesNotFound {
|
||
|
return &PostIndustriesNotFound{}
|
||
|
}
|
||
|
|
||
|
/* PostIndustriesNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
Resource was not found
|
||
|
*/
|
||
|
type PostIndustriesNotFound struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesNotFound) Error() string {
|
||
|
return fmt.Sprintf("[POST /industries][%d] postIndustriesNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
func (o *PostIndustriesNotFound) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesNotFound) 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
|
||
|
}
|
||
|
|
||
|
// NewPostIndustriesUnprocessableEntity creates a PostIndustriesUnprocessableEntity with default headers values
|
||
|
func NewPostIndustriesUnprocessableEntity() *PostIndustriesUnprocessableEntity {
|
||
|
return &PostIndustriesUnprocessableEntity{}
|
||
|
}
|
||
|
|
||
|
/* PostIndustriesUnprocessableEntity describes a response with status code 422, with default header values.
|
||
|
|
||
|
Unprocessable Entity, likely a bad parameter
|
||
|
*/
|
||
|
type PostIndustriesUnprocessableEntity struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesUnprocessableEntity) Error() string {
|
||
|
return fmt.Sprintf("[POST /industries][%d] postIndustriesUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
func (o *PostIndustriesUnprocessableEntity) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesUnprocessableEntity) 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
|
||
|
}
|
||
|
|
||
|
// NewPostIndustriesInternalServerError creates a PostIndustriesInternalServerError with default headers values
|
||
|
func NewPostIndustriesInternalServerError() *PostIndustriesInternalServerError {
|
||
|
return &PostIndustriesInternalServerError{}
|
||
|
}
|
||
|
|
||
|
/* PostIndustriesInternalServerError describes a response with status code 500, with default header values.
|
||
|
|
||
|
Server Internal Error
|
||
|
*/
|
||
|
type PostIndustriesInternalServerError struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[POST /industries][%d] postIndustriesInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
func (o *PostIndustriesInternalServerError) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostIndustriesInternalServerError) 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
|
||
|
}
|