mirror of https://github.com/vernonkeenan/lib
523 lines
16 KiB
Go
523 lines
16 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 users
|
|
|
|
// 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/sfgate/sfgate_models"
|
|
)
|
|
|
|
// PutUsersSessionsReader is a Reader for the PutUsersSessions structure.
|
|
type PutUsersSessionsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *PutUsersSessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
case 200:
|
|
result := NewPutUsersSessionsOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
case 401:
|
|
result := NewPutUsersSessionsUnauthorized()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 403:
|
|
result := NewPutUsersSessionsForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 404:
|
|
result := NewPutUsersSessionsNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 422:
|
|
result := NewPutUsersSessionsUnprocessableEntity()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
case 500:
|
|
result := NewPutUsersSessionsInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewPutUsersSessionsOK creates a PutUsersSessionsOK with default headers values
|
|
func NewPutUsersSessionsOK() *PutUsersSessionsOK {
|
|
return &PutUsersSessionsOK{}
|
|
}
|
|
|
|
/*
|
|
PutUsersSessionsOK describes a response with status code 200, with default header values.
|
|
|
|
Response with User objects
|
|
*/
|
|
type PutUsersSessionsOK struct {
|
|
Payload *sfgate_models.UserResponse
|
|
}
|
|
|
|
// IsSuccess returns true when this put users sessions o k response has a 2xx status code
|
|
func (o *PutUsersSessionsOK) IsSuccess() bool {
|
|
return true
|
|
}
|
|
|
|
// IsRedirect returns true when this put users sessions o k response has a 3xx status code
|
|
func (o *PutUsersSessionsOK) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put users sessions o k response has a 4xx status code
|
|
func (o *PutUsersSessionsOK) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this put users sessions o k response has a 5xx status code
|
|
func (o *PutUsersSessionsOK) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put users sessions o k response a status code equal to that given
|
|
func (o *PutUsersSessionsOK) IsCode(code int) bool {
|
|
return code == 200
|
|
}
|
|
|
|
// Code gets the status code for the put users sessions o k response
|
|
func (o *PutUsersSessionsOK) Code() int {
|
|
return 200
|
|
}
|
|
|
|
func (o *PutUsersSessionsOK) Error() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsOK) String() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsOK) GetPayload() *sfgate_models.UserResponse {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutUsersSessionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
o.Payload = new(sfgate_models.UserResponse)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutUsersSessionsUnauthorized creates a PutUsersSessionsUnauthorized with default headers values
|
|
func NewPutUsersSessionsUnauthorized() *PutUsersSessionsUnauthorized {
|
|
return &PutUsersSessionsUnauthorized{}
|
|
}
|
|
|
|
/*
|
|
PutUsersSessionsUnauthorized describes a response with status code 401, with default header values.
|
|
|
|
Access unauthorized, invalid API-KEY was used
|
|
*/
|
|
type PutUsersSessionsUnauthorized struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put users sessions unauthorized response has a 2xx status code
|
|
func (o *PutUsersSessionsUnauthorized) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put users sessions unauthorized response has a 3xx status code
|
|
func (o *PutUsersSessionsUnauthorized) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put users sessions unauthorized response has a 4xx status code
|
|
func (o *PutUsersSessionsUnauthorized) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put users sessions unauthorized response has a 5xx status code
|
|
func (o *PutUsersSessionsUnauthorized) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put users sessions unauthorized response a status code equal to that given
|
|
func (o *PutUsersSessionsUnauthorized) IsCode(code int) bool {
|
|
return code == 401
|
|
}
|
|
|
|
// Code gets the status code for the put users sessions unauthorized response
|
|
func (o *PutUsersSessionsUnauthorized) Code() int {
|
|
return 401
|
|
}
|
|
|
|
func (o *PutUsersSessionsUnauthorized) Error() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsUnauthorized) String() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsUnauthorized %+v", 401, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsUnauthorized) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutUsersSessionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// hydrates response header Access-Control-Allow-Origin
|
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
if hdrAccessControlAllowOrigin != "" {
|
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
|
}
|
|
|
|
o.Payload = new(sfgate_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutUsersSessionsForbidden creates a PutUsersSessionsForbidden with default headers values
|
|
func NewPutUsersSessionsForbidden() *PutUsersSessionsForbidden {
|
|
return &PutUsersSessionsForbidden{}
|
|
}
|
|
|
|
/*
|
|
PutUsersSessionsForbidden describes a response with status code 403, with default header values.
|
|
|
|
Access forbidden, account lacks access
|
|
*/
|
|
type PutUsersSessionsForbidden struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put users sessions forbidden response has a 2xx status code
|
|
func (o *PutUsersSessionsForbidden) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put users sessions forbidden response has a 3xx status code
|
|
func (o *PutUsersSessionsForbidden) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put users sessions forbidden response has a 4xx status code
|
|
func (o *PutUsersSessionsForbidden) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put users sessions forbidden response has a 5xx status code
|
|
func (o *PutUsersSessionsForbidden) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put users sessions forbidden response a status code equal to that given
|
|
func (o *PutUsersSessionsForbidden) IsCode(code int) bool {
|
|
return code == 403
|
|
}
|
|
|
|
// Code gets the status code for the put users sessions forbidden response
|
|
func (o *PutUsersSessionsForbidden) Code() int {
|
|
return 403
|
|
}
|
|
|
|
func (o *PutUsersSessionsForbidden) Error() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsForbidden) String() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsForbidden) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutUsersSessionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// hydrates response header Access-Control-Allow-Origin
|
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
if hdrAccessControlAllowOrigin != "" {
|
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
|
}
|
|
|
|
o.Payload = new(sfgate_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutUsersSessionsNotFound creates a PutUsersSessionsNotFound with default headers values
|
|
func NewPutUsersSessionsNotFound() *PutUsersSessionsNotFound {
|
|
return &PutUsersSessionsNotFound{}
|
|
}
|
|
|
|
/*
|
|
PutUsersSessionsNotFound describes a response with status code 404, with default header values.
|
|
|
|
Resource was not found
|
|
*/
|
|
type PutUsersSessionsNotFound struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put users sessions not found response has a 2xx status code
|
|
func (o *PutUsersSessionsNotFound) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put users sessions not found response has a 3xx status code
|
|
func (o *PutUsersSessionsNotFound) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put users sessions not found response has a 4xx status code
|
|
func (o *PutUsersSessionsNotFound) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put users sessions not found response has a 5xx status code
|
|
func (o *PutUsersSessionsNotFound) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put users sessions not found response a status code equal to that given
|
|
func (o *PutUsersSessionsNotFound) IsCode(code int) bool {
|
|
return code == 404
|
|
}
|
|
|
|
// Code gets the status code for the put users sessions not found response
|
|
func (o *PutUsersSessionsNotFound) Code() int {
|
|
return 404
|
|
}
|
|
|
|
func (o *PutUsersSessionsNotFound) Error() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsNotFound) String() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsNotFound) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutUsersSessionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// hydrates response header Access-Control-Allow-Origin
|
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
if hdrAccessControlAllowOrigin != "" {
|
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
|
}
|
|
|
|
o.Payload = new(sfgate_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutUsersSessionsUnprocessableEntity creates a PutUsersSessionsUnprocessableEntity with default headers values
|
|
func NewPutUsersSessionsUnprocessableEntity() *PutUsersSessionsUnprocessableEntity {
|
|
return &PutUsersSessionsUnprocessableEntity{}
|
|
}
|
|
|
|
/*
|
|
PutUsersSessionsUnprocessableEntity describes a response with status code 422, with default header values.
|
|
|
|
Unprocessable Entity, likely a bad parameter
|
|
*/
|
|
type PutUsersSessionsUnprocessableEntity struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put users sessions unprocessable entity response has a 2xx status code
|
|
func (o *PutUsersSessionsUnprocessableEntity) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put users sessions unprocessable entity response has a 3xx status code
|
|
func (o *PutUsersSessionsUnprocessableEntity) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put users sessions unprocessable entity response has a 4xx status code
|
|
func (o *PutUsersSessionsUnprocessableEntity) IsClientError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsServerError returns true when this put users sessions unprocessable entity response has a 5xx status code
|
|
func (o *PutUsersSessionsUnprocessableEntity) IsServerError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsCode returns true when this put users sessions unprocessable entity response a status code equal to that given
|
|
func (o *PutUsersSessionsUnprocessableEntity) IsCode(code int) bool {
|
|
return code == 422
|
|
}
|
|
|
|
// Code gets the status code for the put users sessions unprocessable entity response
|
|
func (o *PutUsersSessionsUnprocessableEntity) Code() int {
|
|
return 422
|
|
}
|
|
|
|
func (o *PutUsersSessionsUnprocessableEntity) Error() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsUnprocessableEntity) String() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsUnprocessableEntity %+v", 422, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsUnprocessableEntity) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutUsersSessionsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// hydrates response header Access-Control-Allow-Origin
|
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
if hdrAccessControlAllowOrigin != "" {
|
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
|
}
|
|
|
|
o.Payload = new(sfgate_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewPutUsersSessionsInternalServerError creates a PutUsersSessionsInternalServerError with default headers values
|
|
func NewPutUsersSessionsInternalServerError() *PutUsersSessionsInternalServerError {
|
|
return &PutUsersSessionsInternalServerError{}
|
|
}
|
|
|
|
/*
|
|
PutUsersSessionsInternalServerError describes a response with status code 500, with default header values.
|
|
|
|
Server Internal Error
|
|
*/
|
|
type PutUsersSessionsInternalServerError struct {
|
|
AccessControlAllowOrigin string
|
|
|
|
Payload *sfgate_models.Error
|
|
}
|
|
|
|
// IsSuccess returns true when this put users sessions internal server error response has a 2xx status code
|
|
func (o *PutUsersSessionsInternalServerError) IsSuccess() bool {
|
|
return false
|
|
}
|
|
|
|
// IsRedirect returns true when this put users sessions internal server error response has a 3xx status code
|
|
func (o *PutUsersSessionsInternalServerError) IsRedirect() bool {
|
|
return false
|
|
}
|
|
|
|
// IsClientError returns true when this put users sessions internal server error response has a 4xx status code
|
|
func (o *PutUsersSessionsInternalServerError) IsClientError() bool {
|
|
return false
|
|
}
|
|
|
|
// IsServerError returns true when this put users sessions internal server error response has a 5xx status code
|
|
func (o *PutUsersSessionsInternalServerError) IsServerError() bool {
|
|
return true
|
|
}
|
|
|
|
// IsCode returns true when this put users sessions internal server error response a status code equal to that given
|
|
func (o *PutUsersSessionsInternalServerError) IsCode(code int) bool {
|
|
return code == 500
|
|
}
|
|
|
|
// Code gets the status code for the put users sessions internal server error response
|
|
func (o *PutUsersSessionsInternalServerError) Code() int {
|
|
return 500
|
|
}
|
|
|
|
func (o *PutUsersSessionsInternalServerError) Error() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsInternalServerError) String() string {
|
|
return fmt.Sprintf("[PUT /users/sessions][%d] putUsersSessionsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PutUsersSessionsInternalServerError) GetPayload() *sfgate_models.Error {
|
|
return o.Payload
|
|
}
|
|
|
|
func (o *PutUsersSessionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// hydrates response header Access-Control-Allow-Origin
|
|
hdrAccessControlAllowOrigin := response.GetHeader("Access-Control-Allow-Origin")
|
|
|
|
if hdrAccessControlAllowOrigin != "" {
|
|
o.AccessControlAllowOrigin = hdrAccessControlAllowOrigin
|
|
}
|
|
|
|
o.Payload = new(sfgate_models.Error)
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|