zrok/rest_server_zrok/operations/tunnel/tunnel_responses.go
2022-09-01 17:39:02 -04:00

146 lines
3.8 KiB
Go

// 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
}
}
}
// TunnelUnauthorizedCode is the HTTP code returned for type TunnelUnauthorized
const TunnelUnauthorizedCode int = 401
/*
TunnelUnauthorized invalid environment identity
swagger:response tunnelUnauthorized
*/
type TunnelUnauthorized struct {
/*
In: Body
*/
Payload rest_model_zrok.ErrorMessage `json:"body,omitempty"`
}
// NewTunnelUnauthorized creates TunnelUnauthorized with default headers values
func NewTunnelUnauthorized() *TunnelUnauthorized {
return &TunnelUnauthorized{}
}
// WithPayload adds the payload to the tunnel unauthorized response
func (o *TunnelUnauthorized) WithPayload(payload rest_model_zrok.ErrorMessage) *TunnelUnauthorized {
o.Payload = payload
return o
}
// SetPayload sets the payload to the tunnel unauthorized response
func (o *TunnelUnauthorized) SetPayload(payload rest_model_zrok.ErrorMessage) {
o.Payload = payload
}
// WriteResponse to the client
func (o *TunnelUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(401)
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
// TunnelInternalServerErrorCode is the HTTP code returned for type TunnelInternalServerError
const TunnelInternalServerErrorCode int = 500
/*
TunnelInternalServerError internal server error
swagger:response tunnelInternalServerError
*/
type TunnelInternalServerError struct {
/*
In: Body
*/
Payload rest_model_zrok.ErrorMessage `json:"body,omitempty"`
}
// NewTunnelInternalServerError creates TunnelInternalServerError with default headers values
func NewTunnelInternalServerError() *TunnelInternalServerError {
return &TunnelInternalServerError{}
}
// 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
}
// WriteResponse to the client
func (o *TunnelInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(500)
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}