// 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_events

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

// PutTrackEventsReader is a Reader for the PutTrackEvents structure.
type PutTrackEventsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *PutTrackEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewPutTrackEventsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewPutTrackEventsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewPutTrackEventsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewPutTrackEventsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewPutTrackEventsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewPutTrackEventsInternalServerError()
		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())
	}
}

// NewPutTrackEventsOK creates a PutTrackEventsOK with default headers values
func NewPutTrackEventsOK() *PutTrackEventsOK {
	return &PutTrackEventsOK{}
}

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

TrackEvent Response Object
*/
type PutTrackEventsOK struct {
	Payload *members_models.TrackEventResponse
}

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

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

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

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

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

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

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

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

func (o *PutTrackEventsOK) GetPayload() *members_models.TrackEventResponse {
	return o.Payload
}

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

	o.Payload = new(members_models.TrackEventResponse)

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

	return nil
}

// NewPutTrackEventsUnauthorized creates a PutTrackEventsUnauthorized with default headers values
func NewPutTrackEventsUnauthorized() *PutTrackEventsUnauthorized {
	return &PutTrackEventsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutTrackEventsForbidden creates a PutTrackEventsForbidden with default headers values
func NewPutTrackEventsForbidden() *PutTrackEventsForbidden {
	return &PutTrackEventsForbidden{}
}

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

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

	Payload *members_models.Error
}

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

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

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

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

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

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

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

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

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

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

// NewPutTrackEventsNotFound creates a PutTrackEventsNotFound with default headers values
func NewPutTrackEventsNotFound() *PutTrackEventsNotFound {
	return &PutTrackEventsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutTrackEventsUnprocessableEntity creates a PutTrackEventsUnprocessableEntity with default headers values
func NewPutTrackEventsUnprocessableEntity() *PutTrackEventsUnprocessableEntity {
	return &PutTrackEventsUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewPutTrackEventsInternalServerError creates a PutTrackEventsInternalServerError with default headers values
func NewPutTrackEventsInternalServerError() *PutTrackEventsInternalServerError {
	return &PutTrackEventsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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