zrok/rest_client_zrok/tunnel/tunnel_responses.go
2022-07-26 15:38:35 -04:00

68 lines
1.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 (
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/openziti-test-kitchen/zrok/rest_model_zrok"
)
// TunnelReader is a Reader for the Tunnel structure.
type TunnelReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *TunnelReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewTunnelCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
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())
}
}
// NewTunnelCreated creates a TunnelCreated with default headers values
func NewTunnelCreated() *TunnelCreated {
return &TunnelCreated{}
}
/* TunnelCreated describes a response with status code 201, with default header values.
tunnel created
*/
type TunnelCreated struct {
Payload *rest_model_zrok.TunnelResponse
}
func (o *TunnelCreated) Error() string {
return fmt.Sprintf("[POST /tunnel][%d] tunnelCreated %+v", 201, o.Payload)
}
func (o *TunnelCreated) GetPayload() *rest_model_zrok.TunnelResponse {
return o.Payload
}
func (o *TunnelCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(rest_model_zrok.TunnelResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}