zrok/rest_server_zrok/operations/tunnel/untunnel_responses.go

123 lines
3.2 KiB
Go
Raw Normal View History

2022-07-27 17:35:28 +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"
2022-07-27 19:38:35 +02:00
"github.com/openziti-test-kitchen/zrok/rest_model_zrok"
2022-07-27 17:35:28 +02:00
)
// UntunnelOKCode is the HTTP code returned for type UntunnelOK
const UntunnelOKCode int = 200
/*UntunnelOK tunnel removed
swagger:response untunnelOK
*/
type UntunnelOK struct {
}
// NewUntunnelOK creates UntunnelOK with default headers values
func NewUntunnelOK() *UntunnelOK {
return &UntunnelOK{}
}
// WriteResponse to the client
func (o *UntunnelOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(200)
}
2022-08-01 21:44:26 +02:00
// UntunnelNotFoundCode is the HTTP code returned for type UntunnelNotFound
const UntunnelNotFoundCode int = 404
/*UntunnelNotFound not found
swagger:response untunnelNotFound
*/
type UntunnelNotFound struct {
/*
In: Body
*/
Payload rest_model_zrok.ErrorMessage `json:"body,omitempty"`
}
// NewUntunnelNotFound creates UntunnelNotFound with default headers values
func NewUntunnelNotFound() *UntunnelNotFound {
return &UntunnelNotFound{}
}
// WithPayload adds the payload to the untunnel not found response
func (o *UntunnelNotFound) WithPayload(payload rest_model_zrok.ErrorMessage) *UntunnelNotFound {
o.Payload = payload
return o
}
// SetPayload sets the payload to the untunnel not found response
func (o *UntunnelNotFound) SetPayload(payload rest_model_zrok.ErrorMessage) {
o.Payload = payload
}
// WriteResponse to the client
func (o *UntunnelNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(404)
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
2022-07-27 17:35:28 +02:00
// UntunnelInternalServerErrorCode is the HTTP code returned for type UntunnelInternalServerError
const UntunnelInternalServerErrorCode int = 500
/*UntunnelInternalServerError internal server error
swagger:response untunnelInternalServerError
*/
type UntunnelInternalServerError struct {
2022-07-27 19:38:35 +02:00
/*
In: Body
*/
Payload rest_model_zrok.ErrorMessage `json:"body,omitempty"`
2022-07-27 17:35:28 +02:00
}
// NewUntunnelInternalServerError creates UntunnelInternalServerError with default headers values
func NewUntunnelInternalServerError() *UntunnelInternalServerError {
return &UntunnelInternalServerError{}
}
2022-07-27 19:38:35 +02:00
// WithPayload adds the payload to the untunnel internal server error response
func (o *UntunnelInternalServerError) WithPayload(payload rest_model_zrok.ErrorMessage) *UntunnelInternalServerError {
o.Payload = payload
return o
}
// SetPayload sets the payload to the untunnel internal server error response
func (o *UntunnelInternalServerError) SetPayload(payload rest_model_zrok.ErrorMessage) {
o.Payload = payload
}
2022-07-27 17:35:28 +02:00
// WriteResponse to the client
func (o *UntunnelInternalServerError) 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 17:35:28 +02:00
}