func (f *FileInformation) IsFolder() bool {
	if len(f.TypePath) == 1 && f.TypePath[0] == "folder" {
		return true
	}
	return false
}
IsFolder it returns true if the file is a folder.
package octoprint
import (
	"encoding/json"
	"strconv"
	"strings"
	"time"
)
var Version = "0.1"
type Axis string
const (
	XAxis Axis = "x"
	YAxis Axis = "y"
	ZAxis Axis = "z"
)
type FullStateResponse struct {
	Temperature TemperatureState `json:"temperature"`
	SD SDState `json:"sd"`
	State PrinterState `json:"state"`
}
type JobResponse struct {
	Job JobInformation `json:"job"`
	Progress ProgressInformation `json:"progress"`
}
type JobInformation struct {
	File FileInformation `json:"file"`
	EstimatedPrintTime float64 `json:"estimatedPrintTime"`
	LastPrintTime float64 `json:"lastPrintTime"`
	Filament struct {
		Length float64 `json:"length"`
		Volume float64 `json:"volume"`
	} `json:"filament"`
	FilePosition uint64 `json:"filepos"`
}
type ProgressInformation struct {
	Completion float64 `json:"completion"`
	FilePosition uint64 `json:"filepos"`
	PrintTime float64 `json:"printTime"`
	PrintTimeLeft float64 `json:"printTimeLeft"`
}
type TemperatureState temperatureState
type temperatureState struct {
	Current map[string]TemperatureData `json:"current"`
	History []*HistoricTemperatureData `json:"history"`
}
func (r *TemperatureState) UnmarshalJSON(b []byte) error {
	var raw map[string]interface{}
	if err := json.Unmarshal(b, &raw); err != nil {
		return err
	}
	history := raw["history"]
	delete(raw, "history")
	b, _ = json.Marshal(map[string]interface{}{
		"current": raw,
		"history": history,
	})
	i := &temperatureState{}
	if err := json.Unmarshal(b, i); err != nil {
		return err
	}
	*r = TemperatureState(*i)
	return nil
}
type TemperatureData struct {
	Actual float64 `json:"actual"`
	Target float64 `json:"target"`
	Offset float64 `json:"offset"`
}
type PrinterState struct {
	Text  string `json:"text"`
	Flags struct {
		Operations    bool `json:"operational"`
		Paused        bool `json:"paused"`
		Printing      bool `json:"printing"`
		SDReady       bool `json:"sdReady"`
		Error         bool `json:"error"`
		Ready         bool `json:"ready"`
		ClosedOnError bool `json:"closedOrError"`
	} `json:"flags"`
}
type SDState struct {
	Ready bool `json:"ready"`
}
type HistoricTemperatureData historicTemperatureData
type historicTemperatureData struct {
	Time JSONTime `json:"time"`
	Tools map[string]TemperatureData `json:"tools"`
}
func (h *HistoricTemperatureData) UnmarshalJSON(b []byte) error {
	var raw map[string]interface{}
	if err := json.Unmarshal(b, &raw); err != nil {
		return err
	}
	ts := raw["time"]
	delete(raw, "time")
	b, _ = json.Marshal(map[string]interface{}{
		"time":  ts,
		"tools": raw,
	})
	i := &historicTemperatureData{}
	if err := json.Unmarshal(b, i); err != nil {
		return err
	}
	*h = HistoricTemperatureData(*i)
	return nil
}
type VersionResponse struct {
	API string `json:"api"`
	Server string `json:"server"`
}
type ConnectionState string
const (
	Operational ConnectionState = "Operational"
)
func (s ConnectionState) IsOperational() bool {
	return strings.HasPrefix(string(s), "Operational")
}
func (s ConnectionState) IsPrinting() bool {
	return strings.HasPrefix(string(s), "Printing") ||
		strings.HasPrefix(string(s), "Sending") ||
		strings.HasPrefix(string(s), "Paused") ||
		strings.HasPrefix(string(s), "Transfering") ||
		strings.HasPrefix(string(s), "Paused")
}
func (s ConnectionState) IsOffline() bool {
	return strings.HasPrefix(string(s), "Offline") ||
		strings.HasPrefix(string(s), "Closed")
}
func (s ConnectionState) IsError() bool {
	return strings.HasPrefix(string(s), "Error") ||
		strings.HasPrefix(string(s), "Unknown")
}
func (s ConnectionState) IsConnecting() bool {
	return strings.HasPrefix(string(s), "Opening") ||
		strings.HasPrefix(string(s), "Detecting") ||
		strings.HasPrefix(string(s), "Connecting") ||
		strings.HasPrefix(string(s), "Detecting")
}
type ConnectionResponse struct {
	Current struct {
		State ConnectionState `json:"state"`
		Port string `json:"port"`
		BaudRate int `json:"baudrate"`
		PrinterProfile string `json:"printerProfile"`
	}
	Options struct {
		Ports []string `json:"ports"`
		BaudRates []int `json:"baudrates"`
		PrinterProfiles []*Profile `json:"printerProfiles"`
		PortPreference string `json:"portPreference"`
		BaudRatePreference int `json:"baudratePreference"`
		PrinterProfilePreference string `json:"printerProfilePreference"`
		Autoconnect bool `json:"autoconnect"`
	}
}
type Profile struct {
	ID string `json:"id"`
	Name string `json:"name"`
}
type FilesResponse struct {
	Files []*FileInformation
	Free uint64
}
type FileInformation struct {
	Name string `json:"name"`
	Path string `json:"path"`
	Type string `json:"type"`
	TypePath []string `json:"typePath"`
	Hash string `json:"hash"`
	Size uint64 `json:"size"`
	Date JSONTime `json:"date"`
	Origin string `json:"origin"`
	Refs Reference `json:"refs"`
	GCodeAnalysis GCodeAnalysisInformation `json:"gcodeAnalysis"`
	Print PrintStats `json:"print"`
}