lib/api/members/members_client/courses/post_courses_responses.go

487 lines
14 KiB
Go
Raw Permalink Normal View History

2023-09-23 17:19:44 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2023 by Vernon Keenan
// 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/work/lib/api/members/members_models"
)
// PostCoursesReader is a Reader for the PostCourses structure.
type PostCoursesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostCoursesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostCoursesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostCoursesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostCoursesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostCoursesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostCoursesUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostCoursesInternalServerError()
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())
}
}
// NewPostCoursesOK creates a PostCoursesOK with default headers values
func NewPostCoursesOK() *PostCoursesOK {
return &PostCoursesOK{}
}
/*
PostCoursesOK describes a response with status code 200, with default header values.
Course Response Object
*/
type PostCoursesOK struct {
Payload *members_models.CourseResponse
}
// IsSuccess returns true when this post courses o k response has a 2xx status code
func (o *PostCoursesOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post courses o k response has a 3xx status code
func (o *PostCoursesOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post courses o k response has a 4xx status code
func (o *PostCoursesOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post courses o k response has a 5xx status code
func (o *PostCoursesOK) IsServerError() bool {
return false
}
// IsCode returns true when this post courses o k response a status code equal to that given
func (o *PostCoursesOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post courses o k response
func (o *PostCoursesOK) Code() int {
return 200
}
func (o *PostCoursesOK) Error() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesOK %+v", 200, o.Payload)
}
func (o *PostCoursesOK) String() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesOK %+v", 200, o.Payload)
}
func (o *PostCoursesOK) GetPayload() *members_models.CourseResponse {
return o.Payload
}
func (o *PostCoursesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(members_models.CourseResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostCoursesUnauthorized creates a PostCoursesUnauthorized with default headers values
func NewPostCoursesUnauthorized() *PostCoursesUnauthorized {
return &PostCoursesUnauthorized{}
}
/*
PostCoursesUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostCoursesUnauthorized struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post courses unauthorized response has a 2xx status code
func (o *PostCoursesUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post courses unauthorized response has a 3xx status code
func (o *PostCoursesUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post courses unauthorized response has a 4xx status code
func (o *PostCoursesUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post courses unauthorized response has a 5xx status code
func (o *PostCoursesUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post courses unauthorized response a status code equal to that given
func (o *PostCoursesUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post courses unauthorized response
func (o *PostCoursesUnauthorized) Code() int {
return 401
}
func (o *PostCoursesUnauthorized) Error() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesUnauthorized %+v", 401, o.Payload)
}
func (o *PostCoursesUnauthorized) String() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesUnauthorized %+v", 401, o.Payload)
}
func (o *PostCoursesUnauthorized) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostCoursesUnauthorized) 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
}
// NewPostCoursesForbidden creates a PostCoursesForbidden with default headers values
func NewPostCoursesForbidden() *PostCoursesForbidden {
return &PostCoursesForbidden{}
}
/*
PostCoursesForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostCoursesForbidden struct {
AccessControlAllowOrigin string
Payload *members_models.Error
}
// IsSuccess returns true when this post courses forbidden response has a 2xx status code
func (o *PostCoursesForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post courses forbidden response has a 3xx status code
func (o *PostCoursesForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post courses forbidden response has a 4xx status code
func (o *PostCoursesForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post courses forbidden response has a 5xx status code
func (o *PostCoursesForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post courses forbidden response a status code equal to that given
func (o *PostCoursesForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post courses forbidden response
func (o *PostCoursesForbidden) Code() int {
return 403
}
func (o *PostCoursesForbidden) Error() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesForbidden %+v", 403, o.Payload)
}
func (o *PostCoursesForbidden) String() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesForbidden %+v", 403, o.Payload)
}
func (o *PostCoursesForbidden) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostCoursesForbidden) 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
}
// NewPostCoursesNotFound creates a PostCoursesNotFound with default headers values
func NewPostCoursesNotFound() *PostCoursesNotFound {
return &PostCoursesNotFound{}
}
/*
PostCoursesNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostCoursesNotFound struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post courses not found response has a 2xx status code
func (o *PostCoursesNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post courses not found response has a 3xx status code
func (o *PostCoursesNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post courses not found response has a 4xx status code
func (o *PostCoursesNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post courses not found response has a 5xx status code
func (o *PostCoursesNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post courses not found response a status code equal to that given
func (o *PostCoursesNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post courses not found response
func (o *PostCoursesNotFound) Code() int {
return 404
}
func (o *PostCoursesNotFound) Error() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesNotFound %+v", 404, o.Payload)
}
func (o *PostCoursesNotFound) String() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesNotFound %+v", 404, o.Payload)
}
func (o *PostCoursesNotFound) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostCoursesNotFound) 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
}
// NewPostCoursesUnprocessableEntity creates a PostCoursesUnprocessableEntity with default headers values
func NewPostCoursesUnprocessableEntity() *PostCoursesUnprocessableEntity {
return &PostCoursesUnprocessableEntity{}
}
/*
PostCoursesUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostCoursesUnprocessableEntity struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post courses unprocessable entity response has a 2xx status code
func (o *PostCoursesUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post courses unprocessable entity response has a 3xx status code
func (o *PostCoursesUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post courses unprocessable entity response has a 4xx status code
func (o *PostCoursesUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post courses unprocessable entity response has a 5xx status code
func (o *PostCoursesUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post courses unprocessable entity response a status code equal to that given
func (o *PostCoursesUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post courses unprocessable entity response
func (o *PostCoursesUnprocessableEntity) Code() int {
return 422
}
func (o *PostCoursesUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostCoursesUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostCoursesUnprocessableEntity) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostCoursesUnprocessableEntity) 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
}
// NewPostCoursesInternalServerError creates a PostCoursesInternalServerError with default headers values
func NewPostCoursesInternalServerError() *PostCoursesInternalServerError {
return &PostCoursesInternalServerError{}
}
/*
PostCoursesInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostCoursesInternalServerError struct {
Payload *members_models.Error
}
// IsSuccess returns true when this post courses internal server error response has a 2xx status code
func (o *PostCoursesInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post courses internal server error response has a 3xx status code
func (o *PostCoursesInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post courses internal server error response has a 4xx status code
func (o *PostCoursesInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post courses internal server error response has a 5xx status code
func (o *PostCoursesInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post courses internal server error response a status code equal to that given
func (o *PostCoursesInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post courses internal server error response
func (o *PostCoursesInternalServerError) Code() int {
return 500
}
func (o *PostCoursesInternalServerError) Error() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesInternalServerError %+v", 500, o.Payload)
}
func (o *PostCoursesInternalServerError) String() string {
return fmt.Sprintf("[POST /courses][%d] postCoursesInternalServerError %+v", 500, o.Payload)
}
func (o *PostCoursesInternalServerError) GetPayload() *members_models.Error {
return o.Payload
}
func (o *PostCoursesInternalServerError) 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
}