All checks were successful
continuous-integration/drone/push Build is passing
479 lines
14 KiB
Go
479 lines
14 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package statuses
|
|
|
|
// 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"
|
|
)
|
|
|
|
// StatusFaveReader is a Reader for the StatusFave structure.
|
|
type StatusFaveReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *StatusFaveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewStatusFaveOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 400:
|
|
result := NewStatusFaveBadRequest()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 401:
|
|
result := NewStatusFaveUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewStatusFaveForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewStatusFaveNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 406:
|
|
result := NewStatusFaveNotAcceptable()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewStatusFaveInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
default:
|
|
return nil, runtime.NewAPIError("[POST /api/v1/statuses/{id}/favourite] statusFave", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewStatusFaveOK creates a StatusFaveOK with default headers values
|
|
func NewStatusFaveOK() *StatusFaveOK {
|
|
return &StatusFaveOK{}
|
|
}
|
|
|
|
/*
|
|
StatusFaveOK describes a response with status code 200, with default header values.
|
|
|
|
The newly faved status.
|
|
*/
|
|
type StatusFaveOK struct {
|
|
Payload *models.Status
|
|
}
|
|
|
|
// IsSuccess returns true when this status fave o k response has a 2xx status code
|
|
func (o *StatusFaveOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this status fave o k response has a 3xx status code
|
|
func (o *StatusFaveOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this status fave o k response has a 4xx status code
|
|
func (o *StatusFaveOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this status fave o k response has a 5xx status code
|
|
func (o *StatusFaveOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this status fave o k response a status code equal to that given
|
|
func (o *StatusFaveOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the status fave o k response
|
|
func (o *StatusFaveOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *StatusFaveOK) Error() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *StatusFaveOK) String() string {
|
|
payload, _ := json.Marshal(o.Payload)
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveOK %s", 200, payload)
|
|
}
|
|
|
|
func (o *StatusFaveOK) GetPayload() *models.Status {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *StatusFaveOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(models.Status)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewStatusFaveBadRequest creates a StatusFaveBadRequest with default headers values
|
|
func NewStatusFaveBadRequest() *StatusFaveBadRequest {
|
|
return &StatusFaveBadRequest{}
|
|
}
|
|
|
|
/*
|
|
StatusFaveBadRequest describes a response with status code 400, with default header values.
|
|
|
|
bad request
|
|
*/
|
|
type StatusFaveBadRequest struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this status fave bad request response has a 2xx status code
|
|
func (o *StatusFaveBadRequest) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this status fave bad request response has a 3xx status code
|
|
func (o *StatusFaveBadRequest) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this status fave bad request response has a 4xx status code
|
|
func (o *StatusFaveBadRequest) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this status fave bad request response has a 5xx status code
|
|
func (o *StatusFaveBadRequest) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this status fave bad request response a status code equal to that given
|
|
func (o *StatusFaveBadRequest) IsCode(code int) bool {
|
|
return code == 400
|
|
}
|
|
|
|
// Code gets the status code for the status fave bad request response
|
|
func (o *StatusFaveBadRequest) Code() int {
|
|
return 400
|
|
}
|
|
|
|
func (o *StatusFaveBadRequest) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveBadRequest", 400)
|
|
}
|
|
|
|
func (o *StatusFaveBadRequest) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveBadRequest", 400)
|
|
}
|
|
|
|
func (o *StatusFaveBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewStatusFaveUnauthorized creates a StatusFaveUnauthorized with default headers values
|
|
func NewStatusFaveUnauthorized() *StatusFaveUnauthorized {
|
|
return &StatusFaveUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
StatusFaveUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
unauthorized
|
|
*/
|
|
type StatusFaveUnauthorized struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this status fave unauthorized response has a 2xx status code
|
|
func (o *StatusFaveUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this status fave unauthorized response has a 3xx status code
|
|
func (o *StatusFaveUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this status fave unauthorized response has a 4xx status code
|
|
func (o *StatusFaveUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this status fave unauthorized response has a 5xx status code
|
|
func (o *StatusFaveUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this status fave unauthorized response a status code equal to that given
|
|
func (o *StatusFaveUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the status fave unauthorized response
|
|
func (o *StatusFaveUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *StatusFaveUnauthorized) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveUnauthorized", 401)
|
|
}
|
|
|
|
func (o *StatusFaveUnauthorized) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveUnauthorized", 401)
|
|
}
|
|
|
|
func (o *StatusFaveUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewStatusFaveForbidden creates a StatusFaveForbidden with default headers values
|
|
func NewStatusFaveForbidden() *StatusFaveForbidden {
|
|
return &StatusFaveForbidden{}
|
|
}
|
|
|
|
/*
|
|
StatusFaveForbidden describes a response with status code 403, with default header values.
|
|
|
|
forbidden
|
|
*/
|
|
type StatusFaveForbidden struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this status fave forbidden response has a 2xx status code
|
|
func (o *StatusFaveForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this status fave forbidden response has a 3xx status code
|
|
func (o *StatusFaveForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this status fave forbidden response has a 4xx status code
|
|
func (o *StatusFaveForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this status fave forbidden response has a 5xx status code
|
|
func (o *StatusFaveForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this status fave forbidden response a status code equal to that given
|
|
func (o *StatusFaveForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the status fave forbidden response
|
|
func (o *StatusFaveForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *StatusFaveForbidden) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveForbidden", 403)
|
|
}
|
|
|
|
func (o *StatusFaveForbidden) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveForbidden", 403)
|
|
}
|
|
|
|
func (o *StatusFaveForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewStatusFaveNotFound creates a StatusFaveNotFound with default headers values
|
|
func NewStatusFaveNotFound() *StatusFaveNotFound {
|
|
return &StatusFaveNotFound{}
|
|
}
|
|
|
|
/*
|
|
StatusFaveNotFound describes a response with status code 404, with default header values.
|
|
|
|
not found
|
|
*/
|
|
type StatusFaveNotFound struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this status fave not found response has a 2xx status code
|
|
func (o *StatusFaveNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this status fave not found response has a 3xx status code
|
|
func (o *StatusFaveNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this status fave not found response has a 4xx status code
|
|
func (o *StatusFaveNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this status fave not found response has a 5xx status code
|
|
func (o *StatusFaveNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this status fave not found response a status code equal to that given
|
|
func (o *StatusFaveNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the status fave not found response
|
|
func (o *StatusFaveNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *StatusFaveNotFound) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveNotFound", 404)
|
|
}
|
|
|
|
func (o *StatusFaveNotFound) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveNotFound", 404)
|
|
}
|
|
|
|
func (o *StatusFaveNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewStatusFaveNotAcceptable creates a StatusFaveNotAcceptable with default headers values
|
|
func NewStatusFaveNotAcceptable() *StatusFaveNotAcceptable {
|
|
return &StatusFaveNotAcceptable{}
|
|
}
|
|
|
|
/*
|
|
StatusFaveNotAcceptable describes a response with status code 406, with default header values.
|
|
|
|
not acceptable
|
|
*/
|
|
type StatusFaveNotAcceptable struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this status fave not acceptable response has a 2xx status code
|
|
func (o *StatusFaveNotAcceptable) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this status fave not acceptable response has a 3xx status code
|
|
func (o *StatusFaveNotAcceptable) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this status fave not acceptable response has a 4xx status code
|
|
func (o *StatusFaveNotAcceptable) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this status fave not acceptable response has a 5xx status code
|
|
func (o *StatusFaveNotAcceptable) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this status fave not acceptable response a status code equal to that given
|
|
func (o *StatusFaveNotAcceptable) IsCode(code int) bool {
|
|
return code == 406
|
|
}
|
|
|
|
// Code gets the status code for the status fave not acceptable response
|
|
func (o *StatusFaveNotAcceptable) Code() int {
|
|
return 406
|
|
}
|
|
|
|
func (o *StatusFaveNotAcceptable) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveNotAcceptable", 406)
|
|
}
|
|
|
|
func (o *StatusFaveNotAcceptable) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveNotAcceptable", 406)
|
|
}
|
|
|
|
func (o *StatusFaveNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewStatusFaveInternalServerError creates a StatusFaveInternalServerError with default headers values
|
|
func NewStatusFaveInternalServerError() *StatusFaveInternalServerError {
|
|
return &StatusFaveInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
StatusFaveInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
internal server error
|
|
*/
|
|
type StatusFaveInternalServerError struct {
|
|
}
|
|
|
|
// IsSuccess returns true when this status fave internal server error response has a 2xx status code
|
|
func (o *StatusFaveInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this status fave internal server error response has a 3xx status code
|
|
func (o *StatusFaveInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this status fave internal server error response has a 4xx status code
|
|
func (o *StatusFaveInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this status fave internal server error response has a 5xx status code
|
|
func (o *StatusFaveInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this status fave internal server error response a status code equal to that given
|
|
func (o *StatusFaveInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the status fave internal server error response
|
|
func (o *StatusFaveInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *StatusFaveInternalServerError) Error() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveInternalServerError", 500)
|
|
}
|
|
|
|
func (o *StatusFaveInternalServerError) String() string {
|
|
return fmt.Sprintf("[POST /api/v1/statuses/{id}/favourite][%d] statusFaveInternalServerError", 500)
|
|
}
|
|
|
|
func (o *StatusFaveInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|