Documentation
¶
Overview ¶
Package api_client provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Index ¶
- func NewGetExamQuestionRequest(server string, examId string, questionIndex int32) (*http.Request, error)
- func NewGetExamRequest(server string, examId string) (*http.Request, error)
- func NewGetFindIncompleteExamsRequest(server string) (*http.Request, error)
- func NewGradeExamQuestionRequest(server string, examId string, questionIndex int32, ...) (*http.Request, error)
- func NewGradeExamQuestionRequestWithBody(server string, examId string, questionIndex int32, contentType string, ...) (*http.Request, error)
- type Client
- func (c *Client) GetExam(ctx context.Context, examId string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetExamQuestion(ctx context.Context, examId string, questionIndex int32, ...) (*http.Response, error)
- func (c *Client) GetFindIncompleteExams(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GradeExamQuestion(ctx context.Context, examId string, questionIndex int32, ...) (*http.Response, error)
- func (c *Client) GradeExamQuestionWithBody(ctx context.Context, examId string, questionIndex int32, contentType string, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetExamQuestionWithResponse(ctx context.Context, examId string, questionIndex int32, ...) (*GetExamQuestionResponse, error)
- func (c *ClientWithResponses) GetExamWithResponse(ctx context.Context, examId string, reqEditors ...RequestEditorFn) (*GetExamResponse, error)
- func (c *ClientWithResponses) GetFindIncompleteExamsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFindIncompleteExamsResponse, error)
- func (c *ClientWithResponses) GradeExamQuestionWithBodyWithResponse(ctx context.Context, examId string, questionIndex int32, contentType string, ...) (*GradeExamQuestionResponse, error)
- func (c *ClientWithResponses) GradeExamQuestionWithResponse(ctx context.Context, examId string, questionIndex int32, ...) (*GradeExamQuestionResponse, error)
- type ClientWithResponsesInterface
- type Error
- type Exam
- type GetExamQuestionResponse
- type GetExamResponse
- type GetFindIncompleteExamsResponse
- type GradeExamQuestionJSONRequestBody
- type GradeExamQuestionResponse
- type GradeQuestion
- type HttpRequestDoer
- type Question
- type RequestEditorFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGetExamQuestionRequest ¶
func NewGetExamQuestionRequest(server string, examId string, questionIndex int32) (*http.Request, error)
NewGetExamQuestionRequest generates requests for GetExamQuestion
func NewGetExamRequest ¶
NewGetExamRequest generates requests for GetExam
func NewGetFindIncompleteExamsRequest ¶ added in v0.1.58
NewGetFindIncompleteExamsRequest generates requests for GetFindIncompleteExams
func NewGradeExamQuestionRequest ¶
func NewGradeExamQuestionRequest(server string, examId string, questionIndex int32, body GradeExamQuestionJSONRequestBody) (*http.Request, error)
NewGradeExamQuestionRequest calls the generic GradeExamQuestion builder with application/json body
Types ¶
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) GetExamQuestion ¶
func (*Client) GetFindIncompleteExams ¶ added in v0.1.58
func (*Client) GradeExamQuestion ¶
func (c *Client) GradeExamQuestion(ctx context.Context, examId string, questionIndex int32, body GradeExamQuestionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// GetFindIncompleteExams request
GetFindIncompleteExams(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetExam request
GetExam(ctx context.Context, examId string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetExamQuestion request
GetExamQuestion(ctx context.Context, examId string, questionIndex int32, reqEditors ...RequestEditorFn) (*http.Response, error)
// GradeExamQuestionWithBody request with any body
GradeExamQuestionWithBody(ctx context.Context, examId string, questionIndex int32, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
GradeExamQuestion(ctx context.Context, examId string, questionIndex int32, body GradeExamQuestionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GetExamQuestionWithResponse ¶
func (c *ClientWithResponses) GetExamQuestionWithResponse(ctx context.Context, examId string, questionIndex int32, reqEditors ...RequestEditorFn) (*GetExamQuestionResponse, error)
GetExamQuestionWithResponse request returning *GetExamQuestionResponse
func (*ClientWithResponses) GetExamWithResponse ¶
func (c *ClientWithResponses) GetExamWithResponse(ctx context.Context, examId string, reqEditors ...RequestEditorFn) (*GetExamResponse, error)
GetExamWithResponse request returning *GetExamResponse
func (*ClientWithResponses) GetFindIncompleteExamsWithResponse ¶ added in v0.1.58
func (c *ClientWithResponses) GetFindIncompleteExamsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFindIncompleteExamsResponse, error)
GetFindIncompleteExamsWithResponse request returning *GetFindIncompleteExamsResponse
func (*ClientWithResponses) GradeExamQuestionWithBodyWithResponse ¶
func (c *ClientWithResponses) GradeExamQuestionWithBodyWithResponse(ctx context.Context, examId string, questionIndex int32, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GradeExamQuestionResponse, error)
GradeExamQuestionWithBodyWithResponse request with arbitrary body returning *GradeExamQuestionResponse
func (*ClientWithResponses) GradeExamQuestionWithResponse ¶
func (c *ClientWithResponses) GradeExamQuestionWithResponse(ctx context.Context, examId string, questionIndex int32, body GradeExamQuestionJSONRequestBody, reqEditors ...RequestEditorFn) (*GradeExamQuestionResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetFindIncompleteExamsWithResponse request
GetFindIncompleteExamsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFindIncompleteExamsResponse, error)
// GetExamWithResponse request
GetExamWithResponse(ctx context.Context, examId string, reqEditors ...RequestEditorFn) (*GetExamResponse, error)
// GetExamQuestionWithResponse request
GetExamQuestionWithResponse(ctx context.Context, examId string, questionIndex int32, reqEditors ...RequestEditorFn) (*GetExamQuestionResponse, error)
// GradeExamQuestionWithBodyWithResponse request with any body
GradeExamQuestionWithBodyWithResponse(ctx context.Context, examId string, questionIndex int32, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GradeExamQuestionResponse, error)
GradeExamQuestionWithResponse(ctx context.Context, examId string, questionIndex int32, body GradeExamQuestionJSONRequestBody, reqEditors ...RequestEditorFn) (*GradeExamQuestionResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Error ¶
type Error struct {
Code *int32 `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
}
Error defines model for Error.
type Exam ¶
type Exam struct {
ExamId string `json:"examId"`
Questions []Question `json:"questions"`
State string `json:"state"`
TotalPointsEarned *int32 `json:"totalPointsEarned,omitempty"`
TotalPointsPossible int32 `json:"totalPointsPossible"`
}
Exam defines model for Exam.
type GetExamQuestionResponse ¶
type GetExamQuestionResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Question
JSONDefault *Error
}
func ParseGetExamQuestionResponse ¶
func ParseGetExamQuestionResponse(rsp *http.Response) (*GetExamQuestionResponse, error)
ParseGetExamQuestionResponse parses an HTTP response from a GetExamQuestionWithResponse call
func (GetExamQuestionResponse) Status ¶
func (r GetExamQuestionResponse) Status() string
Status returns HTTPResponse.Status
func (GetExamQuestionResponse) StatusCode ¶
func (r GetExamQuestionResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetExamResponse ¶
type GetExamResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Exam
JSONDefault *Error
}
func ParseGetExamResponse ¶
func ParseGetExamResponse(rsp *http.Response) (*GetExamResponse, error)
ParseGetExamResponse parses an HTTP response from a GetExamWithResponse call
func (GetExamResponse) Status ¶
func (r GetExamResponse) Status() string
Status returns HTTPResponse.Status
func (GetExamResponse) StatusCode ¶
func (r GetExamResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetFindIncompleteExamsResponse ¶ added in v0.1.58
type GetFindIncompleteExamsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Exam
JSONDefault *Error
}
func ParseGetFindIncompleteExamsResponse ¶ added in v0.1.58
func ParseGetFindIncompleteExamsResponse(rsp *http.Response) (*GetFindIncompleteExamsResponse, error)
ParseGetFindIncompleteExamsResponse parses an HTTP response from a GetFindIncompleteExamsWithResponse call
func (GetFindIncompleteExamsResponse) Status ¶ added in v0.1.58
func (r GetFindIncompleteExamsResponse) Status() string
Status returns HTTPResponse.Status
func (GetFindIncompleteExamsResponse) StatusCode ¶ added in v0.1.58
func (r GetFindIncompleteExamsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GradeExamQuestionJSONRequestBody ¶
type GradeExamQuestionJSONRequestBody = GradeQuestion
GradeExamQuestionJSONRequestBody defines body for GradeExamQuestion for application/json ContentType.
type GradeExamQuestionResponse ¶
type GradeExamQuestionResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *Exam
JSONDefault *Error
}
func ParseGradeExamQuestionResponse ¶
func ParseGradeExamQuestionResponse(rsp *http.Response) (*GradeExamQuestionResponse, error)
ParseGradeExamQuestionResponse parses an HTTP response from a GradeExamQuestionWithResponse call
func (GradeExamQuestionResponse) Status ¶
func (r GradeExamQuestionResponse) Status() string
Status returns HTTPResponse.Status
func (GradeExamQuestionResponse) StatusCode ¶
func (r GradeExamQuestionResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GradeQuestion ¶
GradeQuestion defines model for GradeQuestion.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Question ¶
type Question struct {
ExamId string `json:"examId"`
Feedback *string `json:"feedback,omitempty"`
Graded bool `json:"graded"`
PointsEarned *int32 `json:"pointsEarned,omitempty"`
PointsPossible *int32 `json:"pointsPossible,omitempty"`
ProvidedAnswer *string `json:"providedAnswer,omitempty"`
QuestionId string `json:"questionId"`
QuestionIndex int32 `json:"questionIndex"`
QuestionType string `json:"questionType"`
}
Question defines model for Question.