// 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 // 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/vernonkeenan/lib/api/sfgate/sfgate_models" ) // PostCourseLessonReader is a Reader for the PostCourseLesson structure. type PostCourseLessonReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *PostCourseLessonReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewPostCourseLessonOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewPostCourseLessonUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewPostCourseLessonForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewPostCourseLessonNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewPostCourseLessonUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewPostCourseLessonInternalServerError() 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()) } } // NewPostCourseLessonOK creates a PostCourseLessonOK with default headers values func NewPostCourseLessonOK() *PostCourseLessonOK { return &PostCourseLessonOK{} } /* PostCourseLessonOK describes a response with status code 200, with default header values. CourseLesson Response Object */ type PostCourseLessonOK struct { Payload *sfgate_models.CourseLessonResponse } // IsSuccess returns true when this post course lesson o k response has a 2xx status code func (o *PostCourseLessonOK) IsSuccess() bool { return true } // IsRedirect returns true when this post course lesson o k response has a 3xx status code func (o *PostCourseLessonOK) IsRedirect() bool { return false } // IsClientError returns true when this post course lesson o k response has a 4xx status code func (o *PostCourseLessonOK) IsClientError() bool { return false } // IsServerError returns true when this post course lesson o k response has a 5xx status code func (o *PostCourseLessonOK) IsServerError() bool { return false } // IsCode returns true when this post course lesson o k response a status code equal to that given func (o *PostCourseLessonOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the post course lesson o k response func (o *PostCourseLessonOK) Code() int { return 200 } func (o *PostCourseLessonOK) Error() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonOK %+v", 200, o.Payload) } func (o *PostCourseLessonOK) String() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonOK %+v", 200, o.Payload) } func (o *PostCourseLessonOK) GetPayload() *sfgate_models.CourseLessonResponse { return o.Payload } func (o *PostCourseLessonOK) 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 && err != io.EOF { return err } return nil } // NewPostCourseLessonUnauthorized creates a PostCourseLessonUnauthorized with default headers values func NewPostCourseLessonUnauthorized() *PostCourseLessonUnauthorized { return &PostCourseLessonUnauthorized{} } /* PostCourseLessonUnauthorized describes a response with status code 401, with default header values. Access unauthorized, invalid API-KEY was used */ type PostCourseLessonUnauthorized struct { Payload *sfgate_models.Error } // IsSuccess returns true when this post course lesson unauthorized response has a 2xx status code func (o *PostCourseLessonUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this post course lesson unauthorized response has a 3xx status code func (o *PostCourseLessonUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this post course lesson unauthorized response has a 4xx status code func (o *PostCourseLessonUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this post course lesson unauthorized response has a 5xx status code func (o *PostCourseLessonUnauthorized) IsServerError() bool { return false } // IsCode returns true when this post course lesson unauthorized response a status code equal to that given func (o *PostCourseLessonUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the post course lesson unauthorized response func (o *PostCourseLessonUnauthorized) Code() int { return 401 } func (o *PostCourseLessonUnauthorized) Error() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonUnauthorized %+v", 401, o.Payload) } func (o *PostCourseLessonUnauthorized) String() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonUnauthorized %+v", 401, o.Payload) } func (o *PostCourseLessonUnauthorized) GetPayload() *sfgate_models.Error { return o.Payload } func (o *PostCourseLessonUnauthorized) 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 && err != io.EOF { return err } return nil } // NewPostCourseLessonForbidden creates a PostCourseLessonForbidden with default headers values func NewPostCourseLessonForbidden() *PostCourseLessonForbidden { return &PostCourseLessonForbidden{} } /* PostCourseLessonForbidden describes a response with status code 403, with default header values. Access forbidden, account lacks access */ type PostCourseLessonForbidden struct { Payload *sfgate_models.Error } // IsSuccess returns true when this post course lesson forbidden response has a 2xx status code func (o *PostCourseLessonForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this post course lesson forbidden response has a 3xx status code func (o *PostCourseLessonForbidden) IsRedirect() bool { return false } // IsClientError returns true when this post course lesson forbidden response has a 4xx status code func (o *PostCourseLessonForbidden) IsClientError() bool { return true } // IsServerError returns true when this post course lesson forbidden response has a 5xx status code func (o *PostCourseLessonForbidden) IsServerError() bool { return false } // IsCode returns true when this post course lesson forbidden response a status code equal to that given func (o *PostCourseLessonForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the post course lesson forbidden response func (o *PostCourseLessonForbidden) Code() int { return 403 } func (o *PostCourseLessonForbidden) Error() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonForbidden %+v", 403, o.Payload) } func (o *PostCourseLessonForbidden) String() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonForbidden %+v", 403, o.Payload) } func (o *PostCourseLessonForbidden) GetPayload() *sfgate_models.Error { return o.Payload } func (o *PostCourseLessonForbidden) 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 && err != io.EOF { return err } return nil } // NewPostCourseLessonNotFound creates a PostCourseLessonNotFound with default headers values func NewPostCourseLessonNotFound() *PostCourseLessonNotFound { return &PostCourseLessonNotFound{} } /* PostCourseLessonNotFound describes a response with status code 404, with default header values. Resource was not found */ type PostCourseLessonNotFound struct { Payload *sfgate_models.Error } // IsSuccess returns true when this post course lesson not found response has a 2xx status code func (o *PostCourseLessonNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this post course lesson not found response has a 3xx status code func (o *PostCourseLessonNotFound) IsRedirect() bool { return false } // IsClientError returns true when this post course lesson not found response has a 4xx status code func (o *PostCourseLessonNotFound) IsClientError() bool { return true } // IsServerError returns true when this post course lesson not found response has a 5xx status code func (o *PostCourseLessonNotFound) IsServerError() bool { return false } // IsCode returns true when this post course lesson not found response a status code equal to that given func (o *PostCourseLessonNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the post course lesson not found response func (o *PostCourseLessonNotFound) Code() int { return 404 } func (o *PostCourseLessonNotFound) Error() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonNotFound %+v", 404, o.Payload) } func (o *PostCourseLessonNotFound) String() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonNotFound %+v", 404, o.Payload) } func (o *PostCourseLessonNotFound) GetPayload() *sfgate_models.Error { return o.Payload } func (o *PostCourseLessonNotFound) 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 && err != io.EOF { return err } return nil } // NewPostCourseLessonUnprocessableEntity creates a PostCourseLessonUnprocessableEntity with default headers values func NewPostCourseLessonUnprocessableEntity() *PostCourseLessonUnprocessableEntity { return &PostCourseLessonUnprocessableEntity{} } /* PostCourseLessonUnprocessableEntity describes a response with status code 422, with default header values. Unprocessable Entity, likely a bad parameter */ type PostCourseLessonUnprocessableEntity struct { Payload *sfgate_models.Error } // IsSuccess returns true when this post course lesson unprocessable entity response has a 2xx status code func (o *PostCourseLessonUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this post course lesson unprocessable entity response has a 3xx status code func (o *PostCourseLessonUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this post course lesson unprocessable entity response has a 4xx status code func (o *PostCourseLessonUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this post course lesson unprocessable entity response has a 5xx status code func (o *PostCourseLessonUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this post course lesson unprocessable entity response a status code equal to that given func (o *PostCourseLessonUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the post course lesson unprocessable entity response func (o *PostCourseLessonUnprocessableEntity) Code() int { return 422 } func (o *PostCourseLessonUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonUnprocessableEntity %+v", 422, o.Payload) } func (o *PostCourseLessonUnprocessableEntity) String() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonUnprocessableEntity %+v", 422, o.Payload) } func (o *PostCourseLessonUnprocessableEntity) GetPayload() *sfgate_models.Error { return o.Payload } func (o *PostCourseLessonUnprocessableEntity) 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 && err != io.EOF { return err } return nil } // NewPostCourseLessonInternalServerError creates a PostCourseLessonInternalServerError with default headers values func NewPostCourseLessonInternalServerError() *PostCourseLessonInternalServerError { return &PostCourseLessonInternalServerError{} } /* PostCourseLessonInternalServerError describes a response with status code 500, with default header values. Server Internal Error */ type PostCourseLessonInternalServerError struct { Payload *sfgate_models.Error } // IsSuccess returns true when this post course lesson internal server error response has a 2xx status code func (o *PostCourseLessonInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this post course lesson internal server error response has a 3xx status code func (o *PostCourseLessonInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this post course lesson internal server error response has a 4xx status code func (o *PostCourseLessonInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this post course lesson internal server error response has a 5xx status code func (o *PostCourseLessonInternalServerError) IsServerError() bool { return true } // IsCode returns true when this post course lesson internal server error response a status code equal to that given func (o *PostCourseLessonInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the post course lesson internal server error response func (o *PostCourseLessonInternalServerError) Code() int { return 500 } func (o *PostCourseLessonInternalServerError) Error() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonInternalServerError %+v", 500, o.Payload) } func (o *PostCourseLessonInternalServerError) String() string { return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonInternalServerError %+v", 500, o.Payload) } func (o *PostCourseLessonInternalServerError) GetPayload() *sfgate_models.Error { return o.Payload } func (o *PostCourseLessonInternalServerError) 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 && err != io.EOF { return err } return nil }