lib/api/research/research_client/topic/get_topics_responses.go

324 lines
9.2 KiB
Go
Raw Normal View History

2022-09-05 00:01:32 +00:00
// 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
2022-09-07 00:16:25 +00:00
package topic
2022-09-05 00:01:32 +00:00
// 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"
)
2022-09-07 00:16:25 +00:00
// GetTopicsReader is a Reader for the GetTopics structure.
type GetTopicsReader struct {
2022-09-05 00:01:32 +00:00
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
2022-09-07 00:16:25 +00:00
func (o *GetTopicsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
2022-09-05 00:01:32 +00:00
switch response.Code() {
case 200:
2022-09-07 00:16:25 +00:00
result := NewGetTopicsOK()
2022-09-05 00:01:32 +00:00
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
2022-09-07 00:16:25 +00:00
result := NewGetTopicsUnauthorized()
2022-09-05 00:01:32 +00:00
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
2022-09-07 00:16:25 +00:00
result := NewGetTopicsForbidden()
2022-09-05 00:01:32 +00:00
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
2022-09-07 00:16:25 +00:00
result := NewGetTopicsNotFound()
2022-09-05 00:01:32 +00:00
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
2022-09-07 00:16:25 +00:00
result := NewGetTopicsUnprocessableEntity()
2022-09-05 00:01:32 +00:00
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
2022-09-07 00:16:25 +00:00
result := NewGetTopicsInternalServerError()
2022-09-05 00:01:32 +00:00
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())
}
}
2022-09-07 00:16:25 +00:00
// NewGetTopicsOK creates a GetTopicsOK with default headers values
func NewGetTopicsOK() *GetTopicsOK {
return &GetTopicsOK{}
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
/* GetTopicsOK describes a response with status code 200, with default header values.
2022-09-05 00:01:32 +00:00
2022-09-07 00:16:25 +00:00
Taxnexus Response with Topic objects
2022-09-05 00:01:32 +00:00
*/
2022-09-07 00:16:25 +00:00
type GetTopicsOK struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
CacheControl string
2022-09-07 00:16:25 +00:00
Payload *research_models.TopicResponse
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsOK) Error() string {
return fmt.Sprintf("[GET /topics][%d] getTopicsOK %+v", 200, o.Payload)
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsOK) GetPayload() *research_models.TopicResponse {
2022-09-05 00:01:32 +00:00
return o.Payload
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2022-09-05 00:01:32 +00:00
// 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
}
2022-09-07 00:16:25 +00:00
o.Payload = new(research_models.TopicResponse)
2022-09-05 00:01:32 +00:00
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
2022-09-07 00:16:25 +00:00
// NewGetTopicsUnauthorized creates a GetTopicsUnauthorized with default headers values
func NewGetTopicsUnauthorized() *GetTopicsUnauthorized {
return &GetTopicsUnauthorized{}
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
/* GetTopicsUnauthorized describes a response with status code 401, with default header values.
2022-09-05 00:01:32 +00:00
Access unauthorized, invalid API-KEY was used
*/
2022-09-07 00:16:25 +00:00
type GetTopicsUnauthorized struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsUnauthorized) Error() string {
return fmt.Sprintf("[GET /topics][%d] getTopicsUnauthorized %+v", 401, o.Payload)
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsUnauthorized) GetPayload() *research_models.Error {
2022-09-05 00:01:32 +00:00
return o.Payload
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2022-09-05 00:01:32 +00:00
// 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
}
2022-09-07 00:16:25 +00:00
// NewGetTopicsForbidden creates a GetTopicsForbidden with default headers values
func NewGetTopicsForbidden() *GetTopicsForbidden {
return &GetTopicsForbidden{}
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
/* GetTopicsForbidden describes a response with status code 403, with default header values.
2022-09-05 00:01:32 +00:00
Access forbidden, account lacks access
*/
2022-09-07 00:16:25 +00:00
type GetTopicsForbidden struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsForbidden) Error() string {
return fmt.Sprintf("[GET /topics][%d] getTopicsForbidden %+v", 403, o.Payload)
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsForbidden) GetPayload() *research_models.Error {
2022-09-05 00:01:32 +00:00
return o.Payload
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2022-09-05 00:01:32 +00:00
// 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
}
2022-09-07 00:16:25 +00:00
// NewGetTopicsNotFound creates a GetTopicsNotFound with default headers values
func NewGetTopicsNotFound() *GetTopicsNotFound {
return &GetTopicsNotFound{}
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
/* GetTopicsNotFound describes a response with status code 404, with default header values.
2022-09-05 00:01:32 +00:00
Resource was not found
*/
2022-09-07 00:16:25 +00:00
type GetTopicsNotFound struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsNotFound) Error() string {
return fmt.Sprintf("[GET /topics][%d] getTopicsNotFound %+v", 404, o.Payload)
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsNotFound) GetPayload() *research_models.Error {
2022-09-05 00:01:32 +00:00
return o.Payload
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2022-09-05 00:01:32 +00:00
// 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
}
2022-09-07 00:16:25 +00:00
// NewGetTopicsUnprocessableEntity creates a GetTopicsUnprocessableEntity with default headers values
func NewGetTopicsUnprocessableEntity() *GetTopicsUnprocessableEntity {
return &GetTopicsUnprocessableEntity{}
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
/* GetTopicsUnprocessableEntity describes a response with status code 422, with default header values.
2022-09-05 00:01:32 +00:00
Unprocessable Entity, likely a bad parameter
*/
2022-09-07 00:16:25 +00:00
type GetTopicsUnprocessableEntity struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /topics][%d] getTopicsUnprocessableEntity %+v", 422, o.Payload)
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsUnprocessableEntity) GetPayload() *research_models.Error {
2022-09-05 00:01:32 +00:00
return o.Payload
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2022-09-05 00:01:32 +00:00
// 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
}
2022-09-07 00:16:25 +00:00
// NewGetTopicsInternalServerError creates a GetTopicsInternalServerError with default headers values
func NewGetTopicsInternalServerError() *GetTopicsInternalServerError {
return &GetTopicsInternalServerError{}
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
/* GetTopicsInternalServerError describes a response with status code 500, with default header values.
2022-09-05 00:01:32 +00:00
Server Internal Error
*/
2022-09-07 00:16:25 +00:00
type GetTopicsInternalServerError struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsInternalServerError) Error() string {
return fmt.Sprintf("[GET /topics][%d] getTopicsInternalServerError %+v", 500, o.Payload)
2022-09-05 00:01:32 +00:00
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsInternalServerError) GetPayload() *research_models.Error {
2022-09-05 00:01:32 +00:00
return o.Payload
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
2022-09-05 00:01:32 +00:00
// 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
}