mirror of https://github.com/vernonkeenan/lib
324 lines
9.3 KiB
Go
324 lines
9.3 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 topic
|
||
|
|
||
|
// 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"
|
||
|
)
|
||
|
|
||
|
// PostTopicsReader is a Reader for the PostTopics structure.
|
||
|
type PostTopicsReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *PostTopicsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 200:
|
||
|
result := NewPostTopicsOK()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 401:
|
||
|
result := NewPostTopicsUnauthorized()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 403:
|
||
|
result := NewPostTopicsForbidden()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 404:
|
||
|
result := NewPostTopicsNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 422:
|
||
|
result := NewPostTopicsUnprocessableEntity()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 500:
|
||
|
result := NewPostTopicsInternalServerError()
|
||
|
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())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPostTopicsOK creates a PostTopicsOK with default headers values
|
||
|
func NewPostTopicsOK() *PostTopicsOK {
|
||
|
return &PostTopicsOK{}
|
||
|
}
|
||
|
|
||
|
/* PostTopicsOK describes a response with status code 200, with default header values.
|
||
|
|
||
|
Taxnexus Response with Topic objects
|
||
|
*/
|
||
|
type PostTopicsOK struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
CacheControl string
|
||
|
|
||
|
Payload *research_models.TopicResponse
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsOK) Error() string {
|
||
|
return fmt.Sprintf("[POST /topics][%d] postTopicsOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
func (o *PostTopicsOK) GetPayload() *research_models.TopicResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsOK) 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.TopicResponse)
|
||
|
|
||
|
// response payload
|
||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NewPostTopicsUnauthorized creates a PostTopicsUnauthorized with default headers values
|
||
|
func NewPostTopicsUnauthorized() *PostTopicsUnauthorized {
|
||
|
return &PostTopicsUnauthorized{}
|
||
|
}
|
||
|
|
||
|
/* PostTopicsUnauthorized describes a response with status code 401, with default header values.
|
||
|
|
||
|
Access unauthorized, invalid API-KEY was used
|
||
|
*/
|
||
|
type PostTopicsUnauthorized struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsUnauthorized) Error() string {
|
||
|
return fmt.Sprintf("[POST /topics][%d] postTopicsUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
func (o *PostTopicsUnauthorized) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsUnauthorized) 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
|
||
|
}
|
||
|
|
||
|
// NewPostTopicsForbidden creates a PostTopicsForbidden with default headers values
|
||
|
func NewPostTopicsForbidden() *PostTopicsForbidden {
|
||
|
return &PostTopicsForbidden{}
|
||
|
}
|
||
|
|
||
|
/* PostTopicsForbidden describes a response with status code 403, with default header values.
|
||
|
|
||
|
Access forbidden, account lacks access
|
||
|
*/
|
||
|
type PostTopicsForbidden struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsForbidden) Error() string {
|
||
|
return fmt.Sprintf("[POST /topics][%d] postTopicsForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
func (o *PostTopicsForbidden) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsForbidden) 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
|
||
|
}
|
||
|
|
||
|
// NewPostTopicsNotFound creates a PostTopicsNotFound with default headers values
|
||
|
func NewPostTopicsNotFound() *PostTopicsNotFound {
|
||
|
return &PostTopicsNotFound{}
|
||
|
}
|
||
|
|
||
|
/* PostTopicsNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
Resource was not found
|
||
|
*/
|
||
|
type PostTopicsNotFound struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsNotFound) Error() string {
|
||
|
return fmt.Sprintf("[POST /topics][%d] postTopicsNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
func (o *PostTopicsNotFound) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsNotFound) 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
|
||
|
}
|
||
|
|
||
|
// NewPostTopicsUnprocessableEntity creates a PostTopicsUnprocessableEntity with default headers values
|
||
|
func NewPostTopicsUnprocessableEntity() *PostTopicsUnprocessableEntity {
|
||
|
return &PostTopicsUnprocessableEntity{}
|
||
|
}
|
||
|
|
||
|
/* PostTopicsUnprocessableEntity describes a response with status code 422, with default header values.
|
||
|
|
||
|
Unprocessable Entity, likely a bad parameter
|
||
|
*/
|
||
|
type PostTopicsUnprocessableEntity struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsUnprocessableEntity) Error() string {
|
||
|
return fmt.Sprintf("[POST /topics][%d] postTopicsUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
func (o *PostTopicsUnprocessableEntity) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsUnprocessableEntity) 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
|
||
|
}
|
||
|
|
||
|
// NewPostTopicsInternalServerError creates a PostTopicsInternalServerError with default headers values
|
||
|
func NewPostTopicsInternalServerError() *PostTopicsInternalServerError {
|
||
|
return &PostTopicsInternalServerError{}
|
||
|
}
|
||
|
|
||
|
/* PostTopicsInternalServerError describes a response with status code 500, with default header values.
|
||
|
|
||
|
Server Internal Error
|
||
|
*/
|
||
|
type PostTopicsInternalServerError struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *research_models.Error
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[POST /topics][%d] postTopicsInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
func (o *PostTopicsInternalServerError) GetPayload() *research_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostTopicsInternalServerError) 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
|
||
|
}
|