// Code generated by go-swagger; DO NOT EDIT. // (c) 2012-2020 by Taxnexus, Inc. // All rights reserved worldwide. // Proprietary product; unlicensed use is not allowed package sessions // 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" "code.tnxs.net/vernonkeenan/lib/api/members/members_models" ) // DeleteSessionReader is a Reader for the DeleteSession structure. type DeleteSessionReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *DeleteSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 204: result := NewDeleteSessionNoContent() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewDeleteSessionUnauthorized() 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()) } } // NewDeleteSessionNoContent creates a DeleteSessionNoContent with default headers values func NewDeleteSessionNoContent() *DeleteSessionNoContent { return &DeleteSessionNoContent{} } /* DeleteSessionNoContent describes a response with status code 204, with default header values. Logged out; kvSession cookie cleared */ type DeleteSessionNoContent struct { } // IsSuccess returns true when this delete session no content response has a 2xx status code func (o *DeleteSessionNoContent) IsSuccess() bool { return true } // IsRedirect returns true when this delete session no content response has a 3xx status code func (o *DeleteSessionNoContent) IsRedirect() bool { return false } // IsClientError returns true when this delete session no content response has a 4xx status code func (o *DeleteSessionNoContent) IsClientError() bool { return false } // IsServerError returns true when this delete session no content response has a 5xx status code func (o *DeleteSessionNoContent) IsServerError() bool { return false } // IsCode returns true when this delete session no content response a status code equal to that given func (o *DeleteSessionNoContent) IsCode(code int) bool { return code == 204 } // Code gets the status code for the delete session no content response func (o *DeleteSessionNoContent) Code() int { return 204 } func (o *DeleteSessionNoContent) Error() string { return fmt.Sprintf("[DELETE /sessions/current][%d] deleteSessionNoContent ", 204) } func (o *DeleteSessionNoContent) String() string { return fmt.Sprintf("[DELETE /sessions/current][%d] deleteSessionNoContent ", 204) } func (o *DeleteSessionNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewDeleteSessionUnauthorized creates a DeleteSessionUnauthorized with default headers values func NewDeleteSessionUnauthorized() *DeleteSessionUnauthorized { return &DeleteSessionUnauthorized{} } /* DeleteSessionUnauthorized describes a response with status code 401, with default header values. Access Unauthorized, invalid API-KEY was used */ type DeleteSessionUnauthorized struct { Payload *members_models.Error } // IsSuccess returns true when this delete session unauthorized response has a 2xx status code func (o *DeleteSessionUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this delete session unauthorized response has a 3xx status code func (o *DeleteSessionUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this delete session unauthorized response has a 4xx status code func (o *DeleteSessionUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this delete session unauthorized response has a 5xx status code func (o *DeleteSessionUnauthorized) IsServerError() bool { return false } // IsCode returns true when this delete session unauthorized response a status code equal to that given func (o *DeleteSessionUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the delete session unauthorized response func (o *DeleteSessionUnauthorized) Code() int { return 401 } func (o *DeleteSessionUnauthorized) Error() string { return fmt.Sprintf("[DELETE /sessions/current][%d] deleteSessionUnauthorized %+v", 401, o.Payload) } func (o *DeleteSessionUnauthorized) String() string { return fmt.Sprintf("[DELETE /sessions/current][%d] deleteSessionUnauthorized %+v", 401, o.Payload) } func (o *DeleteSessionUnauthorized) GetPayload() *members_models.Error { return o.Payload } func (o *DeleteSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(members_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }