mirror of https://github.com/vernonkeenan/lib
487 lines
15 KiB
Go
487 lines
15 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 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/members/members_models"
|
||
|
)
|
||
|
|
||
|
// UpdateCoursesReader is a Reader for the UpdateCourses structure.
|
||
|
type UpdateCoursesReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *UpdateCoursesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 200:
|
||
|
result := NewUpdateCoursesOK()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 401:
|
||
|
result := NewUpdateCoursesUnauthorized()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 403:
|
||
|
result := NewUpdateCoursesForbidden()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 404:
|
||
|
result := NewUpdateCoursesNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 422:
|
||
|
result := NewUpdateCoursesUnprocessableEntity()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 500:
|
||
|
result := NewUpdateCoursesInternalServerError()
|
||
|
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())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewUpdateCoursesOK creates a UpdateCoursesOK with default headers values
|
||
|
func NewUpdateCoursesOK() *UpdateCoursesOK {
|
||
|
return &UpdateCoursesOK{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UpdateCoursesOK describes a response with status code 200, with default header values.
|
||
|
|
||
|
Course Response Object
|
||
|
*/
|
||
|
type UpdateCoursesOK struct {
|
||
|
Payload *members_models.CourseResponse
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this update courses o k response has a 2xx status code
|
||
|
func (o *UpdateCoursesOK) IsSuccess() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this update courses o k response has a 3xx status code
|
||
|
func (o *UpdateCoursesOK) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this update courses o k response has a 4xx status code
|
||
|
func (o *UpdateCoursesOK) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this update courses o k response has a 5xx status code
|
||
|
func (o *UpdateCoursesOK) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this update courses o k response a status code equal to that given
|
||
|
func (o *UpdateCoursesOK) IsCode(code int) bool {
|
||
|
return code == 200
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the update courses o k response
|
||
|
func (o *UpdateCoursesOK) Code() int {
|
||
|
return 200
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesOK) Error() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesOK) String() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesOK) GetPayload() *members_models.CourseResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesOK) 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
|
||
|
}
|
||
|
|
||
|
// NewUpdateCoursesUnauthorized creates a UpdateCoursesUnauthorized with default headers values
|
||
|
func NewUpdateCoursesUnauthorized() *UpdateCoursesUnauthorized {
|
||
|
return &UpdateCoursesUnauthorized{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UpdateCoursesUnauthorized describes a response with status code 401, with default header values.
|
||
|
|
||
|
Access Unauthorized, invalid API-KEY was used
|
||
|
*/
|
||
|
type UpdateCoursesUnauthorized struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this update courses unauthorized response has a 2xx status code
|
||
|
func (o *UpdateCoursesUnauthorized) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this update courses unauthorized response has a 3xx status code
|
||
|
func (o *UpdateCoursesUnauthorized) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this update courses unauthorized response has a 4xx status code
|
||
|
func (o *UpdateCoursesUnauthorized) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this update courses unauthorized response has a 5xx status code
|
||
|
func (o *UpdateCoursesUnauthorized) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this update courses unauthorized response a status code equal to that given
|
||
|
func (o *UpdateCoursesUnauthorized) IsCode(code int) bool {
|
||
|
return code == 401
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the update courses unauthorized response
|
||
|
func (o *UpdateCoursesUnauthorized) Code() int {
|
||
|
return 401
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesUnauthorized) Error() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesUnauthorized) String() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesUnauthorized %+v", 401, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesUnauthorized) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesUnauthorized) 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
|
||
|
}
|
||
|
|
||
|
// NewUpdateCoursesForbidden creates a UpdateCoursesForbidden with default headers values
|
||
|
func NewUpdateCoursesForbidden() *UpdateCoursesForbidden {
|
||
|
return &UpdateCoursesForbidden{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UpdateCoursesForbidden describes a response with status code 403, with default header values.
|
||
|
|
||
|
Access forbidden, account lacks access
|
||
|
*/
|
||
|
type UpdateCoursesForbidden struct {
|
||
|
AccessControlAllowOrigin string
|
||
|
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this update courses forbidden response has a 2xx status code
|
||
|
func (o *UpdateCoursesForbidden) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this update courses forbidden response has a 3xx status code
|
||
|
func (o *UpdateCoursesForbidden) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this update courses forbidden response has a 4xx status code
|
||
|
func (o *UpdateCoursesForbidden) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this update courses forbidden response has a 5xx status code
|
||
|
func (o *UpdateCoursesForbidden) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this update courses forbidden response a status code equal to that given
|
||
|
func (o *UpdateCoursesForbidden) IsCode(code int) bool {
|
||
|
return code == 403
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the update courses forbidden response
|
||
|
func (o *UpdateCoursesForbidden) Code() int {
|
||
|
return 403
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesForbidden) Error() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesForbidden) String() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesForbidden %+v", 403, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesForbidden) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesForbidden) 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
|
||
|
}
|
||
|
|
||
|
// NewUpdateCoursesNotFound creates a UpdateCoursesNotFound with default headers values
|
||
|
func NewUpdateCoursesNotFound() *UpdateCoursesNotFound {
|
||
|
return &UpdateCoursesNotFound{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UpdateCoursesNotFound describes a response with status code 404, with default header values.
|
||
|
|
||
|
Resource was not found
|
||
|
*/
|
||
|
type UpdateCoursesNotFound struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this update courses not found response has a 2xx status code
|
||
|
func (o *UpdateCoursesNotFound) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this update courses not found response has a 3xx status code
|
||
|
func (o *UpdateCoursesNotFound) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this update courses not found response has a 4xx status code
|
||
|
func (o *UpdateCoursesNotFound) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this update courses not found response has a 5xx status code
|
||
|
func (o *UpdateCoursesNotFound) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this update courses not found response a status code equal to that given
|
||
|
func (o *UpdateCoursesNotFound) IsCode(code int) bool {
|
||
|
return code == 404
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the update courses not found response
|
||
|
func (o *UpdateCoursesNotFound) Code() int {
|
||
|
return 404
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesNotFound) Error() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesNotFound) String() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesNotFound) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesNotFound) 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
|
||
|
}
|
||
|
|
||
|
// NewUpdateCoursesUnprocessableEntity creates a UpdateCoursesUnprocessableEntity with default headers values
|
||
|
func NewUpdateCoursesUnprocessableEntity() *UpdateCoursesUnprocessableEntity {
|
||
|
return &UpdateCoursesUnprocessableEntity{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UpdateCoursesUnprocessableEntity describes a response with status code 422, with default header values.
|
||
|
|
||
|
Unprocessable Entity, likely a bad parameter
|
||
|
*/
|
||
|
type UpdateCoursesUnprocessableEntity struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this update courses unprocessable entity response has a 2xx status code
|
||
|
func (o *UpdateCoursesUnprocessableEntity) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this update courses unprocessable entity response has a 3xx status code
|
||
|
func (o *UpdateCoursesUnprocessableEntity) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this update courses unprocessable entity response has a 4xx status code
|
||
|
func (o *UpdateCoursesUnprocessableEntity) IsClientError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this update courses unprocessable entity response has a 5xx status code
|
||
|
func (o *UpdateCoursesUnprocessableEntity) IsServerError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this update courses unprocessable entity response a status code equal to that given
|
||
|
func (o *UpdateCoursesUnprocessableEntity) IsCode(code int) bool {
|
||
|
return code == 422
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the update courses unprocessable entity response
|
||
|
func (o *UpdateCoursesUnprocessableEntity) Code() int {
|
||
|
return 422
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesUnprocessableEntity) Error() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesUnprocessableEntity) String() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesUnprocessableEntity %+v", 422, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesUnprocessableEntity) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesUnprocessableEntity) 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
|
||
|
}
|
||
|
|
||
|
// NewUpdateCoursesInternalServerError creates a UpdateCoursesInternalServerError with default headers values
|
||
|
func NewUpdateCoursesInternalServerError() *UpdateCoursesInternalServerError {
|
||
|
return &UpdateCoursesInternalServerError{}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UpdateCoursesInternalServerError describes a response with status code 500, with default header values.
|
||
|
|
||
|
Server Internal Error
|
||
|
*/
|
||
|
type UpdateCoursesInternalServerError struct {
|
||
|
Payload *members_models.Error
|
||
|
}
|
||
|
|
||
|
// IsSuccess returns true when this update courses internal server error response has a 2xx status code
|
||
|
func (o *UpdateCoursesInternalServerError) IsSuccess() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsRedirect returns true when this update courses internal server error response has a 3xx status code
|
||
|
func (o *UpdateCoursesInternalServerError) IsRedirect() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsClientError returns true when this update courses internal server error response has a 4xx status code
|
||
|
func (o *UpdateCoursesInternalServerError) IsClientError() bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
// IsServerError returns true when this update courses internal server error response has a 5xx status code
|
||
|
func (o *UpdateCoursesInternalServerError) IsServerError() bool {
|
||
|
return true
|
||
|
}
|
||
|
|
||
|
// IsCode returns true when this update courses internal server error response a status code equal to that given
|
||
|
func (o *UpdateCoursesInternalServerError) IsCode(code int) bool {
|
||
|
return code == 500
|
||
|
}
|
||
|
|
||
|
// Code gets the status code for the update courses internal server error response
|
||
|
func (o *UpdateCoursesInternalServerError) Code() int {
|
||
|
return 500
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesInternalServerError) String() string {
|
||
|
return fmt.Sprintf("[PUT /courses][%d] updateCoursesInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesInternalServerError) GetPayload() *members_models.Error {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *UpdateCoursesInternalServerError) 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
|
||
|
}
|