lib/api/members/members_client/lesson_progress/put_lesson_progresses_respo...

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"
)
// PutLessonProgressesReader is a Reader for the PutLessonProgresses structure.
type PutLessonProgressesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutLessonProgressesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutLessonProgressesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutLessonProgressesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutLessonProgressesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutLessonProgressesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPutLessonProgressesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutLessonProgressesInternalServerError()
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())
}
}
// NewPutLessonProgressesOK creates a PutLessonProgressesOK with default headers values
func NewPutLessonProgressesOK() *PutLessonProgressesOK {
return &PutLessonProgressesOK{}
}
/*
PutLessonProgressesOK describes a response with status code 200, with default header values.
LessonProgress Response Object
*/
type PutLessonProgressesOK struct {
Payload *members_models.LessonProgressResponse
}
// IsSuccess returns true when this put lesson progresses o k response has a 2xx status code
func (o *PutLessonProgressesOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this put lesson progresses o k response has a 3xx status code
func (o *PutLessonProgressesOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this put lesson progresses o k response has a 4xx status code
func (o *PutLessonProgressesOK) IsClientError() bool {
return false
}
// IsServerError returns true when this put lesson progresses o k response has a 5xx status code
func (o *PutLessonProgressesOK) IsServerError() bool {
return false
}
// IsCode returns true when this put lesson progresses o k response a status code equal to that given
func (o *PutLessonProgressesOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the put lesson progresses o k response
func (o *PutLessonProgressesOK) Code() int {
return 200
}
func (o *PutLessonProgressesOK) Error() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesOK %+v", 200, o.Payload)
}
func (o *PutLessonProgressesOK) String() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesOK %+v", 200, o.Payload)
}
func (o *PutLessonProgressesOK) GetPayload() *members_models.LessonProgressResponse {
return o.Payload
}
func (o *PutLessonProgressesOK) 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
}
// NewPutLessonProgressesUnauthorized creates a PutLessonProgressesUnauthorized with default headers values
func NewPutLessonProgressesUnauthorized() *PutLessonProgressesUnauthorized {
return &PutLessonProgressesUnauthorized{}
}
/*
PutLessonProgressesUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PutLessonProgressesUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put lesson progresses unauthorized response has a 2xx status code
func (o *PutLessonProgressesUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put lesson progresses unauthorized response has a 3xx status code
func (o *PutLessonProgressesUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this put lesson progresses unauthorized response has a 4xx status code
func (o *PutLessonProgressesUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this put lesson progresses unauthorized response has a 5xx status code
func (o *PutLessonProgressesUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this put lesson progresses unauthorized response a status code equal to that given
func (o *PutLessonProgressesUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the put lesson progresses unauthorized response
func (o *PutLessonProgressesUnauthorized) Code() int {
return 401
}
func (o *PutLessonProgressesUnauthorized) Error() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesUnauthorized %+v", 401, o.Payload)
}
func (o *PutLessonProgressesUnauthorized) String() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesUnauthorized %+v", 401, o.Payload)
}
func (o *PutLessonProgressesUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutLessonProgressesUnauthorized) 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
}
// NewPutLessonProgressesForbidden creates a PutLessonProgressesForbidden with default headers values
func NewPutLessonProgressesForbidden() *PutLessonProgressesForbidden {
return &PutLessonProgressesForbidden{}
}
/*
PutLessonProgressesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PutLessonProgressesForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this put lesson progresses forbidden response has a 2xx status code
func (o *PutLessonProgressesForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put lesson progresses forbidden response has a 3xx status code
func (o *PutLessonProgressesForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this put lesson progresses forbidden response has a 4xx status code
func (o *PutLessonProgressesForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this put lesson progresses forbidden response has a 5xx status code
func (o *PutLessonProgressesForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this put lesson progresses forbidden response a status code equal to that given
func (o *PutLessonProgressesForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the put lesson progresses forbidden response
func (o *PutLessonProgressesForbidden) Code() int {
return 403
}
func (o *PutLessonProgressesForbidden) Error() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesForbidden %+v", 403, o.Payload)
}
func (o *PutLessonProgressesForbidden) String() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesForbidden %+v", 403, o.Payload)
}
func (o *PutLessonProgressesForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutLessonProgressesForbidden) 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
}
// NewPutLessonProgressesNotFound creates a PutLessonProgressesNotFound with default headers values
func NewPutLessonProgressesNotFound() *PutLessonProgressesNotFound {
return &PutLessonProgressesNotFound{}
}
/*
PutLessonProgressesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PutLessonProgressesNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put lesson progresses not found response has a 2xx status code
func (o *PutLessonProgressesNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put lesson progresses not found response has a 3xx status code
func (o *PutLessonProgressesNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this put lesson progresses not found response has a 4xx status code
func (o *PutLessonProgressesNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this put lesson progresses not found response has a 5xx status code
func (o *PutLessonProgressesNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this put lesson progresses not found response a status code equal to that given
func (o *PutLessonProgressesNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the put lesson progresses not found response
func (o *PutLessonProgressesNotFound) Code() int {
return 404
}
func (o *PutLessonProgressesNotFound) Error() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesNotFound %+v", 404, o.Payload)
}
func (o *PutLessonProgressesNotFound) String() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesNotFound %+v", 404, o.Payload)
}
func (o *PutLessonProgressesNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutLessonProgressesNotFound) 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
}
// NewPutLessonProgressesUnprocessableEntity creates a PutLessonProgressesUnprocessableEntity with default headers values
func NewPutLessonProgressesUnprocessableEntity() *PutLessonProgressesUnprocessableEntity {
return &PutLessonProgressesUnprocessableEntity{}
}
/*
PutLessonProgressesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PutLessonProgressesUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put lesson progresses unprocessable entity response has a 2xx status code
func (o *PutLessonProgressesUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put lesson progresses unprocessable entity response has a 3xx status code
func (o *PutLessonProgressesUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this put lesson progresses unprocessable entity response has a 4xx status code
func (o *PutLessonProgressesUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this put lesson progresses unprocessable entity response has a 5xx status code
func (o *PutLessonProgressesUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this put lesson progresses unprocessable entity response a status code equal to that given
func (o *PutLessonProgressesUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the put lesson progresses unprocessable entity response
func (o *PutLessonProgressesUnprocessableEntity) Code() int {
return 422
}
func (o *PutLessonProgressesUnprocessableEntity) Error() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutLessonProgressesUnprocessableEntity) String() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PutLessonProgressesUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutLessonProgressesUnprocessableEntity) 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
}
// NewPutLessonProgressesInternalServerError creates a PutLessonProgressesInternalServerError with default headers values
func NewPutLessonProgressesInternalServerError() *PutLessonProgressesInternalServerError {
return &PutLessonProgressesInternalServerError{}
}
/*
PutLessonProgressesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PutLessonProgressesInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this put lesson progresses internal server error response has a 2xx status code
func (o *PutLessonProgressesInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this put lesson progresses internal server error response has a 3xx status code
func (o *PutLessonProgressesInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this put lesson progresses internal server error response has a 4xx status code
func (o *PutLessonProgressesInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this put lesson progresses internal server error response has a 5xx status code
func (o *PutLessonProgressesInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this put lesson progresses internal server error response a status code equal to that given
func (o *PutLessonProgressesInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the put lesson progresses internal server error response
func (o *PutLessonProgressesInternalServerError) Code() int {
return 500
}
func (o *PutLessonProgressesInternalServerError) Error() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesInternalServerError %+v", 500, o.Payload)
}
func (o *PutLessonProgressesInternalServerError) String() string {
return fmt.Sprintf("[PUT /lessonprogress][%d] putLessonProgressesInternalServerError %+v", 500, o.Payload)
}
func (o *PutLessonProgressesInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PutLessonProgressesInternalServerError) 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
}