147 lines
3.8 KiB
Go
147 lines
3.8 KiB
Go
|
// Code generated by go-swagger; DO NOT EDIT.
|
||
|
|
||
|
package operations
|
||
|
|
||
|
// This file was generated by the swagger tool.
|
||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/go-openapi/runtime"
|
||
|
|
||
|
models "github.com/elfsternberg/timeofday/models"
|
||
|
)
|
||
|
|
||
|
// ClockPostOKCode is the HTTP code returned for type ClockPostOK
|
||
|
const ClockPostOKCode int = 200
|
||
|
|
||
|
/*ClockPostOK Returns the time of day.
|
||
|
|
||
|
swagger:response clockPostOK
|
||
|
*/
|
||
|
type ClockPostOK struct {
|
||
|
|
||
|
/*
|
||
|
In: Body
|
||
|
*/
|
||
|
Payload *models.Timeofday `json:"body,omitempty"`
|
||
|
}
|
||
|
|
||
|
// NewClockPostOK creates ClockPostOK with default headers values
|
||
|
func NewClockPostOK() *ClockPostOK {
|
||
|
|
||
|
return &ClockPostOK{}
|
||
|
}
|
||
|
|
||
|
// WithPayload adds the payload to the clock post o k response
|
||
|
func (o *ClockPostOK) WithPayload(payload *models.Timeofday) *ClockPostOK {
|
||
|
o.Payload = payload
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetPayload sets the payload to the clock post o k response
|
||
|
func (o *ClockPostOK) SetPayload(payload *models.Timeofday) {
|
||
|
o.Payload = payload
|
||
|
}
|
||
|
|
||
|
// WriteResponse to the client
|
||
|
func (o *ClockPostOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||
|
|
||
|
rw.WriteHeader(200)
|
||
|
if o.Payload != nil {
|
||
|
payload := o.Payload
|
||
|
if err := producer.Produce(rw, payload); err != nil {
|
||
|
panic(err) // let the recovery middleware deal with this
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// ClockPostNotFoundCode is the HTTP code returned for type ClockPostNotFound
|
||
|
const ClockPostNotFoundCode int = 404
|
||
|
|
||
|
/*ClockPostNotFound Time zone not found
|
||
|
|
||
|
swagger:response clockPostNotFound
|
||
|
*/
|
||
|
type ClockPostNotFound struct {
|
||
|
|
||
|
/*
|
||
|
In: Body
|
||
|
*/
|
||
|
Payload *models.ErrorResponse `json:"body,omitempty"`
|
||
|
}
|
||
|
|
||
|
// NewClockPostNotFound creates ClockPostNotFound with default headers values
|
||
|
func NewClockPostNotFound() *ClockPostNotFound {
|
||
|
|
||
|
return &ClockPostNotFound{}
|
||
|
}
|
||
|
|
||
|
// WithPayload adds the payload to the clock post not found response
|
||
|
func (o *ClockPostNotFound) WithPayload(payload *models.ErrorResponse) *ClockPostNotFound {
|
||
|
o.Payload = payload
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetPayload sets the payload to the clock post not found response
|
||
|
func (o *ClockPostNotFound) SetPayload(payload *models.ErrorResponse) {
|
||
|
o.Payload = payload
|
||
|
}
|
||
|
|
||
|
// WriteResponse to the client
|
||
|
func (o *ClockPostNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||
|
|
||
|
rw.WriteHeader(404)
|
||
|
if o.Payload != nil {
|
||
|
payload := o.Payload
|
||
|
if err := producer.Produce(rw, payload); err != nil {
|
||
|
panic(err) // let the recovery middleware deal with this
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// ClockPostInternalServerErrorCode is the HTTP code returned for type ClockPostInternalServerError
|
||
|
const ClockPostInternalServerErrorCode int = 500
|
||
|
|
||
|
/*ClockPostInternalServerError Something has gone horribly wrong
|
||
|
|
||
|
swagger:response clockPostInternalServerError
|
||
|
*/
|
||
|
type ClockPostInternalServerError struct {
|
||
|
|
||
|
/*
|
||
|
In: Body
|
||
|
*/
|
||
|
Payload *models.ErrorResponse `json:"body,omitempty"`
|
||
|
}
|
||
|
|
||
|
// NewClockPostInternalServerError creates ClockPostInternalServerError with default headers values
|
||
|
func NewClockPostInternalServerError() *ClockPostInternalServerError {
|
||
|
|
||
|
return &ClockPostInternalServerError{}
|
||
|
}
|
||
|
|
||
|
// WithPayload adds the payload to the clock post internal server error response
|
||
|
func (o *ClockPostInternalServerError) WithPayload(payload *models.ErrorResponse) *ClockPostInternalServerError {
|
||
|
o.Payload = payload
|
||
|
return o
|
||
|
}
|
||
|
|
||
|
// SetPayload sets the payload to the clock post internal server error response
|
||
|
func (o *ClockPostInternalServerError) SetPayload(payload *models.ErrorResponse) {
|
||
|
o.Payload = payload
|
||
|
}
|
||
|
|
||
|
// WriteResponse to the client
|
||
|
func (o *ClockPostInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||
|
|
||
|
rw.WriteHeader(500)
|
||
|
if o.Payload != nil {
|
||
|
payload := o.Payload
|
||
|
if err := producer.Produce(rw, payload); err != nil {
|
||
|
panic(err) // let the recovery middleware deal with this
|
||
|
}
|
||
|
}
|
||
|
}
|