gtslib/client/conversations/conversations_get_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

427 lines
13 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package conversations
// 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"
)
// ConversationsGetReader is a Reader for the ConversationsGet structure.
type ConversationsGetReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ConversationsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewConversationsGetOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewConversationsGetBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewConversationsGetUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewConversationsGetNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewConversationsGetNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewConversationsGetInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /api/v1/conversations] conversationsGet", response, response.Code())
}
}
// NewConversationsGetOK creates a ConversationsGetOK with default headers values
func NewConversationsGetOK() *ConversationsGetOK {
return &ConversationsGetOK{}
}
/*
ConversationsGetOK describes a response with status code 200, with default header values.
ConversationsGetOK conversations get o k
*/
type ConversationsGetOK struct {
/* Links to the next and previous queries.
*/
Link string
Payload []*models.Conversation
}
// IsSuccess returns true when this conversations get o k response has a 2xx status code
func (o *ConversationsGetOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this conversations get o k response has a 3xx status code
func (o *ConversationsGetOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this conversations get o k response has a 4xx status code
func (o *ConversationsGetOK) IsClientError() bool {
return false
}
// IsServerError returns true when this conversations get o k response has a 5xx status code
func (o *ConversationsGetOK) IsServerError() bool {
return false
}
// IsCode returns true when this conversations get o k response a status code equal to that given
func (o *ConversationsGetOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the conversations get o k response
func (o *ConversationsGetOK) Code() int {
return 200
}
func (o *ConversationsGetOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetOK %s", 200, payload)
}
func (o *ConversationsGetOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetOK %s", 200, payload)
}
func (o *ConversationsGetOK) GetPayload() []*models.Conversation {
return o.Payload
}
func (o *ConversationsGetOK) 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
}
// NewConversationsGetBadRequest creates a ConversationsGetBadRequest with default headers values
func NewConversationsGetBadRequest() *ConversationsGetBadRequest {
return &ConversationsGetBadRequest{}
}
/*
ConversationsGetBadRequest describes a response with status code 400, with default header values.
bad request
*/
type ConversationsGetBadRequest struct {
}
// IsSuccess returns true when this conversations get bad request response has a 2xx status code
func (o *ConversationsGetBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this conversations get bad request response has a 3xx status code
func (o *ConversationsGetBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this conversations get bad request response has a 4xx status code
func (o *ConversationsGetBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this conversations get bad request response has a 5xx status code
func (o *ConversationsGetBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this conversations get bad request response a status code equal to that given
func (o *ConversationsGetBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the conversations get bad request response
func (o *ConversationsGetBadRequest) Code() int {
return 400
}
func (o *ConversationsGetBadRequest) Error() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetBadRequest", 400)
}
func (o *ConversationsGetBadRequest) String() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetBadRequest", 400)
}
func (o *ConversationsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewConversationsGetUnauthorized creates a ConversationsGetUnauthorized with default headers values
func NewConversationsGetUnauthorized() *ConversationsGetUnauthorized {
return &ConversationsGetUnauthorized{}
}
/*
ConversationsGetUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type ConversationsGetUnauthorized struct {
}
// IsSuccess returns true when this conversations get unauthorized response has a 2xx status code
func (o *ConversationsGetUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this conversations get unauthorized response has a 3xx status code
func (o *ConversationsGetUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this conversations get unauthorized response has a 4xx status code
func (o *ConversationsGetUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this conversations get unauthorized response has a 5xx status code
func (o *ConversationsGetUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this conversations get unauthorized response a status code equal to that given
func (o *ConversationsGetUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the conversations get unauthorized response
func (o *ConversationsGetUnauthorized) Code() int {
return 401
}
func (o *ConversationsGetUnauthorized) Error() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetUnauthorized", 401)
}
func (o *ConversationsGetUnauthorized) String() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetUnauthorized", 401)
}
func (o *ConversationsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewConversationsGetNotFound creates a ConversationsGetNotFound with default headers values
func NewConversationsGetNotFound() *ConversationsGetNotFound {
return &ConversationsGetNotFound{}
}
/*
ConversationsGetNotFound describes a response with status code 404, with default header values.
not found
*/
type ConversationsGetNotFound struct {
}
// IsSuccess returns true when this conversations get not found response has a 2xx status code
func (o *ConversationsGetNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this conversations get not found response has a 3xx status code
func (o *ConversationsGetNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this conversations get not found response has a 4xx status code
func (o *ConversationsGetNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this conversations get not found response has a 5xx status code
func (o *ConversationsGetNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this conversations get not found response a status code equal to that given
func (o *ConversationsGetNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the conversations get not found response
func (o *ConversationsGetNotFound) Code() int {
return 404
}
func (o *ConversationsGetNotFound) Error() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetNotFound", 404)
}
func (o *ConversationsGetNotFound) String() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetNotFound", 404)
}
func (o *ConversationsGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewConversationsGetNotAcceptable creates a ConversationsGetNotAcceptable with default headers values
func NewConversationsGetNotAcceptable() *ConversationsGetNotAcceptable {
return &ConversationsGetNotAcceptable{}
}
/*
ConversationsGetNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type ConversationsGetNotAcceptable struct {
}
// IsSuccess returns true when this conversations get not acceptable response has a 2xx status code
func (o *ConversationsGetNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this conversations get not acceptable response has a 3xx status code
func (o *ConversationsGetNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this conversations get not acceptable response has a 4xx status code
func (o *ConversationsGetNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this conversations get not acceptable response has a 5xx status code
func (o *ConversationsGetNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this conversations get not acceptable response a status code equal to that given
func (o *ConversationsGetNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the conversations get not acceptable response
func (o *ConversationsGetNotAcceptable) Code() int {
return 406
}
func (o *ConversationsGetNotAcceptable) Error() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetNotAcceptable", 406)
}
func (o *ConversationsGetNotAcceptable) String() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetNotAcceptable", 406)
}
func (o *ConversationsGetNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewConversationsGetInternalServerError creates a ConversationsGetInternalServerError with default headers values
func NewConversationsGetInternalServerError() *ConversationsGetInternalServerError {
return &ConversationsGetInternalServerError{}
}
/*
ConversationsGetInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type ConversationsGetInternalServerError struct {
}
// IsSuccess returns true when this conversations get internal server error response has a 2xx status code
func (o *ConversationsGetInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this conversations get internal server error response has a 3xx status code
func (o *ConversationsGetInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this conversations get internal server error response has a 4xx status code
func (o *ConversationsGetInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this conversations get internal server error response has a 5xx status code
func (o *ConversationsGetInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this conversations get internal server error response a status code equal to that given
func (o *ConversationsGetInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the conversations get internal server error response
func (o *ConversationsGetInternalServerError) Code() int {
return 500
}
func (o *ConversationsGetInternalServerError) Error() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetInternalServerError", 500)
}
func (o *ConversationsGetInternalServerError) String() string {
return fmt.Sprintf("[GET /api/v1/conversations][%d] conversationsGetInternalServerError", 500)
}
func (o *ConversationsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}