mirror of https://github.com/vernonkeenan/lib
521 lines
16 KiB
Go
521 lines
16 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 topics
|
|
|
|
import (
|
|
"encoding/json"
|
|
stderrors "errors"
|
|
"fmt"
|
|
"io"
|
|
|
|
"code.tnxs.net/vernonkeenan/lib/api/research/research_models"
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// GetTopicsReader is a Reader for the GetTopics structure.
|
|
type GetTopicsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetTopicsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewGetTopicsOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewGetTopicsUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewGetTopicsForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewGetTopicsNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewGetTopicsUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewGetTopicsInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[GET /topics] getTopics", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGetTopicsOK creates a GetTopicsOK with default headers values
|
|
func NewGetTopicsOK() *GetTopicsOK {
|
|
return &GetTopicsOK{}
|
|
}
|
|
|
|
// GetTopicsOK describes a response with status code 200, with default header values.
|
|
//
|
|
// Response with Topic objects
|
|
type GetTopicsOK struct {
|
|
Payload *research_models.TopicResponse
|
|
}
|
|
|
|
// IsSuccess returns true when this get topics o k response has a 2xx status code
|
|
func (o *GetTopicsOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this get topics o k response has a 3xx status code
|
|
func (o *GetTopicsOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get topics o k response has a 4xx status code
|
|
func (o *GetTopicsOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this get topics o k response has a 5xx status code
|
|
func (o *GetTopicsOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get topics o k response a status code equal to that given
|
|
func (o *GetTopicsOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the get topics o k response
|
|
func (o *GetTopicsOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *GetTopicsOK) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *GetTopicsOK) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *GetTopicsOK) GetPayload() *research_models.TopicResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTopicsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(research_models.TopicResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetTopicsUnauthorized creates a GetTopicsUnauthorized with default headers values
|
|
func NewGetTopicsUnauthorized() *GetTopicsUnauthorized {
|
|
return &GetTopicsUnauthorized{}
|
|
}
|
|
|
|
// GetTopicsUnauthorized describes a response with status code 401, with default header values.
|
|
//
|
|
// Access unauthorized, invalid API-KEY was used
|
|
type GetTopicsUnauthorized struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get topics unauthorized response has a 2xx status code
|
|
func (o *GetTopicsUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get topics unauthorized response has a 3xx status code
|
|
func (o *GetTopicsUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get topics unauthorized response has a 4xx status code
|
|
func (o *GetTopicsUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get topics unauthorized response has a 5xx status code
|
|
func (o *GetTopicsUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get topics unauthorized response a status code equal to that given
|
|
func (o *GetTopicsUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the get topics unauthorized response
|
|
func (o *GetTopicsUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *GetTopicsUnauthorized) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsUnauthorized %s", 401, payload)
|
|
}
|
|
|
|
func (o *GetTopicsUnauthorized) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsUnauthorized %s", 401, payload)
|
|
}
|
|
|
|
func (o *GetTopicsUnauthorized) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTopicsUnauthorized) 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 && !stderrors.Is(err, io.EOF) {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetTopicsForbidden creates a GetTopicsForbidden with default headers values
|
|
func NewGetTopicsForbidden() *GetTopicsForbidden {
|
|
return &GetTopicsForbidden{}
|
|
}
|
|
|
|
// GetTopicsForbidden describes a response with status code 403, with default header values.
|
|
//
|
|
// Access forbidden, account lacks access
|
|
type GetTopicsForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get topics forbidden response has a 2xx status code
|
|
func (o *GetTopicsForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get topics forbidden response has a 3xx status code
|
|
func (o *GetTopicsForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get topics forbidden response has a 4xx status code
|
|
func (o *GetTopicsForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get topics forbidden response has a 5xx status code
|
|
func (o *GetTopicsForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get topics forbidden response a status code equal to that given
|
|
func (o *GetTopicsForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the get topics forbidden response
|
|
func (o *GetTopicsForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *GetTopicsForbidden) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsForbidden %s", 403, payload)
|
|
}
|
|
|
|
func (o *GetTopicsForbidden) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsForbidden %s", 403, payload)
|
|
}
|
|
|
|
func (o *GetTopicsForbidden) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTopicsForbidden) 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 && !stderrors.Is(err, io.EOF) {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetTopicsNotFound creates a GetTopicsNotFound with default headers values
|
|
func NewGetTopicsNotFound() *GetTopicsNotFound {
|
|
return &GetTopicsNotFound{}
|
|
}
|
|
|
|
// GetTopicsNotFound describes a response with status code 404, with default header values.
|
|
//
|
|
// Resource was not found
|
|
type GetTopicsNotFound struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get topics not found response has a 2xx status code
|
|
func (o *GetTopicsNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get topics not found response has a 3xx status code
|
|
func (o *GetTopicsNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get topics not found response has a 4xx status code
|
|
func (o *GetTopicsNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get topics not found response has a 5xx status code
|
|
func (o *GetTopicsNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get topics not found response a status code equal to that given
|
|
func (o *GetTopicsNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the get topics not found response
|
|
func (o *GetTopicsNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *GetTopicsNotFound) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsNotFound %s", 404, payload)
|
|
}
|
|
|
|
func (o *GetTopicsNotFound) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsNotFound %s", 404, payload)
|
|
}
|
|
|
|
func (o *GetTopicsNotFound) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTopicsNotFound) 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 && !stderrors.Is(err, io.EOF) {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetTopicsUnprocessableEntity creates a GetTopicsUnprocessableEntity with default headers values
|
|
func NewGetTopicsUnprocessableEntity() *GetTopicsUnprocessableEntity {
|
|
return &GetTopicsUnprocessableEntity{}
|
|
}
|
|
|
|
// GetTopicsUnprocessableEntity describes a response with status code 422, with default header values.
|
|
//
|
|
// Unprocessable Entity, likely a bad parameter
|
|
type GetTopicsUnprocessableEntity struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get topics unprocessable entity response has a 2xx status code
|
|
func (o *GetTopicsUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get topics unprocessable entity response has a 3xx status code
|
|
func (o *GetTopicsUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get topics unprocessable entity response has a 4xx status code
|
|
func (o *GetTopicsUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this get topics unprocessable entity response has a 5xx status code
|
|
func (o *GetTopicsUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this get topics unprocessable entity response a status code equal to that given
|
|
func (o *GetTopicsUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the get topics unprocessable entity response
|
|
func (o *GetTopicsUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *GetTopicsUnprocessableEntity) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsUnprocessableEntity %s", 422, payload)
|
|
}
|
|
|
|
func (o *GetTopicsUnprocessableEntity) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsUnprocessableEntity %s", 422, payload)
|
|
}
|
|
|
|
func (o *GetTopicsUnprocessableEntity) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTopicsUnprocessableEntity) 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 && !stderrors.Is(err, io.EOF) {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetTopicsInternalServerError creates a GetTopicsInternalServerError with default headers values
|
|
func NewGetTopicsInternalServerError() *GetTopicsInternalServerError {
|
|
return &GetTopicsInternalServerError{}
|
|
}
|
|
|
|
// GetTopicsInternalServerError describes a response with status code 500, with default header values.
|
|
//
|
|
// Server Internal Error
|
|
type GetTopicsInternalServerError struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *research_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this get topics internal server error response has a 2xx status code
|
|
func (o *GetTopicsInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this get topics internal server error response has a 3xx status code
|
|
func (o *GetTopicsInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this get topics internal server error response has a 4xx status code
|
|
func (o *GetTopicsInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this get topics internal server error response has a 5xx status code
|
|
func (o *GetTopicsInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this get topics internal server error response a status code equal to that given
|
|
func (o *GetTopicsInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the get topics internal server error response
|
|
func (o *GetTopicsInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *GetTopicsInternalServerError) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsInternalServerError %s", 500, payload)
|
|
}
|
|
|
|
func (o *GetTopicsInternalServerError) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[GET /topics][%d] getTopicsInternalServerError %s", 500, payload)
|
|
}
|
|
|
|
func (o *GetTopicsInternalServerError) GetPayload() *research_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *GetTopicsInternalServerError) 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 && !stderrors.Is(err, io.EOF) {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|