zrok/rest_server_zrok/operations/tunnel/tunnel_responses.go

101 lines
2.6 KiB
Go
Raw Normal View History

2022-07-26 21:38:35 +02:00
// Code generated by go-swagger; DO NOT EDIT.
package tunnel
// 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"
"github.com/openziti-test-kitchen/zrok/rest_model_zrok"
)
// TunnelCreatedCode is the HTTP code returned for type TunnelCreated
const TunnelCreatedCode int = 201
/*TunnelCreated tunnel created
swagger:response tunnelCreated
*/
type TunnelCreated struct {
/*
In: Body
*/
Payload *rest_model_zrok.TunnelResponse `json:"body,omitempty"`
}
// NewTunnelCreated creates TunnelCreated with default headers values
func NewTunnelCreated() *TunnelCreated {
return &TunnelCreated{}
}
// WithPayload adds the payload to the tunnel created response
func (o *TunnelCreated) WithPayload(payload *rest_model_zrok.TunnelResponse) *TunnelCreated {
o.Payload = payload
return o
}
// SetPayload sets the payload to the tunnel created response
func (o *TunnelCreated) SetPayload(payload *rest_model_zrok.TunnelResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *TunnelCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(201)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
2022-07-27 19:17:47 +02:00
// TunnelInternalServerErrorCode is the HTTP code returned for type TunnelInternalServerError
const TunnelInternalServerErrorCode int = 500
/*TunnelInternalServerError internal server error
swagger:response tunnelInternalServerError
*/
type TunnelInternalServerError struct {
2022-07-27 19:38:35 +02:00
/*
In: Body
*/
Payload rest_model_zrok.ErrorMessage `json:"body,omitempty"`
2022-07-27 19:17:47 +02:00
}
// NewTunnelInternalServerError creates TunnelInternalServerError with default headers values
func NewTunnelInternalServerError() *TunnelInternalServerError {
return &TunnelInternalServerError{}
}
2022-07-27 19:38:35 +02:00
// WithPayload adds the payload to the tunnel internal server error response
func (o *TunnelInternalServerError) WithPayload(payload rest_model_zrok.ErrorMessage) *TunnelInternalServerError {
o.Payload = payload
return o
}
// SetPayload sets the payload to the tunnel internal server error response
func (o *TunnelInternalServerError) SetPayload(payload rest_model_zrok.ErrorMessage) {
o.Payload = payload
}
2022-07-27 19:17:47 +02:00
// WriteResponse to the client
func (o *TunnelInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(500)
2022-07-27 19:38:35 +02:00
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
2022-07-27 19:17:47 +02:00
}