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

540 lines
16 KiB
Go
Raw Permalink 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
// PostTopicsReader is a Reader for the PostTopics structure.
type PostTopicsReader 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 *PostTopicsReader) 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 := NewPostTopicsOK()
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 := NewPostTopicsUnauthorized()
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 := NewPostTopicsForbidden()
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 := NewPostTopicsNotFound()
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 := NewPostTopicsUnprocessableEntity()
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 := NewPostTopicsInternalServerError()
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
// NewPostTopicsOK creates a PostTopicsOK with default headers values
func NewPostTopicsOK() *PostTopicsOK {
return &PostTopicsOK{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
PostTopicsOK describes a response with status code 200, with default header values.
2022-09-05 00:01:32 +00:00
2023-03-28 17:47:34 +00:00
Response with Topic objects
2022-09-05 00:01:32 +00:00
*/
2022-09-07 00:16:25 +00:00
type PostTopicsOK 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
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post topics o k response has a 2xx status code
func (o *PostTopicsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post topics o k response has a 3xx status code
func (o *PostTopicsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post topics o k response has a 4xx status code
func (o *PostTopicsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post topics o k response has a 5xx status code
func (o *PostTopicsOK) IsServerError() bool {
return false
}
// IsCode returns true when this post topics o k response a status code equal to that given
func (o *PostTopicsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post topics o k response
func (o *PostTopicsOK) Code() int {
return 200
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsOK) Error() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsOK %+v", 200, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostTopicsOK) String() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsOK %+v", 200, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsOK) 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 *PostTopicsOK) 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
// NewPostTopicsUnauthorized creates a PostTopicsUnauthorized with default headers values
func NewPostTopicsUnauthorized() *PostTopicsUnauthorized {
return &PostTopicsUnauthorized{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
PostTopicsUnauthorized 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 PostTopicsUnauthorized struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post topics unauthorized response has a 2xx status code
func (o *PostTopicsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post topics unauthorized response has a 3xx status code
func (o *PostTopicsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post topics unauthorized response has a 4xx status code
func (o *PostTopicsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post topics unauthorized response has a 5xx status code
func (o *PostTopicsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post topics unauthorized response a status code equal to that given
func (o *PostTopicsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post topics unauthorized response
func (o *PostTopicsUnauthorized) Code() int {
return 401
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsUnauthorized) Error() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsUnauthorized %+v", 401, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostTopicsUnauthorized) String() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsUnauthorized %+v", 401, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsUnauthorized) 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 *PostTopicsUnauthorized) 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
// NewPostTopicsForbidden creates a PostTopicsForbidden with default headers values
func NewPostTopicsForbidden() *PostTopicsForbidden {
return &PostTopicsForbidden{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
PostTopicsForbidden 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 PostTopicsForbidden struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post topics forbidden response has a 2xx status code
func (o *PostTopicsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post topics forbidden response has a 3xx status code
func (o *PostTopicsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post topics forbidden response has a 4xx status code
func (o *PostTopicsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post topics forbidden response has a 5xx status code
func (o *PostTopicsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post topics forbidden response a status code equal to that given
func (o *PostTopicsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post topics forbidden response
func (o *PostTopicsForbidden) Code() int {
return 403
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsForbidden) Error() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsForbidden %+v", 403, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostTopicsForbidden) String() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsForbidden %+v", 403, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsForbidden) 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 *PostTopicsForbidden) 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
// NewPostTopicsNotFound creates a PostTopicsNotFound with default headers values
func NewPostTopicsNotFound() *PostTopicsNotFound {
return &PostTopicsNotFound{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
PostTopicsNotFound 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 PostTopicsNotFound struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post topics not found response has a 2xx status code
func (o *PostTopicsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post topics not found response has a 3xx status code
func (o *PostTopicsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post topics not found response has a 4xx status code
func (o *PostTopicsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post topics not found response has a 5xx status code
func (o *PostTopicsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post topics not found response a status code equal to that given
func (o *PostTopicsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post topics not found response
func (o *PostTopicsNotFound) Code() int {
return 404
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsNotFound) Error() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsNotFound %+v", 404, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostTopicsNotFound) String() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsNotFound %+v", 404, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsNotFound) 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 *PostTopicsNotFound) 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
// NewPostTopicsUnprocessableEntity creates a PostTopicsUnprocessableEntity with default headers values
func NewPostTopicsUnprocessableEntity() *PostTopicsUnprocessableEntity {
return &PostTopicsUnprocessableEntity{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
PostTopicsUnprocessableEntity 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 PostTopicsUnprocessableEntity struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post topics unprocessable entity response has a 2xx status code
func (o *PostTopicsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post topics unprocessable entity response has a 3xx status code
func (o *PostTopicsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post topics unprocessable entity response has a 4xx status code
func (o *PostTopicsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post topics unprocessable entity response has a 5xx status code
func (o *PostTopicsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post topics unprocessable entity response a status code equal to that given
func (o *PostTopicsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post topics unprocessable entity response
func (o *PostTopicsUnprocessableEntity) Code() int {
return 422
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsUnprocessableEntity %+v", 422, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostTopicsUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsUnprocessableEntity %+v", 422, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsUnprocessableEntity) 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 *PostTopicsUnprocessableEntity) 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
// NewPostTopicsInternalServerError creates a PostTopicsInternalServerError with default headers values
func NewPostTopicsInternalServerError() *PostTopicsInternalServerError {
return &PostTopicsInternalServerError{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
PostTopicsInternalServerError 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 PostTopicsInternalServerError struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
Payload *research_models.Error
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this post topics internal server error response has a 2xx status code
func (o *PostTopicsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post topics internal server error response has a 3xx status code
func (o *PostTopicsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post topics internal server error response has a 4xx status code
func (o *PostTopicsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post topics internal server error response has a 5xx status code
func (o *PostTopicsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post topics internal server error response a status code equal to that given
func (o *PostTopicsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post topics internal server error response
func (o *PostTopicsInternalServerError) Code() int {
return 500
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsInternalServerError) Error() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsInternalServerError %+v", 500, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *PostTopicsInternalServerError) String() string {
return fmt.Sprintf("[POST /topics][%d] postTopicsInternalServerError %+v", 500, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *PostTopicsInternalServerError) 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 *PostTopicsInternalServerError) 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
}