func (cmd *CancelRequest) Do(c *Client) error {
	payload := map[string]string{"command": "cancel"}
	b := bytes.NewBuffer(nil)
	if err := json.NewEncoder(b).Encode(payload); err != nil {
		return err
	}
	_, err := c.doJSONRequest("POST", JobTool, b, JobToolErrors)
	return err
}
Do sends an API request and returns an error if any.
package octoprint
import (
	"bytes"
	"encoding/json"
	"io"
)
const JobTool = "/api/job"
var JobToolErrors = statusMapping{
	409: "Printer is not operational or the current print job state does not match the preconditions for the command.",
}
type JobRequest struct{}
func (cmd *JobRequest) Do(c *Client) (*JobResponse, error) {
	b, err := c.doJSONRequest("GET", JobTool, nil, nil)
	if err != nil {
		return nil, err
	}
	r := &JobResponse{}
	if err := json.Unmarshal(b, r); err != nil {
		return nil, err
	}
	return r, err
}
type StartRequest struct{}
func (cmd *StartRequest) Do(c *Client) error {
	payload := map[string]string{"command": "start"}
	b := bytes.NewBuffer(nil)
	if err := json.NewEncoder(b).Encode(payload); err != nil {
		return err
	}
	_, err := c.doJSONRequest("POST", JobTool, b, JobToolErrors)
	return err
}
type CancelRequest struct{}