// Code generated by go-swagger; DO NOT EDIT. package event_management // 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" "github.com/Cyclops-Labs/cyclops-4-hpc.git/services/eventsengine/models" ) // AddEventReader is a Reader for the AddEvent structure. type AddEventReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *AddEventReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 201: result := NewAddEventCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: result := NewAddEventBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewAddEventInternalServerError() 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()) } } // NewAddEventCreated creates a AddEventCreated with default headers values func NewAddEventCreated() *AddEventCreated { return &AddEventCreated{} } /*AddEventCreated handles this case with default header values. Item added successfully */ type AddEventCreated struct { Payload *models.ItemCreatedResponse } func (o *AddEventCreated) Error() string { return fmt.Sprintf("[POST /event][%d] addEventCreated %+v", 201, o.Payload) } func (o *AddEventCreated) GetPayload() *models.ItemCreatedResponse { return o.Payload } func (o *AddEventCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.ItemCreatedResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewAddEventBadRequest creates a AddEventBadRequest with default headers values func NewAddEventBadRequest() *AddEventBadRequest { return &AddEventBadRequest{} } /*AddEventBadRequest handles this case with default header values. Invalid input, object invalid */ type AddEventBadRequest struct { } func (o *AddEventBadRequest) Error() string { return fmt.Sprintf("[POST /event][%d] addEventBadRequest ", 400) } func (o *AddEventBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewAddEventInternalServerError creates a AddEventInternalServerError with default headers values func NewAddEventInternalServerError() *AddEventInternalServerError { return &AddEventInternalServerError{} } /*AddEventInternalServerError handles this case with default header values. Something unexpected happend, error raised */ type AddEventInternalServerError struct { Payload *models.ErrorResponse } func (o *AddEventInternalServerError) Error() string { return fmt.Sprintf("[POST /event][%d] addEventInternalServerError %+v", 500, o.Payload) } func (o *AddEventInternalServerError) GetPayload() *models.ErrorResponse { return o.Payload } func (o *AddEventInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.ErrorResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }