gtslib/client/timelines/public_timeline_responses.go
decentral1se e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
feat: init
2024-07-31 22:47:18 +02:00

241 lines
7.0 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package timelines
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// PublicTimelineReader is a Reader for the PublicTimeline structure.
type PublicTimelineReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PublicTimelineReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPublicTimelineOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewPublicTimelineBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewPublicTimelineUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /api/v1/timelines/public] publicTimeline", response, response.Code())
}
}
// NewPublicTimelineOK creates a PublicTimelineOK with default headers values
func NewPublicTimelineOK() *PublicTimelineOK {
return &PublicTimelineOK{}
}
/*
PublicTimelineOK describes a response with status code 200, with default header values.
Array of statuses.
*/
type PublicTimelineOK struct {
/* Links to the next and previous queries.
*/
Link string
Payload []*models.Status
}
// IsSuccess returns true when this public timeline o k response has a 2xx status code
func (o *PublicTimelineOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this public timeline o k response has a 3xx status code
func (o *PublicTimelineOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this public timeline o k response has a 4xx status code
func (o *PublicTimelineOK) IsClientError() bool {
return false
}
// IsServerError returns true when this public timeline o k response has a 5xx status code
func (o *PublicTimelineOK) IsServerError() bool {
return false
}
// IsCode returns true when this public timeline o k response a status code equal to that given
func (o *PublicTimelineOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the public timeline o k response
func (o *PublicTimelineOK) Code() int {
return 200
}
func (o *PublicTimelineOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/timelines/public][%d] publicTimelineOK %s", 200, payload)
}
func (o *PublicTimelineOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/timelines/public][%d] publicTimelineOK %s", 200, payload)
}
func (o *PublicTimelineOK) GetPayload() []*models.Status {
return o.Payload
}
func (o *PublicTimelineOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Link
hdrLink := response.GetHeader("Link")
if hdrLink != "" {
o.Link = hdrLink
}
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPublicTimelineBadRequest creates a PublicTimelineBadRequest with default headers values
func NewPublicTimelineBadRequest() *PublicTimelineBadRequest {
return &PublicTimelineBadRequest{}
}
/*
PublicTimelineBadRequest describes a response with status code 400, with default header values.
bad request
*/
type PublicTimelineBadRequest struct {
}
// IsSuccess returns true when this public timeline bad request response has a 2xx status code
func (o *PublicTimelineBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this public timeline bad request response has a 3xx status code
func (o *PublicTimelineBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this public timeline bad request response has a 4xx status code
func (o *PublicTimelineBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this public timeline bad request response has a 5xx status code
func (o *PublicTimelineBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this public timeline bad request response a status code equal to that given
func (o *PublicTimelineBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the public timeline bad request response
func (o *PublicTimelineBadRequest) Code() int {
return 400
}
func (o *PublicTimelineBadRequest) Error() string {
return fmt.Sprintf("[GET /api/v1/timelines/public][%d] publicTimelineBadRequest", 400)
}
func (o *PublicTimelineBadRequest) String() string {
return fmt.Sprintf("[GET /api/v1/timelines/public][%d] publicTimelineBadRequest", 400)
}
func (o *PublicTimelineBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewPublicTimelineUnauthorized creates a PublicTimelineUnauthorized with default headers values
func NewPublicTimelineUnauthorized() *PublicTimelineUnauthorized {
return &PublicTimelineUnauthorized{}
}
/*
PublicTimelineUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type PublicTimelineUnauthorized struct {
}
// IsSuccess returns true when this public timeline unauthorized response has a 2xx status code
func (o *PublicTimelineUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this public timeline unauthorized response has a 3xx status code
func (o *PublicTimelineUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this public timeline unauthorized response has a 4xx status code
func (o *PublicTimelineUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this public timeline unauthorized response has a 5xx status code
func (o *PublicTimelineUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this public timeline unauthorized response a status code equal to that given
func (o *PublicTimelineUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the public timeline unauthorized response
func (o *PublicTimelineUnauthorized) Code() int {
return 401
}
func (o *PublicTimelineUnauthorized) Error() string {
return fmt.Sprintf("[GET /api/v1/timelines/public][%d] publicTimelineUnauthorized", 401)
}
func (o *PublicTimelineUnauthorized) String() string {
return fmt.Sprintf("[GET /api/v1/timelines/public][%d] publicTimelineUnauthorized", 401)
}
func (o *PublicTimelineUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}