mirror of https://github.com/vernonkeenan/lib
487 lines
16 KiB
Go
487 lines
16 KiB
Go
|
// 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 lesson_progress
|
||
|
|
||
|
// 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/members/members_models"
|
||
|
)
|
||
|
|
||
|
// PostLessonProgressesReader is a Reader for the PostLessonProgresses structure.
|
||
|
type PostLessonProgressesReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *PostLessonProgressesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 200:
|
||
|
result := NewPostLessonProgressesOK()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 401:
|
||
|
result := NewPostLessonProgressesUnauthorized()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 403:
|
||
|
result := NewPostLessonProgressesForbidden()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 404:
|
||
|
result := NewPostLessonProgressesNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 422:
|
||
|
result := NewPostLessonProgressesUnprocessableEntity()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 500:
|
||
|
result := NewPostLessonProgressesInternalServerError()
|
||
|
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())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewPostLessonProgressesOK creates a PostLessonProgressesOK with default headers values
|
||
|
func NewPostLessonProgressesOK() *PostLessonProgressesOK {
|
||
|
return &PostLessonProgressesOK{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PostLessonProgressesOK describes a response with status code 200, with default header values.
|
||
|
|
||
|
LessonProgress Response Object
|
||
|
*/
|
||
|
type PostLessonProgressesOK struct {
|
||
|
Payload *members_models.LessonProgressResponse
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post lesson progresses o k response has a 2xx status code
|
||
|
func (o *PostLessonProgressesOK) IsSuccess() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post lesson progresses o k response has a 3xx status code
|
||
|
func (o *PostLessonProgressesOK) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post lesson progresses o k response has a 4xx status code
|
||
|
func (o *PostLessonProgressesOK) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post lesson progresses o k response has a 5xx status code
|
||
|
func (o *PostLessonProgressesOK) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post lesson progresses o k response a status code equal to that given
|
||
|
func (o *PostLessonProgressesOK) IsCode(code int) bool {
|
||
|
return code == 200
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post lesson progresses o k response
|
||
|
func (o *PostLessonProgressesOK) Code() int {
|
||
|
return 200
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesOK) Error() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesOK) String() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesOK) GetPayload() *members_models.LessonProgressResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
o.Payload = new(members_models.LessonProgressResponse)
|
||
|
|
||
|
// response payload
|
||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NewPostLessonProgressesUnauthorized creates a PostLessonProgressesUnauthorized with default headers values
|
||
|
func NewPostLessonProgressesUnauthorized() *PostLessonProgressesUnauthorized {
|
||
|
return &PostLessonProgressesUnauthorized{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PostLessonProgressesUnauthorized describes a response with status code 401, with default header values.
|
||
|
|
||
|
Access Unauthorized, invalid API-KEY was used
|
||
|
*/
|
||
|
type PostLessonProgressesUnauthorized struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post lesson progresses unauthorized response has a 2xx status code
|
||
|
func (o *PostLessonProgressesUnauthorized) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post lesson progresses unauthorized response has a 3xx status code
|
||
|
func (o *PostLessonProgressesUnauthorized) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post lesson progresses unauthorized response has a 4xx status code
|
||
|
func (o *PostLessonProgressesUnauthorized) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post lesson progresses unauthorized response has a 5xx status code
|
||
|
func (o *PostLessonProgressesUnauthorized) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post lesson progresses unauthorized response a status code equal to that given
|
||
|
func (o *PostLessonProgressesUnauthorized) IsCode(code int) bool {
|
||
|
return code == 401
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post lesson progresses unauthorized response
|
||
|
func (o *PostLessonProgressesUnauthorized) Code() int {
|
||
|
return 401
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesUnauthorized) Error() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesUnauthorized) String() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesUnauthorized) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesUnauthorized) 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
|
||
|
}
|
||
|
|
||
|
// NewPostLessonProgressesForbidden creates a PostLessonProgressesForbidden with default headers values
|
||
|
func NewPostLessonProgressesForbidden() *PostLessonProgressesForbidden {
|
||
|
return &PostLessonProgressesForbidden{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PostLessonProgressesForbidden describes a response with status code 403, with default header values.
|
||
|
|
||
|
Access forbidden, account lacks access
|
||
|
*/
|
||
|
type PostLessonProgressesForbidden struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post lesson progresses forbidden response has a 2xx status code
|
||
|
func (o *PostLessonProgressesForbidden) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post lesson progresses forbidden response has a 3xx status code
|
||
|
func (o *PostLessonProgressesForbidden) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post lesson progresses forbidden response has a 4xx status code
|
||
|
func (o *PostLessonProgressesForbidden) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post lesson progresses forbidden response has a 5xx status code
|
||
|
func (o *PostLessonProgressesForbidden) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post lesson progresses forbidden response a status code equal to that given
|
||
|
func (o *PostLessonProgressesForbidden) IsCode(code int) bool {
|
||
|
return code == 403
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post lesson progresses forbidden response
|
||
|
func (o *PostLessonProgressesForbidden) Code() int {
|
||
|
return 403
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesForbidden) Error() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesForbidden) String() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesForbidden) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesForbidden) 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
|
||
|
}
|
||
|
|
||
|
// NewPostLessonProgressesNotFound creates a PostLessonProgressesNotFound with default headers values
|
||
|
func NewPostLessonProgressesNotFound() *PostLessonProgressesNotFound {
|
||
|
return &PostLessonProgressesNotFound{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PostLessonProgressesNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
Resource was not found
|
||
|
*/
|
||
|
type PostLessonProgressesNotFound struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post lesson progresses not found response has a 2xx status code
|
||
|
func (o *PostLessonProgressesNotFound) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post lesson progresses not found response has a 3xx status code
|
||
|
func (o *PostLessonProgressesNotFound) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post lesson progresses not found response has a 4xx status code
|
||
|
func (o *PostLessonProgressesNotFound) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post lesson progresses not found response has a 5xx status code
|
||
|
func (o *PostLessonProgressesNotFound) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post lesson progresses not found response a status code equal to that given
|
||
|
func (o *PostLessonProgressesNotFound) IsCode(code int) bool {
|
||
|
return code == 404
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post lesson progresses not found response
|
||
|
func (o *PostLessonProgressesNotFound) Code() int {
|
||
|
return 404
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesNotFound) Error() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesNotFound) String() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesNotFound) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesNotFound) 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
|
||
|
}
|
||
|
|
||
|
// NewPostLessonProgressesUnprocessableEntity creates a PostLessonProgressesUnprocessableEntity with default headers values
|
||
|
func NewPostLessonProgressesUnprocessableEntity() *PostLessonProgressesUnprocessableEntity {
|
||
|
return &PostLessonProgressesUnprocessableEntity{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PostLessonProgressesUnprocessableEntity describes a response with status code 422, with default header values.
|
||
|
|
||
|
Unprocessable Entity, likely a bad parameter
|
||
|
*/
|
||
|
type PostLessonProgressesUnprocessableEntity struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post lesson progresses unprocessable entity response has a 2xx status code
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post lesson progresses unprocessable entity response has a 3xx status code
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post lesson progresses unprocessable entity response has a 4xx status code
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post lesson progresses unprocessable entity response has a 5xx status code
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post lesson progresses unprocessable entity response a status code equal to that given
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) IsCode(code int) bool {
|
||
|
return code == 422
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post lesson progresses unprocessable entity response
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) Code() int {
|
||
|
return 422
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) Error() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) String() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesUnprocessableEntity) 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
|
||
|
}
|
||
|
|
||
|
// NewPostLessonProgressesInternalServerError creates a PostLessonProgressesInternalServerError with default headers values
|
||
|
func NewPostLessonProgressesInternalServerError() *PostLessonProgressesInternalServerError {
|
||
|
return &PostLessonProgressesInternalServerError{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
PostLessonProgressesInternalServerError describes a response with status code 500, with default header values.
|
||
|
|
||
|
Server Internal Error
|
||
|
*/
|
||
|
type PostLessonProgressesInternalServerError struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this post lesson progresses internal server error response has a 2xx status code
|
||
|
func (o *PostLessonProgressesInternalServerError) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this post lesson progresses internal server error response has a 3xx status code
|
||
|
func (o *PostLessonProgressesInternalServerError) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this post lesson progresses internal server error response has a 4xx status code
|
||
|
func (o *PostLessonProgressesInternalServerError) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this post lesson progresses internal server error response has a 5xx status code
|
||
|
func (o *PostLessonProgressesInternalServerError) IsServerError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this post lesson progresses internal server error response a status code equal to that given
|
||
|
func (o *PostLessonProgressesInternalServerError) IsCode(code int) bool {
|
||
|
return code == 500
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the post lesson progresses internal server error response
|
||
|
func (o *PostLessonProgressesInternalServerError) Code() int {
|
||
|
return 500
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesInternalServerError) String() string {
|
||
|
return fmt.Sprintf("[POST /lessonprogress][%d] postLessonProgressesInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesInternalServerError) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *PostLessonProgressesInternalServerError) 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
|
||
|
}
|