lib/api/research/research_client/topic/get_topics_observable_respo...

538 lines
17 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
// GetTopicsObservableReader is a Reader for the GetTopicsObservable structure.
type GetTopicsObservableReader 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 *GetTopicsObservableReader) 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 := NewGetTopicsObservableOK()
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 := NewGetTopicsObservableUnauthorized()
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 := NewGetTopicsObservableForbidden()
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 := NewGetTopicsObservableNotFound()
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 := NewGetTopicsObservableUnprocessableEntity()
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 := NewGetTopicsObservableInternalServerError()
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
// NewGetTopicsObservableOK creates a GetTopicsObservableOK with default headers values
func NewGetTopicsObservableOK() *GetTopicsObservableOK {
return &GetTopicsObservableOK{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
GetTopicsObservableOK 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 an array of Topic objects
2022-09-05 00:01:32 +00:00
*/
2022-09-07 00:16:25 +00:00
type GetTopicsObservableOK struct {
2022-09-05 00:01:32 +00:00
AccessControlAllowOrigin string
CacheControl string
2022-09-07 00:16:25 +00:00
Payload []*research_models.Topic
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
// IsSuccess returns true when this get topics observable o k response has a 2xx status code
func (o *GetTopicsObservableOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get topics observable o k response has a 3xx status code
func (o *GetTopicsObservableOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get topics observable o k response has a 4xx status code
func (o *GetTopicsObservableOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get topics observable o k response has a 5xx status code
func (o *GetTopicsObservableOK) IsServerError() bool {
return false
}
// IsCode returns true when this get topics observable o k response a status code equal to that given
func (o *GetTopicsObservableOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get topics observable o k response
func (o *GetTopicsObservableOK) Code() int {
return 200
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableOK) Error() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableOK %+v", 200, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTopicsObservableOK) String() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableOK %+v", 200, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableOK) GetPayload() []*research_models.Topic {
2022-09-05 00:01:32 +00:00
return o.Payload
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableOK) 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
}
// response payload
2022-09-07 00:16:25 +00:00
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
2022-09-05 00:01:32 +00:00
return err
}
return nil
}
2022-09-07 00:16:25 +00:00
// NewGetTopicsObservableUnauthorized creates a GetTopicsObservableUnauthorized with default headers values
func NewGetTopicsObservableUnauthorized() *GetTopicsObservableUnauthorized {
return &GetTopicsObservableUnauthorized{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
GetTopicsObservableUnauthorized 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 GetTopicsObservableUnauthorized 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 get topics observable unauthorized response has a 2xx status code
func (o *GetTopicsObservableUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get topics observable unauthorized response has a 3xx status code
func (o *GetTopicsObservableUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get topics observable unauthorized response has a 4xx status code
func (o *GetTopicsObservableUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get topics observable unauthorized response has a 5xx status code
func (o *GetTopicsObservableUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get topics observable unauthorized response a status code equal to that given
func (o *GetTopicsObservableUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get topics observable unauthorized response
func (o *GetTopicsObservableUnauthorized) Code() int {
return 401
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableUnauthorized) Error() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableUnauthorized %+v", 401, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTopicsObservableUnauthorized) String() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableUnauthorized %+v", 401, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableUnauthorized) 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 *GetTopicsObservableUnauthorized) 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
// NewGetTopicsObservableForbidden creates a GetTopicsObservableForbidden with default headers values
func NewGetTopicsObservableForbidden() *GetTopicsObservableForbidden {
return &GetTopicsObservableForbidden{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
GetTopicsObservableForbidden 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 GetTopicsObservableForbidden 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 get topics observable forbidden response has a 2xx status code
func (o *GetTopicsObservableForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get topics observable forbidden response has a 3xx status code
func (o *GetTopicsObservableForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get topics observable forbidden response has a 4xx status code
func (o *GetTopicsObservableForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get topics observable forbidden response has a 5xx status code
func (o *GetTopicsObservableForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get topics observable forbidden response a status code equal to that given
func (o *GetTopicsObservableForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get topics observable forbidden response
func (o *GetTopicsObservableForbidden) Code() int {
return 403
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableForbidden) Error() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableForbidden %+v", 403, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTopicsObservableForbidden) String() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableForbidden %+v", 403, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableForbidden) 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 *GetTopicsObservableForbidden) 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
// NewGetTopicsObservableNotFound creates a GetTopicsObservableNotFound with default headers values
func NewGetTopicsObservableNotFound() *GetTopicsObservableNotFound {
return &GetTopicsObservableNotFound{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
GetTopicsObservableNotFound 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 GetTopicsObservableNotFound 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 get topics observable not found response has a 2xx status code
func (o *GetTopicsObservableNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get topics observable not found response has a 3xx status code
func (o *GetTopicsObservableNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get topics observable not found response has a 4xx status code
func (o *GetTopicsObservableNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get topics observable not found response has a 5xx status code
func (o *GetTopicsObservableNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get topics observable not found response a status code equal to that given
func (o *GetTopicsObservableNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get topics observable not found response
func (o *GetTopicsObservableNotFound) Code() int {
return 404
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableNotFound) Error() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableNotFound %+v", 404, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTopicsObservableNotFound) String() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableNotFound %+v", 404, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableNotFound) 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 *GetTopicsObservableNotFound) 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
// NewGetTopicsObservableUnprocessableEntity creates a GetTopicsObservableUnprocessableEntity with default headers values
func NewGetTopicsObservableUnprocessableEntity() *GetTopicsObservableUnprocessableEntity {
return &GetTopicsObservableUnprocessableEntity{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
GetTopicsObservableUnprocessableEntity 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 GetTopicsObservableUnprocessableEntity 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 get topics observable unprocessable entity response has a 2xx status code
func (o *GetTopicsObservableUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get topics observable unprocessable entity response has a 3xx status code
func (o *GetTopicsObservableUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get topics observable unprocessable entity response has a 4xx status code
func (o *GetTopicsObservableUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get topics observable unprocessable entity response has a 5xx status code
func (o *GetTopicsObservableUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get topics observable unprocessable entity response a status code equal to that given
func (o *GetTopicsObservableUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get topics observable unprocessable entity response
func (o *GetTopicsObservableUnprocessableEntity) Code() int {
return 422
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableUnprocessableEntity %+v", 422, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTopicsObservableUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableUnprocessableEntity %+v", 422, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableUnprocessableEntity) 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 *GetTopicsObservableUnprocessableEntity) 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
// NewGetTopicsObservableInternalServerError creates a GetTopicsObservableInternalServerError with default headers values
func NewGetTopicsObservableInternalServerError() *GetTopicsObservableInternalServerError {
return &GetTopicsObservableInternalServerError{}
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
/*
GetTopicsObservableInternalServerError 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 GetTopicsObservableInternalServerError 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 get topics observable internal server error response has a 2xx status code
func (o *GetTopicsObservableInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get topics observable internal server error response has a 3xx status code
func (o *GetTopicsObservableInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get topics observable internal server error response has a 4xx status code
func (o *GetTopicsObservableInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get topics observable internal server error response has a 5xx status code
func (o *GetTopicsObservableInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get topics observable internal server error response a status code equal to that given
func (o *GetTopicsObservableInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get topics observable internal server error response
func (o *GetTopicsObservableInternalServerError) Code() int {
return 500
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableInternalServerError) Error() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableInternalServerError %+v", 500, o.Payload)
2022-09-05 00:01:32 +00:00
}
2023-03-22 20:49:01 +00:00
func (o *GetTopicsObservableInternalServerError) String() string {
return fmt.Sprintf("[GET /topics/observable][%d] getTopicsObservableInternalServerError %+v", 500, o.Payload)
}
2022-09-07 00:16:25 +00:00
func (o *GetTopicsObservableInternalServerError) 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 *GetTopicsObservableInternalServerError) 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
}