zrok/rest_client_zrok/service/share_responses.go

280 lines
7.8 KiB
Go
Raw Normal View History

// Code generated by go-swagger; DO NOT EDIT.
package service
// 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"
)
// ShareReader is a Reader for the Share structure.
type ShareReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ShareReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewShareCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewShareUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewShareNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewShareInternalServerError()
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())
}
}
// NewShareCreated creates a ShareCreated with default headers values
func NewShareCreated() *ShareCreated {
return &ShareCreated{}
}
/*
ShareCreated describes a response with status code 201, with default header values.
service created
*/
type ShareCreated struct {
Payload *rest_model_zrok.ShareResponse
}
// IsSuccess returns true when this share created response has a 2xx status code
func (o *ShareCreated) IsSuccess() bool {
return true
}
// IsRedirect returns true when this share created response has a 3xx status code
func (o *ShareCreated) IsRedirect() bool {
return false
}
// IsClientError returns true when this share created response has a 4xx status code
func (o *ShareCreated) IsClientError() bool {
return false
}
// IsServerError returns true when this share created response has a 5xx status code
func (o *ShareCreated) IsServerError() bool {
return false
}
// IsCode returns true when this share created response a status code equal to that given
func (o *ShareCreated) IsCode(code int) bool {
return code == 201
}
func (o *ShareCreated) Error() string {
return fmt.Sprintf("[POST /share][%d] shareCreated %+v", 201, o.Payload)
}
func (o *ShareCreated) String() string {
return fmt.Sprintf("[POST /share][%d] shareCreated %+v", 201, o.Payload)
}
func (o *ShareCreated) GetPayload() *rest_model_zrok.ShareResponse {
return o.Payload
}
func (o *ShareCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(rest_model_zrok.ShareResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewShareUnauthorized creates a ShareUnauthorized with default headers values
func NewShareUnauthorized() *ShareUnauthorized {
return &ShareUnauthorized{}
}
/*
ShareUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type ShareUnauthorized struct {
}
// IsSuccess returns true when this share unauthorized response has a 2xx status code
func (o *ShareUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this share unauthorized response has a 3xx status code
func (o *ShareUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this share unauthorized response has a 4xx status code
func (o *ShareUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this share unauthorized response has a 5xx status code
func (o *ShareUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this share unauthorized response a status code equal to that given
func (o *ShareUnauthorized) IsCode(code int) bool {
return code == 401
}
func (o *ShareUnauthorized) Error() string {
return fmt.Sprintf("[POST /share][%d] shareUnauthorized ", 401)
}
func (o *ShareUnauthorized) String() string {
return fmt.Sprintf("[POST /share][%d] shareUnauthorized ", 401)
}
func (o *ShareUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewShareNotFound creates a ShareNotFound with default headers values
func NewShareNotFound() *ShareNotFound {
return &ShareNotFound{}
}
/*
ShareNotFound describes a response with status code 404, with default header values.
not found
*/
type ShareNotFound struct {
}
// IsSuccess returns true when this share not found response has a 2xx status code
func (o *ShareNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this share not found response has a 3xx status code
func (o *ShareNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this share not found response has a 4xx status code
func (o *ShareNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this share not found response has a 5xx status code
func (o *ShareNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this share not found response a status code equal to that given
func (o *ShareNotFound) IsCode(code int) bool {
return code == 404
}
func (o *ShareNotFound) Error() string {
return fmt.Sprintf("[POST /share][%d] shareNotFound ", 404)
}
func (o *ShareNotFound) String() string {
return fmt.Sprintf("[POST /share][%d] shareNotFound ", 404)
}
func (o *ShareNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewShareInternalServerError creates a ShareInternalServerError with default headers values
func NewShareInternalServerError() *ShareInternalServerError {
return &ShareInternalServerError{}
}
/*
ShareInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type ShareInternalServerError struct {
Payload rest_model_zrok.ErrorMessage
}
// IsSuccess returns true when this share internal server error response has a 2xx status code
func (o *ShareInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this share internal server error response has a 3xx status code
func (o *ShareInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this share internal server error response has a 4xx status code
func (o *ShareInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this share internal server error response has a 5xx status code
func (o *ShareInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this share internal server error response a status code equal to that given
func (o *ShareInternalServerError) IsCode(code int) bool {
return code == 500
}
func (o *ShareInternalServerError) Error() string {
return fmt.Sprintf("[POST /share][%d] shareInternalServerError %+v", 500, o.Payload)
}
func (o *ShareInternalServerError) String() string {
return fmt.Sprintf("[POST /share][%d] shareInternalServerError %+v", 500, o.Payload)
}
func (o *ShareInternalServerError) GetPayload() rest_model_zrok.ErrorMessage {
return o.Payload
}
func (o *ShareInternalServerError) 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
}