zrok/rest_client_zrok/identity/disable_responses.go

211 lines
6.0 KiB
Go
Raw Normal View History

// Code generated by go-swagger; DO NOT EDIT.
package identity
// 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"
)
// DisableReader is a Reader for the Disable structure.
type DisableReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DisableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDisableOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewDisableUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewDisableInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
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())
}
}
// NewDisableOK creates a DisableOK with default headers values
func NewDisableOK() *DisableOK {
return &DisableOK{}
}
/*
DisableOK describes a response with status code 200, with default header values.
environment disabled
*/
type DisableOK struct {
}
// IsSuccess returns true when this disable o k response has a 2xx status code
func (o *DisableOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this disable o k response has a 3xx status code
func (o *DisableOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this disable o k response has a 4xx status code
func (o *DisableOK) IsClientError() bool {
return false
}
// IsServerError returns true when this disable o k response has a 5xx status code
func (o *DisableOK) IsServerError() bool {
return false
}
// IsCode returns true when this disable o k response a status code equal to that given
func (o *DisableOK) IsCode(code int) bool {
return code == 200
}
func (o *DisableOK) Error() string {
return fmt.Sprintf("[POST /disable][%d] disableOK ", 200)
}
func (o *DisableOK) String() string {
return fmt.Sprintf("[POST /disable][%d] disableOK ", 200)
}
func (o *DisableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewDisableUnauthorized creates a DisableUnauthorized with default headers values
func NewDisableUnauthorized() *DisableUnauthorized {
return &DisableUnauthorized{}
}
/*
DisableUnauthorized describes a response with status code 401, with default header values.
invalid environment
*/
type DisableUnauthorized struct {
}
// IsSuccess returns true when this disable unauthorized response has a 2xx status code
func (o *DisableUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this disable unauthorized response has a 3xx status code
func (o *DisableUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this disable unauthorized response has a 4xx status code
func (o *DisableUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this disable unauthorized response has a 5xx status code
func (o *DisableUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this disable unauthorized response a status code equal to that given
func (o *DisableUnauthorized) IsCode(code int) bool {
return code == 401
}
func (o *DisableUnauthorized) Error() string {
return fmt.Sprintf("[POST /disable][%d] disableUnauthorized ", 401)
}
func (o *DisableUnauthorized) String() string {
return fmt.Sprintf("[POST /disable][%d] disableUnauthorized ", 401)
}
func (o *DisableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewDisableInternalServerError creates a DisableInternalServerError with default headers values
func NewDisableInternalServerError() *DisableInternalServerError {
return &DisableInternalServerError{}
}
/*
DisableInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type DisableInternalServerError struct {
Payload rest_model_zrok.ErrorMessage
}
// IsSuccess returns true when this disable internal server error response has a 2xx status code
func (o *DisableInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this disable internal server error response has a 3xx status code
func (o *DisableInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this disable internal server error response has a 4xx status code
func (o *DisableInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this disable internal server error response has a 5xx status code
func (o *DisableInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this disable internal server error response a status code equal to that given
func (o *DisableInternalServerError) IsCode(code int) bool {
return code == 500
}
func (o *DisableInternalServerError) Error() string {
return fmt.Sprintf("[POST /disable][%d] disableInternalServerError %+v", 500, o.Payload)
}
func (o *DisableInternalServerError) String() string {
return fmt.Sprintf("[POST /disable][%d] disableInternalServerError %+v", 500, o.Payload)
}
func (o *DisableInternalServerError) GetPayload() rest_model_zrok.ErrorMessage {
return o.Payload
}
func (o *DisableInternalServerError) 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
}