// 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 courses import ( "encoding/json" stderrors "errors" "fmt" "io" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" ) // UpdateCourseLessonReader is a Reader for the UpdateCourseLesson structure. type UpdateCourseLessonReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *UpdateCourseLessonReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewUpdateCourseLessonOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewUpdateCourseLessonUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewUpdateCourseLessonForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewUpdateCourseLessonNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewUpdateCourseLessonUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewUpdateCourseLessonInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("[PUT /courselessons] updateCourseLesson", response, response.Code()) } } // NewUpdateCourseLessonOK creates a UpdateCourseLessonOK with default headers values func NewUpdateCourseLessonOK() *UpdateCourseLessonOK { return &UpdateCourseLessonOK{} } // UpdateCourseLessonOK describes a response with status code 200, with default header values. // // CourseLesson Response Object type UpdateCourseLessonOK struct { Payload *sfgate_models.CourseLessonResponse } // IsSuccess returns true when this update course lesson o k response has a 2xx status code func (o *UpdateCourseLessonOK) IsSuccess() bool { return true } // IsRedirect returns true when this update course lesson o k response has a 3xx status code func (o *UpdateCourseLessonOK) IsRedirect() bool { return false } // IsClientError returns true when this update course lesson o k response has a 4xx status code func (o *UpdateCourseLessonOK) IsClientError() bool { return false } // IsServerError returns true when this update course lesson o k response has a 5xx status code func (o *UpdateCourseLessonOK) IsServerError() bool { return false } // IsCode returns true when this update course lesson o k response a status code equal to that given func (o *UpdateCourseLessonOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the update course lesson o k response func (o *UpdateCourseLessonOK) Code() int { return 200 } func (o *UpdateCourseLessonOK) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonOK %s", 200, payload) } func (o *UpdateCourseLessonOK) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonOK %s", 200, payload) } func (o *UpdateCourseLessonOK) GetPayload() *sfgate_models.CourseLessonResponse { return o.Payload } func (o *UpdateCourseLessonOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sfgate_models.CourseLessonResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewUpdateCourseLessonUnauthorized creates a UpdateCourseLessonUnauthorized with default headers values func NewUpdateCourseLessonUnauthorized() *UpdateCourseLessonUnauthorized { return &UpdateCourseLessonUnauthorized{} } // UpdateCourseLessonUnauthorized describes a response with status code 401, with default header values. // // Access unauthorized, invalid API-KEY was used type UpdateCourseLessonUnauthorized struct { Payload *sfgate_models.Error } // IsSuccess returns true when this update course lesson unauthorized response has a 2xx status code func (o *UpdateCourseLessonUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this update course lesson unauthorized response has a 3xx status code func (o *UpdateCourseLessonUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this update course lesson unauthorized response has a 4xx status code func (o *UpdateCourseLessonUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this update course lesson unauthorized response has a 5xx status code func (o *UpdateCourseLessonUnauthorized) IsServerError() bool { return false } // IsCode returns true when this update course lesson unauthorized response a status code equal to that given func (o *UpdateCourseLessonUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the update course lesson unauthorized response func (o *UpdateCourseLessonUnauthorized) Code() int { return 401 } func (o *UpdateCourseLessonUnauthorized) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonUnauthorized %s", 401, payload) } func (o *UpdateCourseLessonUnauthorized) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonUnauthorized %s", 401, payload) } func (o *UpdateCourseLessonUnauthorized) GetPayload() *sfgate_models.Error { return o.Payload } func (o *UpdateCourseLessonUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewUpdateCourseLessonForbidden creates a UpdateCourseLessonForbidden with default headers values func NewUpdateCourseLessonForbidden() *UpdateCourseLessonForbidden { return &UpdateCourseLessonForbidden{} } // UpdateCourseLessonForbidden describes a response with status code 403, with default header values. // // Access forbidden, account lacks access type UpdateCourseLessonForbidden struct { Payload *sfgate_models.Error } // IsSuccess returns true when this update course lesson forbidden response has a 2xx status code func (o *UpdateCourseLessonForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this update course lesson forbidden response has a 3xx status code func (o *UpdateCourseLessonForbidden) IsRedirect() bool { return false } // IsClientError returns true when this update course lesson forbidden response has a 4xx status code func (o *UpdateCourseLessonForbidden) IsClientError() bool { return true } // IsServerError returns true when this update course lesson forbidden response has a 5xx status code func (o *UpdateCourseLessonForbidden) IsServerError() bool { return false } // IsCode returns true when this update course lesson forbidden response a status code equal to that given func (o *UpdateCourseLessonForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the update course lesson forbidden response func (o *UpdateCourseLessonForbidden) Code() int { return 403 } func (o *UpdateCourseLessonForbidden) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonForbidden %s", 403, payload) } func (o *UpdateCourseLessonForbidden) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonForbidden %s", 403, payload) } func (o *UpdateCourseLessonForbidden) GetPayload() *sfgate_models.Error { return o.Payload } func (o *UpdateCourseLessonForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewUpdateCourseLessonNotFound creates a UpdateCourseLessonNotFound with default headers values func NewUpdateCourseLessonNotFound() *UpdateCourseLessonNotFound { return &UpdateCourseLessonNotFound{} } // UpdateCourseLessonNotFound describes a response with status code 404, with default header values. // // Resource was not found type UpdateCourseLessonNotFound struct { Payload *sfgate_models.Error } // IsSuccess returns true when this update course lesson not found response has a 2xx status code func (o *UpdateCourseLessonNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this update course lesson not found response has a 3xx status code func (o *UpdateCourseLessonNotFound) IsRedirect() bool { return false } // IsClientError returns true when this update course lesson not found response has a 4xx status code func (o *UpdateCourseLessonNotFound) IsClientError() bool { return true } // IsServerError returns true when this update course lesson not found response has a 5xx status code func (o *UpdateCourseLessonNotFound) IsServerError() bool { return false } // IsCode returns true when this update course lesson not found response a status code equal to that given func (o *UpdateCourseLessonNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the update course lesson not found response func (o *UpdateCourseLessonNotFound) Code() int { return 404 } func (o *UpdateCourseLessonNotFound) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonNotFound %s", 404, payload) } func (o *UpdateCourseLessonNotFound) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonNotFound %s", 404, payload) } func (o *UpdateCourseLessonNotFound) GetPayload() *sfgate_models.Error { return o.Payload } func (o *UpdateCourseLessonNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewUpdateCourseLessonUnprocessableEntity creates a UpdateCourseLessonUnprocessableEntity with default headers values func NewUpdateCourseLessonUnprocessableEntity() *UpdateCourseLessonUnprocessableEntity { return &UpdateCourseLessonUnprocessableEntity{} } // UpdateCourseLessonUnprocessableEntity describes a response with status code 422, with default header values. // // Unprocessable Entity, likely a bad parameter type UpdateCourseLessonUnprocessableEntity struct { Payload *sfgate_models.Error } // IsSuccess returns true when this update course lesson unprocessable entity response has a 2xx status code func (o *UpdateCourseLessonUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this update course lesson unprocessable entity response has a 3xx status code func (o *UpdateCourseLessonUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this update course lesson unprocessable entity response has a 4xx status code func (o *UpdateCourseLessonUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this update course lesson unprocessable entity response has a 5xx status code func (o *UpdateCourseLessonUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this update course lesson unprocessable entity response a status code equal to that given func (o *UpdateCourseLessonUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the update course lesson unprocessable entity response func (o *UpdateCourseLessonUnprocessableEntity) Code() int { return 422 } func (o *UpdateCourseLessonUnprocessableEntity) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonUnprocessableEntity %s", 422, payload) } func (o *UpdateCourseLessonUnprocessableEntity) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonUnprocessableEntity %s", 422, payload) } func (o *UpdateCourseLessonUnprocessableEntity) GetPayload() *sfgate_models.Error { return o.Payload } func (o *UpdateCourseLessonUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil } // NewUpdateCourseLessonInternalServerError creates a UpdateCourseLessonInternalServerError with default headers values func NewUpdateCourseLessonInternalServerError() *UpdateCourseLessonInternalServerError { return &UpdateCourseLessonInternalServerError{} } // UpdateCourseLessonInternalServerError describes a response with status code 500, with default header values. // // Server Internal Error type UpdateCourseLessonInternalServerError struct { Payload *sfgate_models.Error } // IsSuccess returns true when this update course lesson internal server error response has a 2xx status code func (o *UpdateCourseLessonInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this update course lesson internal server error response has a 3xx status code func (o *UpdateCourseLessonInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this update course lesson internal server error response has a 4xx status code func (o *UpdateCourseLessonInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this update course lesson internal server error response has a 5xx status code func (o *UpdateCourseLessonInternalServerError) IsServerError() bool { return true } // IsCode returns true when this update course lesson internal server error response a status code equal to that given func (o *UpdateCourseLessonInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the update course lesson internal server error response func (o *UpdateCourseLessonInternalServerError) Code() int { return 500 } func (o *UpdateCourseLessonInternalServerError) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonInternalServerError %s", 500, payload) } func (o *UpdateCourseLessonInternalServerError) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[PUT /courselessons][%d] updateCourseLessonInternalServerError %s", 500, payload) } func (o *UpdateCourseLessonInternalServerError) GetPayload() *sfgate_models.Error { return o.Payload } func (o *UpdateCourseLessonInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(sfgate_models.Error) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } return nil }