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

// GetTrackEventsReader is a Reader for the GetTrackEvents structure.
type GetTrackEventsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetTrackEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetTrackEventsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 401:
		result := NewGetTrackEventsUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetTrackEventsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetTrackEventsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 422:
		result := NewGetTrackEventsUnprocessableEntity()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetTrackEventsInternalServerError()
		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())
	}
}

// NewGetTrackEventsOK creates a GetTrackEventsOK with default headers values
func NewGetTrackEventsOK() *GetTrackEventsOK {
	return &GetTrackEventsOK{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetTrackEventsUnauthorized creates a GetTrackEventsUnauthorized with default headers values
func NewGetTrackEventsUnauthorized() *GetTrackEventsUnauthorized {
	return &GetTrackEventsUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetTrackEventsForbidden creates a GetTrackEventsForbidden with default headers values
func NewGetTrackEventsForbidden() *GetTrackEventsForbidden {
	return &GetTrackEventsForbidden{}
}

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

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

	Payload *members_models.Error
}

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

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

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

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

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

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

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

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

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

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

// NewGetTrackEventsNotFound creates a GetTrackEventsNotFound with default headers values
func NewGetTrackEventsNotFound() *GetTrackEventsNotFound {
	return &GetTrackEventsNotFound{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetTrackEventsUnprocessableEntity creates a GetTrackEventsUnprocessableEntity with default headers values
func NewGetTrackEventsUnprocessableEntity() *GetTrackEventsUnprocessableEntity {
	return &GetTrackEventsUnprocessableEntity{}
}

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

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

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

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

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

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

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

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

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

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

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

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

// NewGetTrackEventsInternalServerError creates a GetTrackEventsInternalServerError with default headers values
func NewGetTrackEventsInternalServerError() *GetTrackEventsInternalServerError {
	return &GetTrackEventsInternalServerError{}
}

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

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

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

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

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

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

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

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

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

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

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

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