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 (
"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
2022-08-01 21:44:26 +02:00
case 401 :
result := NewTunnelUnauthorized ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
2022-07-27 19:17:47 +02:00
case 500 :
result := NewTunnelInternalServerError ( )
if err := result . readResponse ( response , consumer , o . formats ) ; err != nil {
return nil , err
}
return nil , result
2022-07-26 21:38:35 +02:00
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 { }
}
2022-09-01 23:39:02 +02:00
/ *
TunnelCreated describes a response with status code 201 , with default header values .
2022-07-26 21:38:35 +02:00
tunnel created
* /
type TunnelCreated struct {
Payload * rest_model_zrok . TunnelResponse
}
2022-09-01 23:39:02 +02:00
// IsSuccess returns true when this tunnel created response has a 2xx status code
func ( o * TunnelCreated ) IsSuccess ( ) bool {
return true
}
// IsRedirect returns true when this tunnel created response has a 3xx status code
func ( o * TunnelCreated ) IsRedirect ( ) bool {
return false
}
// IsClientError returns true when this tunnel created response has a 4xx status code
func ( o * TunnelCreated ) IsClientError ( ) bool {
return false
}
// IsServerError returns true when this tunnel created response has a 5xx status code
func ( o * TunnelCreated ) IsServerError ( ) bool {
return false
}
// IsCode returns true when this tunnel created response a status code equal to that given
func ( o * TunnelCreated ) IsCode ( code int ) bool {
return code == 201
}
2022-07-26 21:38:35 +02:00
func ( o * TunnelCreated ) Error ( ) string {
return fmt . Sprintf ( "[POST /tunnel][%d] tunnelCreated %+v" , 201 , o . Payload )
}
2022-09-01 23:39:02 +02:00
func ( o * TunnelCreated ) String ( ) string {
return fmt . Sprintf ( "[POST /tunnel][%d] tunnelCreated %+v" , 201 , o . Payload )
}
2022-07-26 21:38:35 +02:00
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
}
2022-07-27 19:17:47 +02:00
2022-08-01 21:44:26 +02:00
// NewTunnelUnauthorized creates a TunnelUnauthorized with default headers values
func NewTunnelUnauthorized ( ) * TunnelUnauthorized {
return & TunnelUnauthorized { }
}
2022-09-01 23:39:02 +02:00
/ *
TunnelUnauthorized describes a response with status code 401 , with default header values .
2022-08-01 21:44:26 +02:00
invalid environment identity
* /
type TunnelUnauthorized struct {
Payload rest_model_zrok . ErrorMessage
}
2022-09-01 23:39:02 +02:00
// IsSuccess returns true when this tunnel unauthorized response has a 2xx status code
func ( o * TunnelUnauthorized ) IsSuccess ( ) bool {
return false
}
// IsRedirect returns true when this tunnel unauthorized response has a 3xx status code
func ( o * TunnelUnauthorized ) IsRedirect ( ) bool {
return false
}
// IsClientError returns true when this tunnel unauthorized response has a 4xx status code
func ( o * TunnelUnauthorized ) IsClientError ( ) bool {
return true
}
// IsServerError returns true when this tunnel unauthorized response has a 5xx status code
func ( o * TunnelUnauthorized ) IsServerError ( ) bool {
return false
}
// IsCode returns true when this tunnel unauthorized response a status code equal to that given
func ( o * TunnelUnauthorized ) IsCode ( code int ) bool {
return code == 401
}
2022-08-01 21:44:26 +02:00
func ( o * TunnelUnauthorized ) Error ( ) string {
return fmt . Sprintf ( "[POST /tunnel][%d] tunnelUnauthorized %+v" , 401 , o . Payload )
}
2022-09-01 23:39:02 +02:00
func ( o * TunnelUnauthorized ) String ( ) string {
return fmt . Sprintf ( "[POST /tunnel][%d] tunnelUnauthorized %+v" , 401 , o . Payload )
}
2022-08-01 21:44:26 +02:00
func ( o * TunnelUnauthorized ) GetPayload ( ) rest_model_zrok . ErrorMessage {
return o . Payload
}
func ( o * TunnelUnauthorized ) readResponse ( response runtime . ClientResponse , consumer runtime . Consumer , formats strfmt . Registry ) error {
// response payload
if err := consumer . Consume ( response . Body ( ) , & o . Payload ) ; err != nil && err != io . EOF {
return err
}
return nil
}
2022-07-27 19:17:47 +02:00
// NewTunnelInternalServerError creates a TunnelInternalServerError with default headers values
func NewTunnelInternalServerError ( ) * TunnelInternalServerError {
return & TunnelInternalServerError { }
}
2022-09-01 23:39:02 +02:00
/ *
TunnelInternalServerError describes a response with status code 500 , with default header values .
2022-07-27 19:17:47 +02:00
internal server error
* /
type TunnelInternalServerError struct {
2022-07-27 19:38:35 +02:00
Payload rest_model_zrok . ErrorMessage
2022-07-27 19:17:47 +02:00
}
2022-09-01 23:39:02 +02:00
// IsSuccess returns true when this tunnel internal server error response has a 2xx status code
func ( o * TunnelInternalServerError ) IsSuccess ( ) bool {
return false
}
// IsRedirect returns true when this tunnel internal server error response has a 3xx status code
func ( o * TunnelInternalServerError ) IsRedirect ( ) bool {
return false
}
// IsClientError returns true when this tunnel internal server error response has a 4xx status code
func ( o * TunnelInternalServerError ) IsClientError ( ) bool {
return false
}
// IsServerError returns true when this tunnel internal server error response has a 5xx status code
func ( o * TunnelInternalServerError ) IsServerError ( ) bool {
return true
}
// IsCode returns true when this tunnel internal server error response a status code equal to that given
func ( o * TunnelInternalServerError ) IsCode ( code int ) bool {
return code == 500
}
2022-07-27 19:17:47 +02:00
func ( o * TunnelInternalServerError ) Error ( ) string {
2022-07-27 19:38:35 +02:00
return fmt . Sprintf ( "[POST /tunnel][%d] tunnelInternalServerError %+v" , 500 , o . Payload )
}
2022-09-01 23:39:02 +02:00
func ( o * TunnelInternalServerError ) String ( ) string {
return fmt . Sprintf ( "[POST /tunnel][%d] tunnelInternalServerError %+v" , 500 , o . Payload )
}
2022-07-27 19:38:35 +02:00
func ( o * TunnelInternalServerError ) GetPayload ( ) rest_model_zrok . ErrorMessage {
return o . Payload
2022-07-27 19:17:47 +02:00
}
func ( o * TunnelInternalServerError ) readResponse ( response runtime . ClientResponse , consumer runtime . Consumer , formats strfmt . Registry ) error {
2022-07-27 19:38:35 +02:00
// response payload
if err := consumer . Consume ( response . Body ( ) , & o . Payload ) ; err != nil && err != io . EOF {
return err
}
2022-07-27 19:17:47 +02:00
return nil
}