lib/api/sfgate/sfgate_client/courses/post_course_lesson_response...

476 lines
15 KiB
Go
Raw Normal View History

2023-04-30 02:07:31 +00:00
// 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"
2023-04-30 02:07:31 +00:00
"fmt"
"io"
"code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models"
2023-04-30 02:07:31 +00:00
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// 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) (any, error) {
2023-04-30 02:07:31 +00:00
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("[POST /courselessons] postCourseLesson", response, response.Code())
2023-04-30 02:07:31 +00:00
}
}
// 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
2023-04-30 02:07:31 +00:00
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 {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonOK %s", 200, payload)
2023-04-30 02:07:31 +00:00
}
func (o *PostCourseLessonOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonOK %s", 200, payload)
2023-04-30 02:07:31 +00:00
}
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 && !stderrors.Is(err, io.EOF) {
2023-04-30 02:07:31 +00:00
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
2023-04-30 02:07:31 +00:00
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 {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonUnauthorized %s", 401, payload)
2023-04-30 02:07:31 +00:00
}
func (o *PostCourseLessonUnauthorized) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonUnauthorized %s", 401, payload)
2023-04-30 02:07:31 +00:00
}
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 && !stderrors.Is(err, io.EOF) {
2023-04-30 02:07:31 +00:00
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
2023-04-30 02:07:31 +00:00
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 {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonForbidden %s", 403, payload)
2023-04-30 02:07:31 +00:00
}
func (o *PostCourseLessonForbidden) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonForbidden %s", 403, payload)
2023-04-30 02:07:31 +00:00
}
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 && !stderrors.Is(err, io.EOF) {
2023-04-30 02:07:31 +00:00
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
2023-04-30 02:07:31 +00:00
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 {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonNotFound %s", 404, payload)
2023-04-30 02:07:31 +00:00
}
func (o *PostCourseLessonNotFound) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonNotFound %s", 404, payload)
2023-04-30 02:07:31 +00:00
}
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 && !stderrors.Is(err, io.EOF) {
2023-04-30 02:07:31 +00:00
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
2023-04-30 02:07:31 +00:00
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 {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonUnprocessableEntity %s", 422, payload)
2023-04-30 02:07:31 +00:00
}
func (o *PostCourseLessonUnprocessableEntity) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonUnprocessableEntity %s", 422, payload)
2023-04-30 02:07:31 +00:00
}
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 && !stderrors.Is(err, io.EOF) {
2023-04-30 02:07:31 +00:00
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
2023-04-30 02:07:31 +00:00
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 {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonInternalServerError %s", 500, payload)
2023-04-30 02:07:31 +00:00
}
func (o *PostCourseLessonInternalServerError) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /courselessons][%d] postCourseLessonInternalServerError %s", 500, payload)
2023-04-30 02:07:31 +00:00
}
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 && !stderrors.Is(err, io.EOF) {
2023-04-30 02:07:31 +00:00
return err
}
return nil
}