mirror of https://github.com/vernonkeenan/lib
267 lines
7.8 KiB
Go
267 lines
7.8 KiB
Go
// 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"
|
|
)
|
|
|
|
// CreateSessionReader is a Reader for the CreateSession structure.
|
|
type CreateSessionReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *CreateSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewCreateSessionOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewCreateSessionUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 429:
|
|
result := NewCreateSessionTooManyRequests()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewCreateSessionOK creates a CreateSessionOK with default headers values
|
|
func NewCreateSessionOK() *CreateSessionOK {
|
|
return &CreateSessionOK{}
|
|
}
|
|
|
|
/*
|
|
CreateSessionOK describes a response with status code 200, with default header values.
|
|
|
|
Successful sign-in
|
|
*/
|
|
type CreateSessionOK struct {
|
|
|
|
/* kvSession=<jwt>; HttpOnly; Secure; SameSite=None; Domain=.keenanvision.net; Path=/; Max-Age=5400
|
|
|
|
*/
|
|
SetCookie string
|
|
|
|
Payload interface{}
|
|
}
|
|
|
|
// IsSuccess returns true when this create session o k response has a 2xx status code
|
|
func (o *CreateSessionOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this create session o k response has a 3xx status code
|
|
func (o *CreateSessionOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this create session o k response has a 4xx status code
|
|
func (o *CreateSessionOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this create session o k response has a 5xx status code
|
|
func (o *CreateSessionOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this create session o k response a status code equal to that given
|
|
func (o *CreateSessionOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the create session o k response
|
|
func (o *CreateSessionOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *CreateSessionOK) Error() string {
|
|
return fmt.Sprintf("[POST /sessions][%d] createSessionOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *CreateSessionOK) String() string {
|
|
return fmt.Sprintf("[POST /sessions][%d] createSessionOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *CreateSessionOK) GetPayload() interface{} {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *CreateSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// hydrates response header Set-Cookie
|
|
hdrSetCookie := response.GetHeader("Set-Cookie")
|
|
|
|
if hdrSetCookie != "" {
|
|
o.SetCookie = hdrSetCookie
|
|
}
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewCreateSessionUnauthorized creates a CreateSessionUnauthorized with default headers values
|
|
func NewCreateSessionUnauthorized() *CreateSessionUnauthorized {
|
|
return &CreateSessionUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
CreateSessionUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access Unauthorized, invalid API-KEY was used
|
|
*/
|
|
type CreateSessionUnauthorized struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this create session unauthorized response has a 2xx status code
|
|
func (o *CreateSessionUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this create session unauthorized response has a 3xx status code
|
|
func (o *CreateSessionUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this create session unauthorized response has a 4xx status code
|
|
func (o *CreateSessionUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this create session unauthorized response has a 5xx status code
|
|
func (o *CreateSessionUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this create session unauthorized response a status code equal to that given
|
|
func (o *CreateSessionUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the create session unauthorized response
|
|
func (o *CreateSessionUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *CreateSessionUnauthorized) Error() string {
|
|
return fmt.Sprintf("[POST /sessions][%d] createSessionUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *CreateSessionUnauthorized) String() string {
|
|
return fmt.Sprintf("[POST /sessions][%d] createSessionUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *CreateSessionUnauthorized) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *CreateSessionUnauthorized) 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
|
|
}
|
|
|
|
// NewCreateSessionTooManyRequests creates a CreateSessionTooManyRequests with default headers values
|
|
func NewCreateSessionTooManyRequests() *CreateSessionTooManyRequests {
|
|
return &CreateSessionTooManyRequests{}
|
|
}
|
|
|
|
/*
|
|
CreateSessionTooManyRequests describes a response with status code 429, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type CreateSessionTooManyRequests struct {
|
|
Payload *members_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this create session too many requests response has a 2xx status code
|
|
func (o *CreateSessionTooManyRequests) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this create session too many requests response has a 3xx status code
|
|
func (o *CreateSessionTooManyRequests) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this create session too many requests response has a 4xx status code
|
|
func (o *CreateSessionTooManyRequests) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this create session too many requests response has a 5xx status code
|
|
func (o *CreateSessionTooManyRequests) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this create session too many requests response a status code equal to that given
|
|
func (o *CreateSessionTooManyRequests) IsCode(code int) bool {
|
|
return code == 429
|
|
}
|
|
|
|
// Code gets the status code for the create session too many requests response
|
|
func (o *CreateSessionTooManyRequests) Code() int {
|
|
return 429
|
|
}
|
|
|
|
func (o *CreateSessionTooManyRequests) Error() string {
|
|
return fmt.Sprintf("[POST /sessions][%d] createSessionTooManyRequests %+v", 429, o.Payload)
|
|
}
|
|
|
|
func (o *CreateSessionTooManyRequests) String() string {
|
|
return fmt.Sprintf("[POST /sessions][%d] createSessionTooManyRequests %+v", 429, o.Payload)
|
|
}
|
|
|
|
func (o *CreateSessionTooManyRequests) GetPayload() *members_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *CreateSessionTooManyRequests) 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
|
|
}
|