// 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" "fmt" "io" "code.tnxs.net/vernonkeenan/lib/api/sfgate/sfgate_models" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" ) // GetCourseSectionsReader is a Reader for the GetCourseSections structure. type GetCourseSectionsReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *GetCourseSectionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewGetCourseSectionsOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401: result := NewGetCourseSectionsUnauthorized() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 403: result := NewGetCourseSectionsForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 404: result := NewGetCourseSectionsNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewGetCourseSectionsUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewGetCourseSectionsInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("[GET /coursesections] getCourseSections", response, response.Code()) } } // NewGetCourseSectionsOK creates a GetCourseSectionsOK with default headers values func NewGetCourseSectionsOK() *GetCourseSectionsOK { return &GetCourseSectionsOK{} } // GetCourseSectionsOK describes a response with status code 200, with default header values. // // CourseSection Response Object type GetCourseSectionsOK struct { Payload *sfgate_models.CourseSectionResponse } // IsSuccess returns true when this get course sections o k response has a 2xx status code func (o *GetCourseSectionsOK) IsSuccess() bool { return true } // IsRedirect returns true when this get course sections o k response has a 3xx status code func (o *GetCourseSectionsOK) IsRedirect() bool { return false } // IsClientError returns true when this get course sections o k response has a 4xx status code func (o *GetCourseSectionsOK) IsClientError() bool { return false } // IsServerError returns true when this get course sections o k response has a 5xx status code func (o *GetCourseSectionsOK) IsServerError() bool { return false } // IsCode returns true when this get course sections o k response a status code equal to that given func (o *GetCourseSectionsOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the get course sections o k response func (o *GetCourseSectionsOK) Code() int { return 200 } func (o *GetCourseSectionsOK) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsOK %s", 200, payload) } func (o *GetCourseSectionsOK) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsOK %s", 200, payload) } func (o *GetCourseSectionsOK) GetPayload() *sfgate_models.CourseSectionResponse { return o.Payload } func (o *GetCourseSectionsOK) 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 && !stderrors.Is(err, io.EOF) { return err } return nil } // NewGetCourseSectionsUnauthorized creates a GetCourseSectionsUnauthorized with default headers values func NewGetCourseSectionsUnauthorized() *GetCourseSectionsUnauthorized { return &GetCourseSectionsUnauthorized{} } // GetCourseSectionsUnauthorized describes a response with status code 401, with default header values. // // Access unauthorized, invalid API-KEY was used type GetCourseSectionsUnauthorized struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get course sections unauthorized response has a 2xx status code func (o *GetCourseSectionsUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this get course sections unauthorized response has a 3xx status code func (o *GetCourseSectionsUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this get course sections unauthorized response has a 4xx status code func (o *GetCourseSectionsUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this get course sections unauthorized response has a 5xx status code func (o *GetCourseSectionsUnauthorized) IsServerError() bool { return false } // IsCode returns true when this get course sections unauthorized response a status code equal to that given func (o *GetCourseSectionsUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the get course sections unauthorized response func (o *GetCourseSectionsUnauthorized) Code() int { return 401 } func (o *GetCourseSectionsUnauthorized) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsUnauthorized %s", 401, payload) } func (o *GetCourseSectionsUnauthorized) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsUnauthorized %s", 401, payload) } func (o *GetCourseSectionsUnauthorized) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetCourseSectionsUnauthorized) 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) { return err } return nil } // NewGetCourseSectionsForbidden creates a GetCourseSectionsForbidden with default headers values func NewGetCourseSectionsForbidden() *GetCourseSectionsForbidden { return &GetCourseSectionsForbidden{} } // GetCourseSectionsForbidden describes a response with status code 403, with default header values. // // Access forbidden, account lacks access type GetCourseSectionsForbidden struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get course sections forbidden response has a 2xx status code func (o *GetCourseSectionsForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this get course sections forbidden response has a 3xx status code func (o *GetCourseSectionsForbidden) IsRedirect() bool { return false } // IsClientError returns true when this get course sections forbidden response has a 4xx status code func (o *GetCourseSectionsForbidden) IsClientError() bool { return true } // IsServerError returns true when this get course sections forbidden response has a 5xx status code func (o *GetCourseSectionsForbidden) IsServerError() bool { return false } // IsCode returns true when this get course sections forbidden response a status code equal to that given func (o *GetCourseSectionsForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the get course sections forbidden response func (o *GetCourseSectionsForbidden) Code() int { return 403 } func (o *GetCourseSectionsForbidden) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsForbidden %s", 403, payload) } func (o *GetCourseSectionsForbidden) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsForbidden %s", 403, payload) } func (o *GetCourseSectionsForbidden) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetCourseSectionsForbidden) 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) { return err } return nil } // NewGetCourseSectionsNotFound creates a GetCourseSectionsNotFound with default headers values func NewGetCourseSectionsNotFound() *GetCourseSectionsNotFound { return &GetCourseSectionsNotFound{} } // GetCourseSectionsNotFound describes a response with status code 404, with default header values. // // Resource was not found type GetCourseSectionsNotFound struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get course sections not found response has a 2xx status code func (o *GetCourseSectionsNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this get course sections not found response has a 3xx status code func (o *GetCourseSectionsNotFound) IsRedirect() bool { return false } // IsClientError returns true when this get course sections not found response has a 4xx status code func (o *GetCourseSectionsNotFound) IsClientError() bool { return true } // IsServerError returns true when this get course sections not found response has a 5xx status code func (o *GetCourseSectionsNotFound) IsServerError() bool { return false } // IsCode returns true when this get course sections not found response a status code equal to that given func (o *GetCourseSectionsNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the get course sections not found response func (o *GetCourseSectionsNotFound) Code() int { return 404 } func (o *GetCourseSectionsNotFound) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsNotFound %s", 404, payload) } func (o *GetCourseSectionsNotFound) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsNotFound %s", 404, payload) } func (o *GetCourseSectionsNotFound) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetCourseSectionsNotFound) 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) { return err } return nil } // NewGetCourseSectionsUnprocessableEntity creates a GetCourseSectionsUnprocessableEntity with default headers values func NewGetCourseSectionsUnprocessableEntity() *GetCourseSectionsUnprocessableEntity { return &GetCourseSectionsUnprocessableEntity{} } // GetCourseSectionsUnprocessableEntity describes a response with status code 422, with default header values. // // Unprocessable Entity, likely a bad parameter type GetCourseSectionsUnprocessableEntity struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get course sections unprocessable entity response has a 2xx status code func (o *GetCourseSectionsUnprocessableEntity) IsSuccess() bool { return false } // IsRedirect returns true when this get course sections unprocessable entity response has a 3xx status code func (o *GetCourseSectionsUnprocessableEntity) IsRedirect() bool { return false } // IsClientError returns true when this get course sections unprocessable entity response has a 4xx status code func (o *GetCourseSectionsUnprocessableEntity) IsClientError() bool { return true } // IsServerError returns true when this get course sections unprocessable entity response has a 5xx status code func (o *GetCourseSectionsUnprocessableEntity) IsServerError() bool { return false } // IsCode returns true when this get course sections unprocessable entity response a status code equal to that given func (o *GetCourseSectionsUnprocessableEntity) IsCode(code int) bool { return code == 422 } // Code gets the status code for the get course sections unprocessable entity response func (o *GetCourseSectionsUnprocessableEntity) Code() int { return 422 } func (o *GetCourseSectionsUnprocessableEntity) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsUnprocessableEntity %s", 422, payload) } func (o *GetCourseSectionsUnprocessableEntity) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsUnprocessableEntity %s", 422, payload) } func (o *GetCourseSectionsUnprocessableEntity) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetCourseSectionsUnprocessableEntity) 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) { return err } return nil } // NewGetCourseSectionsInternalServerError creates a GetCourseSectionsInternalServerError with default headers values func NewGetCourseSectionsInternalServerError() *GetCourseSectionsInternalServerError { return &GetCourseSectionsInternalServerError{} } // GetCourseSectionsInternalServerError describes a response with status code 500, with default header values. // // Server Internal Error type GetCourseSectionsInternalServerError struct { Payload *sfgate_models.Error } // IsSuccess returns true when this get course sections internal server error response has a 2xx status code func (o *GetCourseSectionsInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this get course sections internal server error response has a 3xx status code func (o *GetCourseSectionsInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this get course sections internal server error response has a 4xx status code func (o *GetCourseSectionsInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this get course sections internal server error response has a 5xx status code func (o *GetCourseSectionsInternalServerError) IsServerError() bool { return true } // IsCode returns true when this get course sections internal server error response a status code equal to that given func (o *GetCourseSectionsInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the get course sections internal server error response func (o *GetCourseSectionsInternalServerError) Code() int { return 500 } func (o *GetCourseSectionsInternalServerError) Error() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsInternalServerError %s", 500, payload) } func (o *GetCourseSectionsInternalServerError) String() string { payload, _ := json.Marshal(o.Payload) return fmt.Sprintf("[GET /coursesections][%d] getCourseSectionsInternalServerError %s", 500, payload) } func (o *GetCourseSectionsInternalServerError) GetPayload() *sfgate_models.Error { return o.Payload } func (o *GetCourseSectionsInternalServerError) 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) { return err } return nil }