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

// PutTrackUsersReader is a Reader for the PutTrackUsers structure.
type PutTrackUsersReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutTrackUsersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutTrackUsersOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutTrackUsersUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutTrackUsersForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutTrackUsersNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutTrackUsersUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutTrackUsersInternalServerError()
		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())
	}
}

// NewPutTrackUsersOK creates a PutTrackUsersOK with default headers values
func NewPutTrackUsersOK() *PutTrackUsersOK {
	return &PutTrackUsersOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutTrackUsersUnauthorized creates a PutTrackUsersUnauthorized with default headers values
func NewPutTrackUsersUnauthorized() *PutTrackUsersUnauthorized {
	return &PutTrackUsersUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutTrackUsersForbidden creates a PutTrackUsersForbidden with default headers values
func NewPutTrackUsersForbidden() *PutTrackUsersForbidden {
	return &PutTrackUsersForbidden{}
}

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

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

	Payload *members_models.Error
}

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

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

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

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

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

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

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

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

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

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

// NewPutTrackUsersNotFound creates a PutTrackUsersNotFound with default headers values
func NewPutTrackUsersNotFound() *PutTrackUsersNotFound {
	return &PutTrackUsersNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutTrackUsersUnprocessableEntity creates a PutTrackUsersUnprocessableEntity with default headers values
func NewPutTrackUsersUnprocessableEntity() *PutTrackUsersUnprocessableEntity {
	return &PutTrackUsersUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutTrackUsersInternalServerError creates a PutTrackUsersInternalServerError with default headers values
func NewPutTrackUsersInternalServerError() *PutTrackUsersInternalServerError {
	return &PutTrackUsersInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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