// Code generated by go-swagger; DO NOT EDIT. // (c) 2012-2020 by Taxnexus, Inc. // All rights reserved worldwide. // Proprietary product; unlicensed use is not allowed package tracks import ( "encoding/json" stderrors "errors" "fmt" "io" "code.tnxs.net/vernonkeenan/lib/api/members/members_models" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" ) // GetTracksReader is a Reader for the GetTracks structure. type GetTracksReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetTracksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewGetTracksOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewGetTracksUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewGetTracksForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewGetTracksNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewGetTracksUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetTracksInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("[GET /tracks] getTracks", response, response.Code()) } } // NewGetTracksOK creates a GetTracksOK with default headers values func NewGetTracksOK() *GetTracksOK { return &GetTracksOK{} } // GetTracksOK describes a response with status code 200, with default header values. // // Governed Track response type GetTracksOK struct { Payload *members_models.TrackResponse } // IsSuccess returns true when this get tracks o k response has a 2xx status code func (o *GetTracksOK) IsSuccess() bool { return true } // IsRedirect returns true when this get tracks o k response has a 3xx status code func (o *GetTracksOK) IsRedirect() bool { return false } // IsClientError returns true when this get tracks o k response has a 4xx status code func (o *GetTracksOK) IsClientError() bool { return false } // IsServerError returns true when this get tracks o k response has a 5xx status code func (o *GetTracksOK) IsServerError() bool { return false } // IsCode returns true when this get tracks o k response a status code equal to that given func (o *GetTracksOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the get tracks o k response func (o *GetTracksOK) Code() int { return 200 } func (o *GetTracksOK) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksOK %s", 200, payload) } func (o *GetTracksOK) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksOK %s", 200, payload) } func (o *GetTracksOK) GetPayload() *members_models.TrackResponse { return o.Payload } func (o *GetTracksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(members_models.TrackResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewGetTracksUnauthorized creates a GetTracksUnauthorized with default headers values func NewGetTracksUnauthorized() *GetTracksUnauthorized { return &GetTracksUnauthorized{} } // GetTracksUnauthorized describes a response with status code 401, with default header values. // // Access Unauthorized, invalid API-KEY was used type GetTracksUnauthorized struct { Payload *members_models.Error } // IsSuccess returns true when this get tracks unauthorized response has a 2xx status code func (o *GetTracksUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this get tracks unauthorized response has a 3xx status code func (o *GetTracksUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this get tracks unauthorized response has a 4xx status code func (o *GetTracksUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this get tracks unauthorized response has a 5xx status code func (o *GetTracksUnauthorized) IsServerError() bool { return false } // IsCode returns true when this get tracks unauthorized response a status code equal to that given func (o *GetTracksUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the get tracks unauthorized response func (o *GetTracksUnauthorized) Code() int { return 401 } func (o *GetTracksUnauthorized) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksUnauthorized %s", 401, payload) } func (o *GetTracksUnauthorized) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksUnauthorized %s", 401, payload) } func (o *GetTracksUnauthorized) GetPayload() *members_models.Error { return o.Payload } func (o *GetTracksUnauthorized) 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 && !stderrors.Is(err, io.EOF) { return err } return nil } // NewGetTracksForbidden creates a GetTracksForbidden with default headers values func NewGetTracksForbidden() *GetTracksForbidden { return &GetTracksForbidden{} } // GetTracksForbidden describes a response with status code 403, with default header values. // // Access forbidden, account lacks access type GetTracksForbidden struct { AccessControlAllowOrigin string Payload *members_models.Error } // IsSuccess returns true when this get tracks forbidden response has a 2xx status code func (o *GetTracksForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this get tracks forbidden response has a 3xx status code func (o *GetTracksForbidden) IsRedirect() bool { return false } // IsClientError returns true when this get tracks forbidden response has a 4xx status code func (o *GetTracksForbidden) IsClientError() bool { return true } // IsServerError returns true when this get tracks forbidden response has a 5xx status code func (o *GetTracksForbidden) IsServerError() bool { return false } // IsCode returns true when this get tracks forbidden response a status code equal to that given func (o *GetTracksForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the get tracks forbidden response func (o *GetTracksForbidden) Code() int { return 403 } func (o *GetTracksForbidden) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksForbidden %s", 403, payload) } func (o *GetTracksForbidden) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksForbidden %s", 403, payload) } func (o *GetTracksForbidden) GetPayload() *members_models.Error { return o.Payload } func (o *GetTracksForbidden) 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 && !stderrors.Is(err, io.EOF) { return err } return nil } // NewGetTracksNotFound creates a GetTracksNotFound with default headers values func NewGetTracksNotFound() *GetTracksNotFound { return &GetTracksNotFound{} } // GetTracksNotFound describes a response with status code 404, with default header values. // // Resource was not found type GetTracksNotFound struct { Payload *members_models.Error } // IsSuccess returns true when this get tracks not found response has a 2xx status code func (o *GetTracksNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this get tracks not found response has a 3xx status code func (o *GetTracksNotFound) IsRedirect() bool { return false } // IsClientError returns true when this get tracks not found response has a 4xx status code func (o *GetTracksNotFound) IsClientError() bool { return true } // IsServerError returns true when this get tracks not found response has a 5xx status code func (o *GetTracksNotFound) IsServerError() bool { return false } // IsCode returns true when this get tracks not found response a status code equal to that given func (o *GetTracksNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the get tracks not found response func (o *GetTracksNotFound) Code() int { return 404 } func (o *GetTracksNotFound) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksNotFound %s", 404, payload) } func (o *GetTracksNotFound) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksNotFound %s", 404, payload) } func (o *GetTracksNotFound) GetPayload() *members_models.Error { return o.Payload } func (o *GetTracksNotFound) 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 && !stderrors.Is(err, io.EOF) { return err } return nil } // NewGetTracksUnprocessableEntity creates a GetTracksUnprocessableEntity with default headers values func NewGetTracksUnprocessableEntity() *GetTracksUnprocessableEntity { return &GetTracksUnprocessableEntity{} } // GetTracksUnprocessableEntity describes a response with status code 422, with default header values. // // Unprocessable Entity, likely a bad parameter type GetTracksUnprocessableEntity struct { Payload *members_models.Error } // IsSuccess returns true when this get tracks unprocessable entity response has a 2xx status code func (o *GetTracksUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this get tracks unprocessable entity response has a 3xx status code func (o *GetTracksUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this get tracks unprocessable entity response has a 4xx status code func (o *GetTracksUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this get tracks unprocessable entity response has a 5xx status code func (o *GetTracksUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this get tracks unprocessable entity response a status code equal to that given func (o *GetTracksUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the get tracks unprocessable entity response func (o *GetTracksUnprocessableEntity) Code() int { return 422 } func (o *GetTracksUnprocessableEntity) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksUnprocessableEntity %s", 422, payload) } func (o *GetTracksUnprocessableEntity) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksUnprocessableEntity %s", 422, payload) } func (o *GetTracksUnprocessableEntity) GetPayload() *members_models.Error { return o.Payload } func (o *GetTracksUnprocessableEntity) 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 && !stderrors.Is(err, io.EOF) { return err } return nil } // NewGetTracksInternalServerError creates a GetTracksInternalServerError with default headers values func NewGetTracksInternalServerError() *GetTracksInternalServerError { return &GetTracksInternalServerError{} } // GetTracksInternalServerError describes a response with status code 500, with default header values. // // Server Internal Error type GetTracksInternalServerError struct { Payload *members_models.Error } // IsSuccess returns true when this get tracks internal server error response has a 2xx status code func (o *GetTracksInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this get tracks internal server error response has a 3xx status code func (o *GetTracksInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this get tracks internal server error response has a 4xx status code func (o *GetTracksInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this get tracks internal server error response has a 5xx status code func (o *GetTracksInternalServerError) IsServerError() bool { return true } // IsCode returns true when this get tracks internal server error response a status code equal to that given func (o *GetTracksInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the get tracks internal server error response func (o *GetTracksInternalServerError) Code() int { return 500 } func (o *GetTracksInternalServerError) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksInternalServerError %s", 500, payload) } func (o *GetTracksInternalServerError) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /tracks][%d] getTracksInternalServerError %s", 500, payload) } func (o *GetTracksInternalServerError) GetPayload() *members_models.Error { return o.Payload } func (o *GetTracksInternalServerError) 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 && !stderrors.Is(err, io.EOF) { return err } return nil }