// 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 tracks // 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" ) // PutTracksReader is a Reader for the PutTracks structure. type PutTracksReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *PutTracksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewPutTracksOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewPutTracksUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewPutTracksForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewPutTracksNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewPutTracksUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewPutTracksInternalServerError() 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()) } } // NewPutTracksOK creates a PutTracksOK with default headers values func NewPutTracksOK() *PutTracksOK { return &PutTracksOK{} } /* PutTracksOK describes a response with status code 200, with default header values. Track Response Object */ type PutTracksOK struct { Payload *members_models.TrackResponse } // IsSuccess returns true when this put tracks o k response has a 2xx status code func (o *PutTracksOK) IsSuccess() bool { return true } // IsRedirect returns true when this put tracks o k response has a 3xx status code func (o *PutTracksOK) IsRedirect() bool { return false } // IsClientError returns true when this put tracks o k response has a 4xx status code func (o *PutTracksOK) IsClientError() bool { return false } // IsServerError returns true when this put tracks o k response has a 5xx status code func (o *PutTracksOK) IsServerError() bool { return false } // IsCode returns true when this put tracks o k response a status code equal to that given func (o *PutTracksOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the put tracks o k response func (o *PutTracksOK) Code() int { return 200 } func (o *PutTracksOK) Error() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksOK %+v", 200, o.Payload) } func (o *PutTracksOK) String() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksOK %+v", 200, o.Payload) } func (o *PutTracksOK) GetPayload() *members_models.TrackResponse { return o.Payload } func (o *PutTracksOK) 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 && err != io.EOF { return err } return nil } // NewPutTracksUnauthorized creates a PutTracksUnauthorized with default headers values func NewPutTracksUnauthorized() *PutTracksUnauthorized { return &PutTracksUnauthorized{} } /* PutTracksUnauthorized describes a response with status code 401, with default header values. Access Unauthorized, invalid API-KEY was used */ type PutTracksUnauthorized struct { Payload *members_models.Error } // IsSuccess returns true when this put tracks unauthorized response has a 2xx status code func (o *PutTracksUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this put tracks unauthorized response has a 3xx status code func (o *PutTracksUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this put tracks unauthorized response has a 4xx status code func (o *PutTracksUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this put tracks unauthorized response has a 5xx status code func (o *PutTracksUnauthorized) IsServerError() bool { return false } // IsCode returns true when this put tracks unauthorized response a status code equal to that given func (o *PutTracksUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the put tracks unauthorized response func (o *PutTracksUnauthorized) Code() int { return 401 } func (o *PutTracksUnauthorized) Error() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksUnauthorized %+v", 401, o.Payload) } func (o *PutTracksUnauthorized) String() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksUnauthorized %+v", 401, o.Payload) } func (o *PutTracksUnauthorized) GetPayload() *members_models.Error { return o.Payload } func (o *PutTracksUnauthorized) 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 } // NewPutTracksForbidden creates a PutTracksForbidden with default headers values func NewPutTracksForbidden() *PutTracksForbidden { return &PutTracksForbidden{} } /* PutTracksForbidden describes a response with status code 403, with default header values. Access forbidden, account lacks access */ type PutTracksForbidden struct { AccessControlAllowOrigin string Payload *members_models.Error } // IsSuccess returns true when this put tracks forbidden response has a 2xx status code func (o *PutTracksForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this put tracks forbidden response has a 3xx status code func (o *PutTracksForbidden) IsRedirect() bool { return false } // IsClientError returns true when this put tracks forbidden response has a 4xx status code func (o *PutTracksForbidden) IsClientError() bool { return true } // IsServerError returns true when this put tracks forbidden response has a 5xx status code func (o *PutTracksForbidden) IsServerError() bool { return false } // IsCode returns true when this put tracks forbidden response a status code equal to that given func (o *PutTracksForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the put tracks forbidden response func (o *PutTracksForbidden) Code() int { return 403 } func (o *PutTracksForbidden) Error() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksForbidden %+v", 403, o.Payload) } func (o *PutTracksForbidden) String() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksForbidden %+v", 403, o.Payload) } func (o *PutTracksForbidden) GetPayload() *members_models.Error { return o.Payload } func (o *PutTracksForbidden) 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 } // NewPutTracksNotFound creates a PutTracksNotFound with default headers values func NewPutTracksNotFound() *PutTracksNotFound { return &PutTracksNotFound{} } /* PutTracksNotFound describes a response with status code 404, with default header values. Resource was not found */ type PutTracksNotFound struct { Payload *members_models.Error } // IsSuccess returns true when this put tracks not found response has a 2xx status code func (o *PutTracksNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this put tracks not found response has a 3xx status code func (o *PutTracksNotFound) IsRedirect() bool { return false } // IsClientError returns true when this put tracks not found response has a 4xx status code func (o *PutTracksNotFound) IsClientError() bool { return true } // IsServerError returns true when this put tracks not found response has a 5xx status code func (o *PutTracksNotFound) IsServerError() bool { return false } // IsCode returns true when this put tracks not found response a status code equal to that given func (o *PutTracksNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the put tracks not found response func (o *PutTracksNotFound) Code() int { return 404 } func (o *PutTracksNotFound) Error() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksNotFound %+v", 404, o.Payload) } func (o *PutTracksNotFound) String() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksNotFound %+v", 404, o.Payload) } func (o *PutTracksNotFound) GetPayload() *members_models.Error { return o.Payload } func (o *PutTracksNotFound) 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 } // NewPutTracksUnprocessableEntity creates a PutTracksUnprocessableEntity with default headers values func NewPutTracksUnprocessableEntity() *PutTracksUnprocessableEntity { return &PutTracksUnprocessableEntity{} } /* PutTracksUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity, likely a bad parameter */ type PutTracksUnprocessableEntity struct { Payload *members_models.Error } // IsSuccess returns true when this put tracks unprocessable entity response has a 2xx status code func (o *PutTracksUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this put tracks unprocessable entity response has a 3xx status code func (o *PutTracksUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this put tracks unprocessable entity response has a 4xx status code func (o *PutTracksUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this put tracks unprocessable entity response has a 5xx status code func (o *PutTracksUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this put tracks unprocessable entity response a status code equal to that given func (o *PutTracksUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the put tracks unprocessable entity response func (o *PutTracksUnprocessableEntity) Code() int { return 422 } func (o *PutTracksUnprocessableEntity) Error() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksUnprocessableEntity %+v", 422, o.Payload) } func (o *PutTracksUnprocessableEntity) String() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksUnprocessableEntity %+v", 422, o.Payload) } func (o *PutTracksUnprocessableEntity) GetPayload() *members_models.Error { return o.Payload } func (o *PutTracksUnprocessableEntity) 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 } // NewPutTracksInternalServerError creates a PutTracksInternalServerError with default headers values func NewPutTracksInternalServerError() *PutTracksInternalServerError { return &PutTracksInternalServerError{} } /* PutTracksInternalServerError describes a response with status code 500, with default header values. Server Internal Error */ type PutTracksInternalServerError struct { Payload *members_models.Error } // IsSuccess returns true when this put tracks internal server error response has a 2xx status code func (o *PutTracksInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this put tracks internal server error response has a 3xx status code func (o *PutTracksInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this put tracks internal server error response has a 4xx status code func (o *PutTracksInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this put tracks internal server error response has a 5xx status code func (o *PutTracksInternalServerError) IsServerError() bool { return true } // IsCode returns true when this put tracks internal server error response a status code equal to that given func (o *PutTracksInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the put tracks internal server error response func (o *PutTracksInternalServerError) Code() int { return 500 } func (o *PutTracksInternalServerError) Error() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksInternalServerError %+v", 500, o.Payload) } func (o *PutTracksInternalServerError) String() string { return fmt.Sprintf("[PUT /tracks][%d] putTracksInternalServerError %+v", 500, o.Payload) } func (o *PutTracksInternalServerError) GetPayload() *members_models.Error { return o.Payload } func (o *PutTracksInternalServerError) 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 }