lib/api/sfgate/sfgate_client/courses/post_course_section_respons...

478 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/sfgate/sfgate_models"
)
// PostCourseSectionReader is a Reader for the PostCourseSection structure.
type PostCourseSectionReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostCourseSectionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostCourseSectionOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostCourseSectionUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostCourseSectionForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostCourseSectionNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostCourseSectionUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostCourseSectionInternalServerError()
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())
}
}
// NewPostCourseSectionOK creates a PostCourseSectionOK with default headers values
func NewPostCourseSectionOK() *PostCourseSectionOK {
return &PostCourseSectionOK{}
}
/*
PostCourseSectionOK describes a response with status code 200, with default header values.
CourseSection Response Object
*/
type PostCourseSectionOK struct {
Payload *sfgate_models.CourseSectionResponse
}
// IsSuccess returns true when this post course section o k response has a 2xx status code
func (o *PostCourseSectionOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post course section o k response has a 3xx status code
func (o *PostCourseSectionOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post course section o k response has a 4xx status code
func (o *PostCourseSectionOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post course section o k response has a 5xx status code
func (o *PostCourseSectionOK) IsServerError() bool {
return false
}
// IsCode returns true when this post course section o k response a status code equal to that given
func (o *PostCourseSectionOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post course section o k response
func (o *PostCourseSectionOK) Code() int {
return 200
}
func (o *PostCourseSectionOK) Error() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionOK %+v", 200, o.Payload)
}
func (o *PostCourseSectionOK) String() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionOK %+v", 200, o.Payload)
}
func (o *PostCourseSectionOK) GetPayload() *sfgate_models.CourseSectionResponse {
return o.Payload
}
func (o *PostCourseSectionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sfgate_models.CourseSectionResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostCourseSectionUnauthorized creates a PostCourseSectionUnauthorized with default headers values
func NewPostCourseSectionUnauthorized() *PostCourseSectionUnauthorized {
return &PostCourseSectionUnauthorized{}
}
/*
PostCourseSectionUnauthorized describes a response with status code 401, with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PostCourseSectionUnauthorized struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post course section unauthorized response has a 2xx status code
func (o *PostCourseSectionUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post course section unauthorized response has a 3xx status code
func (o *PostCourseSectionUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post course section unauthorized response has a 4xx status code
func (o *PostCourseSectionUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post course section unauthorized response has a 5xx status code
func (o *PostCourseSectionUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post course section unauthorized response a status code equal to that given
func (o *PostCourseSectionUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post course section unauthorized response
func (o *PostCourseSectionUnauthorized) Code() int {
return 401
}
func (o *PostCourseSectionUnauthorized) Error() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionUnauthorized %+v", 401, o.Payload)
}
func (o *PostCourseSectionUnauthorized) String() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionUnauthorized %+v", 401, o.Payload)
}
func (o *PostCourseSectionUnauthorized) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCourseSectionUnauthorized) 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 && err != io.EOF {
return err
}
return nil
}
// NewPostCourseSectionForbidden creates a PostCourseSectionForbidden with default headers values
func NewPostCourseSectionForbidden() *PostCourseSectionForbidden {
return &PostCourseSectionForbidden{}
}
/*
PostCourseSectionForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostCourseSectionForbidden struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post course section forbidden response has a 2xx status code
func (o *PostCourseSectionForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post course section forbidden response has a 3xx status code
func (o *PostCourseSectionForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post course section forbidden response has a 4xx status code
func (o *PostCourseSectionForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post course section forbidden response has a 5xx status code
func (o *PostCourseSectionForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post course section forbidden response a status code equal to that given
func (o *PostCourseSectionForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post course section forbidden response
func (o *PostCourseSectionForbidden) Code() int {
return 403
}
func (o *PostCourseSectionForbidden) Error() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionForbidden %+v", 403, o.Payload)
}
func (o *PostCourseSectionForbidden) String() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionForbidden %+v", 403, o.Payload)
}
func (o *PostCourseSectionForbidden) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCourseSectionForbidden) 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 && err != io.EOF {
return err
}
return nil
}
// NewPostCourseSectionNotFound creates a PostCourseSectionNotFound with default headers values
func NewPostCourseSectionNotFound() *PostCourseSectionNotFound {
return &PostCourseSectionNotFound{}
}
/*
PostCourseSectionNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostCourseSectionNotFound struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post course section not found response has a 2xx status code
func (o *PostCourseSectionNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post course section not found response has a 3xx status code
func (o *PostCourseSectionNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post course section not found response has a 4xx status code
func (o *PostCourseSectionNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post course section not found response has a 5xx status code
func (o *PostCourseSectionNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post course section not found response a status code equal to that given
func (o *PostCourseSectionNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post course section not found response
func (o *PostCourseSectionNotFound) Code() int {
return 404
}
func (o *PostCourseSectionNotFound) Error() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionNotFound %+v", 404, o.Payload)
}
func (o *PostCourseSectionNotFound) String() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionNotFound %+v", 404, o.Payload)
}
func (o *PostCourseSectionNotFound) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCourseSectionNotFound) 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 && err != io.EOF {
return err
}
return nil
}
// NewPostCourseSectionUnprocessableEntity creates a PostCourseSectionUnprocessableEntity with default headers values
func NewPostCourseSectionUnprocessableEntity() *PostCourseSectionUnprocessableEntity {
return &PostCourseSectionUnprocessableEntity{}
}
/*
PostCourseSectionUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostCourseSectionUnprocessableEntity struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post course section unprocessable entity response has a 2xx status code
func (o *PostCourseSectionUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post course section unprocessable entity response has a 3xx status code
func (o *PostCourseSectionUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post course section unprocessable entity response has a 4xx status code
func (o *PostCourseSectionUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post course section unprocessable entity response has a 5xx status code
func (o *PostCourseSectionUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post course section unprocessable entity response a status code equal to that given
func (o *PostCourseSectionUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post course section unprocessable entity response
func (o *PostCourseSectionUnprocessableEntity) Code() int {
return 422
}
func (o *PostCourseSectionUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostCourseSectionUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostCourseSectionUnprocessableEntity) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCourseSectionUnprocessableEntity) 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 && err != io.EOF {
return err
}
return nil
}
// NewPostCourseSectionInternalServerError creates a PostCourseSectionInternalServerError with default headers values
func NewPostCourseSectionInternalServerError() *PostCourseSectionInternalServerError {
return &PostCourseSectionInternalServerError{}
}
/*
PostCourseSectionInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostCourseSectionInternalServerError struct {
Payload *sfgate_models.Error
}
// IsSuccess returns true when this post course section internal server error response has a 2xx status code
func (o *PostCourseSectionInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post course section internal server error response has a 3xx status code
func (o *PostCourseSectionInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post course section internal server error response has a 4xx status code
func (o *PostCourseSectionInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post course section internal server error response has a 5xx status code
func (o *PostCourseSectionInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post course section internal server error response a status code equal to that given
func (o *PostCourseSectionInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post course section internal server error response
func (o *PostCourseSectionInternalServerError) Code() int {
return 500
}
func (o *PostCourseSectionInternalServerError) Error() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionInternalServerError %+v", 500, o.Payload)
}
func (o *PostCourseSectionInternalServerError) String() string {
return fmt.Sprintf("[POST /coursesections][%d] postCourseSectionInternalServerError %+v", 500, o.Payload)
}
func (o *PostCourseSectionInternalServerError) GetPayload() *sfgate_models.Error {
return o.Payload
}
func (o *PostCourseSectionInternalServerError) 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 && err != io.EOF {
return err
}
return nil
}