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

// GetTrackUsersReader is a Reader for the GetTrackUsers structure.
type GetTrackUsersReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetTrackUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetTrackUsersOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetTrackUsersUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetTrackUsersForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetTrackUsersNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetTrackUsersUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetTrackUsersInternalServerError()
		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())
	}
}

// NewGetTrackUsersOK creates a GetTrackUsersOK with default headers values
func NewGetTrackUsersOK() *GetTrackUsersOK {
	return &GetTrackUsersOK{}
}

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

TrackUser Response Object
*/
type GetTrackUsersOK struct {
	Payload *members_models.TrackUserResponse
}

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

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

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

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

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

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

func (o *GetTrackUsersOK) Error() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersOK  %+v", 200, o.Payload)
}

func (o *GetTrackUsersOK) String() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersOK  %+v", 200, o.Payload)
}

func (o *GetTrackUsersOK) GetPayload() *members_models.TrackUserResponse {
	return o.Payload
}

func (o *GetTrackUsersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(members_models.TrackUserResponse)

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

	return nil
}

// NewGetTrackUsersUnauthorized creates a GetTrackUsersUnauthorized with default headers values
func NewGetTrackUsersUnauthorized() *GetTrackUsersUnauthorized {
	return &GetTrackUsersUnauthorized{}
}

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

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

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

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

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

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

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

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

func (o *GetTrackUsersUnauthorized) Error() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnauthorized  %+v", 401, o.Payload)
}

func (o *GetTrackUsersUnauthorized) String() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnauthorized  %+v", 401, o.Payload)
}

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

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

// NewGetTrackUsersForbidden creates a GetTrackUsersForbidden with default headers values
func NewGetTrackUsersForbidden() *GetTrackUsersForbidden {
	return &GetTrackUsersForbidden{}
}

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

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

	Payload *members_models.Error
}

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

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

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

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

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

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

func (o *GetTrackUsersForbidden) Error() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersForbidden  %+v", 403, o.Payload)
}

func (o *GetTrackUsersForbidden) String() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersForbidden  %+v", 403, o.Payload)
}

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

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

// NewGetTrackUsersNotFound creates a GetTrackUsersNotFound with default headers values
func NewGetTrackUsersNotFound() *GetTrackUsersNotFound {
	return &GetTrackUsersNotFound{}
}

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

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

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

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

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

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

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

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

func (o *GetTrackUsersNotFound) Error() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersNotFound  %+v", 404, o.Payload)
}

func (o *GetTrackUsersNotFound) String() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersNotFound  %+v", 404, o.Payload)
}

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

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

// NewGetTrackUsersUnprocessableEntity creates a GetTrackUsersUnprocessableEntity with default headers values
func NewGetTrackUsersUnprocessableEntity() *GetTrackUsersUnprocessableEntity {
	return &GetTrackUsersUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

func (o *GetTrackUsersUnprocessableEntity) Error() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnprocessableEntity  %+v", 422, o.Payload)
}

func (o *GetTrackUsersUnprocessableEntity) String() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersUnprocessableEntity  %+v", 422, o.Payload)
}

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

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

// NewGetTrackUsersInternalServerError creates a GetTrackUsersInternalServerError with default headers values
func NewGetTrackUsersInternalServerError() *GetTrackUsersInternalServerError {
	return &GetTrackUsersInternalServerError{}
}

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

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

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

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

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

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

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

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

func (o *GetTrackUsersInternalServerError) Error() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersInternalServerError  %+v", 500, o.Payload)
}

func (o *GetTrackUsersInternalServerError) String() string {
	return fmt.Sprintf("[GET /trackusers][%d] getTrackUsersInternalServerError  %+v", 500, o.Payload)
}

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

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