lib/api/sfgate/sfgate_client/events/get_events_responses.go

478 lines
14 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package events
// 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/work/lib/api/sfgate/sfgate_models"
)
// GetEventsReader is a Reader for the GetEvents structure.
type GetEventsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetEventsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetEventsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetEventsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetEventsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewGetEventsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetEventsInternalServerError()
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())
}
}
// NewGetEventsOK creates a GetEventsOK with default headers values
func NewGetEventsOK() *GetEventsOK {
return &GetEventsOK{}
}
/*
GetEventsOK describes a response with status code 200, with default header values.
Event Response Object
*/
type GetEventsOK struct {
Payload *sfgate_models.EventResponse
}
// IsSuccess returns true when this get events o k response has a 2xx status code
func (o *GetEventsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this get events o k response has a 3xx status code
func (o *GetEventsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this get events o k response has a 4xx status code
func (o *GetEventsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this get events o k response has a 5xx status code
func (o *GetEventsOK) IsServerError() bool {
return false
}
// IsCode returns true when this get events o k response a status code equal to that given
func (o *GetEventsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the get events o k response
func (o *GetEventsOK) Code() int {
return 200
}
func (o *GetEventsOK) Error() string {
return fmt.Sprintf("[GET /events][%d] getEventsOK %+v", 200, o.Payload)
}
func (o *GetEventsOK) String() string {
return fmt.Sprintf("[GET /events][%d] getEventsOK %+v", 200, o.Payload)
}
func (o *GetEventsOK) GetPayload() *sfgate_models.EventResponse {
return o.Payload
}
func (o *GetEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.EventResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEventsUnauthorized creates a GetEventsUnauthorized with default headers values
func NewGetEventsUnauthorized() *GetEventsUnauthorized {
return &GetEventsUnauthorized{}
}
/*
GetEventsUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type GetEventsUnauthorized struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get events unauthorized response has a 2xx status code
func (o *GetEventsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get events unauthorized response has a 3xx status code
func (o *GetEventsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this get events unauthorized response has a 4xx status code
func (o *GetEventsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this get events unauthorized response has a 5xx status code
func (o *GetEventsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this get events unauthorized response a status code equal to that given
func (o *GetEventsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the get events unauthorized response
func (o *GetEventsUnauthorized) Code() int {
return 401
}
func (o *GetEventsUnauthorized) Error() string {
return fmt.Sprintf("[GET /events][%d] getEventsUnauthorized %+v", 401, o.Payload)
}
func (o *GetEventsUnauthorized) String() string {
return fmt.Sprintf("[GET /events][%d] getEventsUnauthorized %+v", 401, o.Payload)
}
func (o *GetEventsUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetEventsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEventsForbidden creates a GetEventsForbidden with default headers values
func NewGetEventsForbidden() *GetEventsForbidden {
return &GetEventsForbidden{}
}
/*
GetEventsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type GetEventsForbidden struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get events forbidden response has a 2xx status code
func (o *GetEventsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get events forbidden response has a 3xx status code
func (o *GetEventsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this get events forbidden response has a 4xx status code
func (o *GetEventsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this get events forbidden response has a 5xx status code
func (o *GetEventsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this get events forbidden response a status code equal to that given
func (o *GetEventsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the get events forbidden response
func (o *GetEventsForbidden) Code() int {
return 403
}
func (o *GetEventsForbidden) Error() string {
return fmt.Sprintf("[GET /events][%d] getEventsForbidden %+v", 403, o.Payload)
}
func (o *GetEventsForbidden) String() string {
return fmt.Sprintf("[GET /events][%d] getEventsForbidden %+v", 403, o.Payload)
}
func (o *GetEventsForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetEventsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEventsNotFound creates a GetEventsNotFound with default headers values
func NewGetEventsNotFound() *GetEventsNotFound {
return &GetEventsNotFound{}
}
/*
GetEventsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type GetEventsNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get events not found response has a 2xx status code
func (o *GetEventsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get events not found response has a 3xx status code
func (o *GetEventsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this get events not found response has a 4xx status code
func (o *GetEventsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this get events not found response has a 5xx status code
func (o *GetEventsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this get events not found response a status code equal to that given
func (o *GetEventsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the get events not found response
func (o *GetEventsNotFound) Code() int {
return 404
}
func (o *GetEventsNotFound) Error() string {
return fmt.Sprintf("[GET /events][%d] getEventsNotFound %+v", 404, o.Payload)
}
func (o *GetEventsNotFound) String() string {
return fmt.Sprintf("[GET /events][%d] getEventsNotFound %+v", 404, o.Payload)
}
func (o *GetEventsNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetEventsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEventsUnprocessableEntity creates a GetEventsUnprocessableEntity with default headers values
func NewGetEventsUnprocessableEntity() *GetEventsUnprocessableEntity {
return &GetEventsUnprocessableEntity{}
}
/*
GetEventsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type GetEventsUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get events unprocessable entity response has a 2xx status code
func (o *GetEventsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get events unprocessable entity response has a 3xx status code
func (o *GetEventsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this get events unprocessable entity response has a 4xx status code
func (o *GetEventsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this get events unprocessable entity response has a 5xx status code
func (o *GetEventsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this get events unprocessable entity response a status code equal to that given
func (o *GetEventsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the get events unprocessable entity response
func (o *GetEventsUnprocessableEntity) Code() int {
return 422
}
func (o *GetEventsUnprocessableEntity) Error() string {
return fmt.Sprintf("[GET /events][%d] getEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetEventsUnprocessableEntity) String() string {
return fmt.Sprintf("[GET /events][%d] getEventsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *GetEventsUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetEventsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetEventsInternalServerError creates a GetEventsInternalServerError with default headers values
func NewGetEventsInternalServerError() *GetEventsInternalServerError {
return &GetEventsInternalServerError{}
}
/*
GetEventsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type GetEventsInternalServerError struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this get events internal server error response has a 2xx status code
func (o *GetEventsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this get events internal server error response has a 3xx status code
func (o *GetEventsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this get events internal server error response has a 4xx status code
func (o *GetEventsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this get events internal server error response has a 5xx status code
func (o *GetEventsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this get events internal server error response a status code equal to that given
func (o *GetEventsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the get events internal server error response
func (o *GetEventsInternalServerError) Code() int {
return 500
}
func (o *GetEventsInternalServerError) Error() string {
return fmt.Sprintf("[GET /events][%d] getEventsInternalServerError %+v", 500, o.Payload)
}
func (o *GetEventsInternalServerError) String() string {
return fmt.Sprintf("[GET /events][%d] getEventsInternalServerError %+v", 500, o.Payload)
}
func (o *GetEventsInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *GetEventsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}