132 lines
3.4 KiB
Go
132 lines
3.4 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package authentication
|
|
|
|
// 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"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
|
|
models "src.dualinventive.com/go/authentication-service/rest/models"
|
|
)
|
|
|
|
// LogoutReader is a Reader for the Logout structure.
|
|
type LogoutReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *LogoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
|
|
case 204:
|
|
result := NewLogoutNoContent()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
|
|
case 401:
|
|
result := NewLogoutUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
case 500:
|
|
result := NewLogoutInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
default:
|
|
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewLogoutNoContent creates a LogoutNoContent with default headers values
|
|
func NewLogoutNoContent() *LogoutNoContent {
|
|
return &LogoutNoContent{}
|
|
}
|
|
|
|
/*LogoutNoContent handles this case with default header values.
|
|
|
|
Logout successful
|
|
*/
|
|
type LogoutNoContent struct {
|
|
}
|
|
|
|
func (o *LogoutNoContent) Error() string {
|
|
return fmt.Sprintf("[POST /logout][%d] logoutNoContent ", 204)
|
|
}
|
|
|
|
func (o *LogoutNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewLogoutUnauthorized creates a LogoutUnauthorized with default headers values
|
|
func NewLogoutUnauthorized() *LogoutUnauthorized {
|
|
return &LogoutUnauthorized{}
|
|
}
|
|
|
|
/*LogoutUnauthorized handles this case with default header values.
|
|
|
|
Authentication failed
|
|
*/
|
|
type LogoutUnauthorized struct {
|
|
Payload *models.ErrResponse
|
|
}
|
|
|
|
func (o *LogoutUnauthorized) Error() string {
|
|
return fmt.Sprintf("[POST /logout][%d] logoutUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *LogoutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(models.ErrResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewLogoutInternalServerError creates a LogoutInternalServerError with default headers values
|
|
func NewLogoutInternalServerError() *LogoutInternalServerError {
|
|
return &LogoutInternalServerError{}
|
|
}
|
|
|
|
/*LogoutInternalServerError handles this case with default header values.
|
|
|
|
Internal Server Error
|
|
*/
|
|
type LogoutInternalServerError struct {
|
|
Payload *models.ErrResponse
|
|
}
|
|
|
|
func (o *LogoutInternalServerError) Error() string {
|
|
return fmt.Sprintf("[POST /logout][%d] logoutInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *LogoutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(models.ErrResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|