// 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"
)

// GetUsersAuthReader is a Reader for the GetUsersAuth structure.
type GetUsersAuthReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetUsersAuthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetUsersAuthOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetUsersAuthUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetUsersAuthForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetUsersAuthNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetUsersAuthUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetUsersAuthInternalServerError()
		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())
	}
}

// NewGetUsersAuthOK creates a GetUsersAuthOK with default headers values
func NewGetUsersAuthOK() *GetUsersAuthOK {
	return &GetUsersAuthOK{}
}

/*
GetUsersAuthOK describes a response with status code 200, with default header values.

Response with single UserAuth object
*/
type GetUsersAuthOK struct {
	Payload *members_models.UserAuth
}

// IsSuccess returns true when this get users auth o k response has a 2xx status code
func (o *GetUsersAuthOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this get users auth o k response has a 3xx status code
func (o *GetUsersAuthOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get users auth o k response has a 4xx status code
func (o *GetUsersAuthOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this get users auth o k response has a 5xx status code
func (o *GetUsersAuthOK) IsServerError() bool {
	return false
}

// IsCode returns true when this get users auth o k response a status code equal to that given
func (o *GetUsersAuthOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the get users auth o k response
func (o *GetUsersAuthOK) Code() int {
	return 200
}

func (o *GetUsersAuthOK) Error() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthOK  %+v", 200, o.Payload)
}

func (o *GetUsersAuthOK) String() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthOK  %+v", 200, o.Payload)
}

func (o *GetUsersAuthOK) GetPayload() *members_models.UserAuth {
	return o.Payload
}

func (o *GetUsersAuthOK) 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
}

// NewGetUsersAuthUnauthorized creates a GetUsersAuthUnauthorized with default headers values
func NewGetUsersAuthUnauthorized() *GetUsersAuthUnauthorized {
	return &GetUsersAuthUnauthorized{}
}

/*
GetUsersAuthUnauthorized describes a response with status code 401, with default header values.

Access Unauthorized, invalid API-KEY was used
*/
type GetUsersAuthUnauthorized struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this get users auth unauthorized response has a 2xx status code
func (o *GetUsersAuthUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get users auth unauthorized response has a 3xx status code
func (o *GetUsersAuthUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get users auth unauthorized response has a 4xx status code
func (o *GetUsersAuthUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this get users auth unauthorized response has a 5xx status code
func (o *GetUsersAuthUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this get users auth unauthorized response a status code equal to that given
func (o *GetUsersAuthUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the get users auth unauthorized response
func (o *GetUsersAuthUnauthorized) Code() int {
	return 401
}

func (o *GetUsersAuthUnauthorized) Error() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthUnauthorized  %+v", 401, o.Payload)
}

func (o *GetUsersAuthUnauthorized) String() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthUnauthorized  %+v", 401, o.Payload)
}

func (o *GetUsersAuthUnauthorized) GetPayload() *members_models.Error {
	return o.Payload
}

func (o *GetUsersAuthUnauthorized) 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
}

// NewGetUsersAuthForbidden creates a GetUsersAuthForbidden with default headers values
func NewGetUsersAuthForbidden() *GetUsersAuthForbidden {
	return &GetUsersAuthForbidden{}
}

/*
GetUsersAuthForbidden describes a response with status code 403, with default header values.

Access forbidden, account lacks access
*/
type GetUsersAuthForbidden struct {
	AccessControlAllowOrigin string

	Payload *members_models.Error
}

// IsSuccess returns true when this get users auth forbidden response has a 2xx status code
func (o *GetUsersAuthForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get users auth forbidden response has a 3xx status code
func (o *GetUsersAuthForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get users auth forbidden response has a 4xx status code
func (o *GetUsersAuthForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this get users auth forbidden response has a 5xx status code
func (o *GetUsersAuthForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this get users auth forbidden response a status code equal to that given
func (o *GetUsersAuthForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the get users auth forbidden response
func (o *GetUsersAuthForbidden) Code() int {
	return 403
}

func (o *GetUsersAuthForbidden) Error() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthForbidden  %+v", 403, o.Payload)
}

func (o *GetUsersAuthForbidden) String() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthForbidden  %+v", 403, o.Payload)
}

func (o *GetUsersAuthForbidden) GetPayload() *members_models.Error {
	return o.Payload
}

func (o *GetUsersAuthForbidden) 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(members_models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewGetUsersAuthNotFound creates a GetUsersAuthNotFound with default headers values
func NewGetUsersAuthNotFound() *GetUsersAuthNotFound {
	return &GetUsersAuthNotFound{}
}

/*
GetUsersAuthNotFound describes a response with status code 404, with default header values.

Resource was not found
*/
type GetUsersAuthNotFound struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this get users auth not found response has a 2xx status code
func (o *GetUsersAuthNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get users auth not found response has a 3xx status code
func (o *GetUsersAuthNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get users auth not found response has a 4xx status code
func (o *GetUsersAuthNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this get users auth not found response has a 5xx status code
func (o *GetUsersAuthNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this get users auth not found response a status code equal to that given
func (o *GetUsersAuthNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the get users auth not found response
func (o *GetUsersAuthNotFound) Code() int {
	return 404
}

func (o *GetUsersAuthNotFound) Error() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthNotFound  %+v", 404, o.Payload)
}

func (o *GetUsersAuthNotFound) String() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthNotFound  %+v", 404, o.Payload)
}

func (o *GetUsersAuthNotFound) GetPayload() *members_models.Error {
	return o.Payload
}

func (o *GetUsersAuthNotFound) 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
}

// NewGetUsersAuthUnprocessableEntity creates a GetUsersAuthUnprocessableEntity with default headers values
func NewGetUsersAuthUnprocessableEntity() *GetUsersAuthUnprocessableEntity {
	return &GetUsersAuthUnprocessableEntity{}
}

/*
GetUsersAuthUnprocessableEntity describes a response with status code 422, with default header values.

Unprocessable Entity, likely a bad parameter
*/
type GetUsersAuthUnprocessableEntity struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this get users auth unprocessable entity response has a 2xx status code
func (o *GetUsersAuthUnprocessableEntity) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get users auth unprocessable entity response has a 3xx status code
func (o *GetUsersAuthUnprocessableEntity) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get users auth unprocessable entity response has a 4xx status code
func (o *GetUsersAuthUnprocessableEntity) IsClientError() bool {
	return true
}

// IsServerError returns true when this get users auth unprocessable entity response has a 5xx status code
func (o *GetUsersAuthUnprocessableEntity) IsServerError() bool {
	return false
}

// IsCode returns true when this get users auth unprocessable entity response a status code equal to that given
func (o *GetUsersAuthUnprocessableEntity) IsCode(code int) bool {
	return code == 422
}

// Code gets the status code for the get users auth unprocessable entity response
func (o *GetUsersAuthUnprocessableEntity) Code() int {
	return 422
}

func (o *GetUsersAuthUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetUsersAuthUnprocessableEntity) String() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetUsersAuthUnprocessableEntity) GetPayload() *members_models.Error {
	return o.Payload
}

func (o *GetUsersAuthUnprocessableEntity) 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
}

// NewGetUsersAuthInternalServerError creates a GetUsersAuthInternalServerError with default headers values
func NewGetUsersAuthInternalServerError() *GetUsersAuthInternalServerError {
	return &GetUsersAuthInternalServerError{}
}

/*
GetUsersAuthInternalServerError describes a response with status code 500, with default header values.

Server Internal Error
*/
type GetUsersAuthInternalServerError struct {
	Payload *members_models.Error
}

// IsSuccess returns true when this get users auth internal server error response has a 2xx status code
func (o *GetUsersAuthInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this get users auth internal server error response has a 3xx status code
func (o *GetUsersAuthInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this get users auth internal server error response has a 4xx status code
func (o *GetUsersAuthInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this get users auth internal server error response has a 5xx status code
func (o *GetUsersAuthInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this get users auth internal server error response a status code equal to that given
func (o *GetUsersAuthInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the get users auth internal server error response
func (o *GetUsersAuthInternalServerError) Code() int {
	return 500
}

func (o *GetUsersAuthInternalServerError) Error() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthInternalServerError  %+v", 500, o.Payload)
}

func (o *GetUsersAuthInternalServerError) String() string {
	return fmt.Sprintf("[GET /users/auth][%d] getUsersAuthInternalServerError  %+v", 500, o.Payload)
}

func (o *GetUsersAuthInternalServerError) GetPayload() *members_models.Error {
	return o.Payload
}

func (o *GetUsersAuthInternalServerError) 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
}
