lib/api/members/members_client/users/post_users_auth_responses.go

404 lines
12 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// 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/work/lib/api/members/members_models"
)
// PostUsersAuthReader is a Reader for the PostUsersAuth structure.
type PostUsersAuthReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostUsersAuthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostUsersAuthOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostUsersAuthUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostUsersAuthNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostUsersAuthUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostUsersAuthInternalServerError()
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())
}
}
// NewPostUsersAuthOK creates a PostUsersAuthOK with default headers values
func NewPostUsersAuthOK() *PostUsersAuthOK {
return &PostUsersAuthOK{}
}
/*
PostUsersAuthOK describes a response with status code 200, with default header values.
Response with single UserAuth object
*/
type PostUsersAuthOK struct {
Payload *members_models.UserAuth
}
// IsSuccess returns true when this post users auth o k response has a 2xx status code
func (o *PostUsersAuthOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post users auth o k response has a 3xx status code
func (o *PostUsersAuthOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post users auth o k response has a 4xx status code
func (o *PostUsersAuthOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post users auth o k response has a 5xx status code
func (o *PostUsersAuthOK) IsServerError() bool {
return false
}
// IsCode returns true when this post users auth o k response a status code equal to that given
func (o *PostUsersAuthOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post users auth o k response
func (o *PostUsersAuthOK) Code() int {
return 200
}
func (o *PostUsersAuthOK) Error() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthOK %+v", 200, o.Payload)
}
func (o *PostUsersAuthOK) String() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthOK %+v", 200, o.Payload)
}
func (o *PostUsersAuthOK) GetPayload() *members_models.UserAuth {
return o.Payload
}
func (o *PostUsersAuthOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.UserAuth)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostUsersAuthUnauthorized creates a PostUsersAuthUnauthorized with default headers values
func NewPostUsersAuthUnauthorized() *PostUsersAuthUnauthorized {
return &PostUsersAuthUnauthorized{}
}
/*
PostUsersAuthUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostUsersAuthUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post users auth unauthorized response has a 2xx status code
func (o *PostUsersAuthUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post users auth unauthorized response has a 3xx status code
func (o *PostUsersAuthUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post users auth unauthorized response has a 4xx status code
func (o *PostUsersAuthUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post users auth unauthorized response has a 5xx status code
func (o *PostUsersAuthUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post users auth unauthorized response a status code equal to that given
func (o *PostUsersAuthUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post users auth unauthorized response
func (o *PostUsersAuthUnauthorized) Code() int {
return 401
}
func (o *PostUsersAuthUnauthorized) Error() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthUnauthorized %+v", 401, o.Payload)
}
func (o *PostUsersAuthUnauthorized) String() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthUnauthorized %+v", 401, o.Payload)
}
func (o *PostUsersAuthUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostUsersAuthUnauthorized) 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
}
// NewPostUsersAuthNotFound creates a PostUsersAuthNotFound with default headers values
func NewPostUsersAuthNotFound() *PostUsersAuthNotFound {
return &PostUsersAuthNotFound{}
}
/*
PostUsersAuthNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostUsersAuthNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post users auth not found response has a 2xx status code
func (o *PostUsersAuthNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post users auth not found response has a 3xx status code
func (o *PostUsersAuthNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post users auth not found response has a 4xx status code
func (o *PostUsersAuthNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post users auth not found response has a 5xx status code
func (o *PostUsersAuthNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post users auth not found response a status code equal to that given
func (o *PostUsersAuthNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post users auth not found response
func (o *PostUsersAuthNotFound) Code() int {
return 404
}
func (o *PostUsersAuthNotFound) Error() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthNotFound %+v", 404, o.Payload)
}
func (o *PostUsersAuthNotFound) String() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthNotFound %+v", 404, o.Payload)
}
func (o *PostUsersAuthNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostUsersAuthNotFound) 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
}
// NewPostUsersAuthUnprocessableEntity creates a PostUsersAuthUnprocessableEntity with default headers values
func NewPostUsersAuthUnprocessableEntity() *PostUsersAuthUnprocessableEntity {
return &PostUsersAuthUnprocessableEntity{}
}
/*
PostUsersAuthUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostUsersAuthUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post users auth unprocessable entity response has a 2xx status code
func (o *PostUsersAuthUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post users auth unprocessable entity response has a 3xx status code
func (o *PostUsersAuthUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post users auth unprocessable entity response has a 4xx status code
func (o *PostUsersAuthUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post users auth unprocessable entity response has a 5xx status code
func (o *PostUsersAuthUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post users auth unprocessable entity response a status code equal to that given
func (o *PostUsersAuthUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post users auth unprocessable entity response
func (o *PostUsersAuthUnprocessableEntity) Code() int {
return 422
}
func (o *PostUsersAuthUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostUsersAuthUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostUsersAuthUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostUsersAuthUnprocessableEntity) 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
}
// NewPostUsersAuthInternalServerError creates a PostUsersAuthInternalServerError with default headers values
func NewPostUsersAuthInternalServerError() *PostUsersAuthInternalServerError {
return &PostUsersAuthInternalServerError{}
}
/*
PostUsersAuthInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostUsersAuthInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post users auth internal server error response has a 2xx status code
func (o *PostUsersAuthInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post users auth internal server error response has a 3xx status code
func (o *PostUsersAuthInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post users auth internal server error response has a 4xx status code
func (o *PostUsersAuthInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post users auth internal server error response has a 5xx status code
func (o *PostUsersAuthInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post users auth internal server error response a status code equal to that given
func (o *PostUsersAuthInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post users auth internal server error response
func (o *PostUsersAuthInternalServerError) Code() int {
return 500
}
func (o *PostUsersAuthInternalServerError) Error() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthInternalServerError %+v", 500, o.Payload)
}
func (o *PostUsersAuthInternalServerError) String() string {
return fmt.Sprintf("[POST /users/auth][%d] postUsersAuthInternalServerError %+v", 500, o.Payload)
}
func (o *PostUsersAuthInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostUsersAuthInternalServerError) 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
}