diff --git a/providers/octoprint/client/octo_print_client.go b/providers/octoprint/client/octo_print_client.go index 916fbb82..09e21932 100644 --- a/providers/octoprint/client/octo_print_client.go +++ b/providers/octoprint/client/octo_print_client.go @@ -13,6 +13,7 @@ import ( "github.com/kihamo/boggart/providers/octoprint/client/connection" "github.com/kihamo/boggart/providers/octoprint/client/languages" + "github.com/kihamo/boggart/providers/octoprint/client/printer" "github.com/kihamo/boggart/providers/octoprint/client/system" "github.com/kihamo/boggart/providers/octoprint/client/version" ) @@ -64,6 +65,8 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *OctoPrint cli.Languages = languages.New(transport, formats) + cli.Printer = printer.New(transport, formats) + cli.System = system.New(transport, formats) cli.Version = version.New(transport, formats) @@ -116,6 +119,8 @@ type OctoPrint struct { Languages *languages.Client + Printer *printer.Client + System *system.Client Version *version.Client @@ -131,6 +136,8 @@ func (c *OctoPrint) SetTransport(transport runtime.ClientTransport) { c.Languages.SetTransport(transport) + c.Printer.SetTransport(transport) + c.System.SetTransport(transport) c.Version.SetTransport(transport) diff --git a/providers/octoprint/client/printer/get_printer_state_parameters.go b/providers/octoprint/client/printer/get_printer_state_parameters.go new file mode 100644 index 00000000..c8aaa687 --- /dev/null +++ b/providers/octoprint/client/printer/get_printer_state_parameters.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package printer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewGetPrinterStateParams creates a new GetPrinterStateParams object +// with the default values initialized. +func NewGetPrinterStateParams() *GetPrinterStateParams { + var () + return &GetPrinterStateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetPrinterStateParamsWithTimeout creates a new GetPrinterStateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetPrinterStateParamsWithTimeout(timeout time.Duration) *GetPrinterStateParams { + var () + return &GetPrinterStateParams{ + + timeout: timeout, + } +} + +// NewGetPrinterStateParamsWithContext creates a new GetPrinterStateParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetPrinterStateParamsWithContext(ctx context.Context) *GetPrinterStateParams { + var () + return &GetPrinterStateParams{ + + Context: ctx, + } +} + +// NewGetPrinterStateParamsWithHTTPClient creates a new GetPrinterStateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetPrinterStateParamsWithHTTPClient(client *http.Client) *GetPrinterStateParams { + var () + return &GetPrinterStateParams{ + HTTPClient: client, + } +} + +/*GetPrinterStateParams contains all the parameters to send to the API endpoint +for the get printer state operation typically these are written to a http.Request +*/ +type GetPrinterStateParams struct { + + /*Exclude + List of attributes to not return in the response + + */ + Exclude []string + /*History + The printer’s temperature history by supplying + + */ + History *bool + /*Limit + The amount of data points limited + + */ + Limit *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get printer state params +func (o *GetPrinterStateParams) WithTimeout(timeout time.Duration) *GetPrinterStateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get printer state params +func (o *GetPrinterStateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get printer state params +func (o *GetPrinterStateParams) WithContext(ctx context.Context) *GetPrinterStateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get printer state params +func (o *GetPrinterStateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get printer state params +func (o *GetPrinterStateParams) WithHTTPClient(client *http.Client) *GetPrinterStateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get printer state params +func (o *GetPrinterStateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithExclude adds the exclude to the get printer state params +func (o *GetPrinterStateParams) WithExclude(exclude []string) *GetPrinterStateParams { + o.SetExclude(exclude) + return o +} + +// SetExclude adds the exclude to the get printer state params +func (o *GetPrinterStateParams) SetExclude(exclude []string) { + o.Exclude = exclude +} + +// WithHistory adds the history to the get printer state params +func (o *GetPrinterStateParams) WithHistory(history *bool) *GetPrinterStateParams { + o.SetHistory(history) + return o +} + +// SetHistory adds the history to the get printer state params +func (o *GetPrinterStateParams) SetHistory(history *bool) { + o.History = history +} + +// WithLimit adds the limit to the get printer state params +func (o *GetPrinterStateParams) WithLimit(limit *int64) *GetPrinterStateParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the get printer state params +func (o *GetPrinterStateParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPrinterStateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + valuesExclude := o.Exclude + + joinedExclude := swag.JoinByFormat(valuesExclude, "csv") + // query array param exclude + if err := r.SetQueryParam("exclude", joinedExclude...); err != nil { + return err + } + + if o.History != nil { + + // query param history + var qrHistory bool + if o.History != nil { + qrHistory = *o.History + } + qHistory := swag.FormatBool(qrHistory) + if qHistory != "" { + if err := r.SetQueryParam("history", qHistory); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/providers/octoprint/client/printer/get_printer_state_responses.go b/providers/octoprint/client/printer/get_printer_state_responses.go new file mode 100644 index 00000000..8370e1a8 --- /dev/null +++ b/providers/octoprint/client/printer/get_printer_state_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package printer + +// 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" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/kihamo/boggart/providers/octoprint/models" +) + +// GetPrinterStateReader is a Reader for the GetPrinterState structure. +type GetPrinterStateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPrinterStateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPrinterStateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetPrinterStateOK creates a GetPrinterStateOK with default headers values +func NewGetPrinterStateOK() *GetPrinterStateOK { + return &GetPrinterStateOK{} +} + +/*GetPrinterStateOK handles this case with default header values. + +Successful operation +*/ +type GetPrinterStateOK struct { + Payload *models.PrinterState +} + +func (o *GetPrinterStateOK) Error() string { + return fmt.Sprintf("[GET /printer][%d] getPrinterStateOK %+v", 200, o.Payload) +} + +func (o *GetPrinterStateOK) GetPayload() *models.PrinterState { + return o.Payload +} + +func (o *GetPrinterStateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PrinterState) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/providers/octoprint/client/printer/printer_client.go b/providers/octoprint/client/printer/printer_client.go new file mode 100644 index 00000000..915725fc --- /dev/null +++ b/providers/octoprint/client/printer/printer_client.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package printer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new printer API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for printer API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +GetPrinterState get printer state API +*/ +func (a *Client) GetPrinterState(params *GetPrinterStateParams, authInfo runtime.ClientAuthInfoWriter) (*GetPrinterStateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPrinterStateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "getPrinterState", + Method: "GET", + PathPattern: "/printer", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPrinterStateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + success, ok := result.(*GetPrinterStateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getPrinterState: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/providers/octoprint/models/printer_state.go b/providers/octoprint/models/printer_state.go new file mode 100644 index 00000000..f22fafb6 --- /dev/null +++ b/providers/octoprint/models/printer_state.go @@ -0,0 +1,521 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// PrinterState printer state +// swagger:model PrinterState +type PrinterState struct { + + // sd + Sd *PrinterStateSd `json:"sd,omitempty"` + + // state + State *PrinterStateState `json:"state,omitempty"` + + // temperature + Temperature *PrinterStateTemperature `json:"temperature,omitempty"` +} + +// Validate validates this printer state +func (m *PrinterState) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTemperature(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PrinterState) validateSd(formats strfmt.Registry) error { + + if swag.IsZero(m.Sd) { // not required + return nil + } + + if m.Sd != nil { + if err := m.Sd.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sd") + } + return err + } + } + + return nil +} + +func (m *PrinterState) validateState(formats strfmt.Registry) error { + + if swag.IsZero(m.State) { // not required + return nil + } + + if m.State != nil { + if err := m.State.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state") + } + return err + } + } + + return nil +} + +func (m *PrinterState) validateTemperature(formats strfmt.Registry) error { + + if swag.IsZero(m.Temperature) { // not required + return nil + } + + if m.Temperature != nil { + if err := m.Temperature.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("temperature") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PrinterState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrinterState) UnmarshalBinary(b []byte) error { + var res PrinterState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PrinterStateSd printer state sd +// swagger:model PrinterStateSd +type PrinterStateSd struct { + + // ready + Ready bool `json:"ready,omitempty"` +} + +// Validate validates this printer state sd +func (m *PrinterStateSd) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PrinterStateSd) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrinterStateSd) UnmarshalBinary(b []byte) error { + var res PrinterStateSd + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PrinterStateState printer state state +// swagger:model PrinterStateState +type PrinterStateState struct { + + // flags + Flags *PrinterStateStateFlags `json:"flags,omitempty"` + + // text + Text string `json:"text,omitempty"` +} + +// Validate validates this printer state state +func (m *PrinterStateState) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFlags(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PrinterStateState) validateFlags(formats strfmt.Registry) error { + + if swag.IsZero(m.Flags) { // not required + return nil + } + + if m.Flags != nil { + if err := m.Flags.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("state" + "." + "flags") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PrinterStateState) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrinterStateState) UnmarshalBinary(b []byte) error { + var res PrinterStateState + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PrinterStateStateFlags printer state state flags +// swagger:model PrinterStateStateFlags +type PrinterStateStateFlags struct { + + // cancelling + Cancelling bool `json:"cancelling,omitempty"` + + // closed or error + ClosedOrError bool `json:"closedOrError,omitempty"` + + // error + Error bool `json:"error,omitempty"` + + // operational + Operational bool `json:"operational,omitempty"` + + // paused + Paused bool `json:"paused,omitempty"` + + // pausing + Pausing bool `json:"pausing,omitempty"` + + // printing + Printing bool `json:"printing,omitempty"` + + // ready + Ready bool `json:"ready,omitempty"` + + // sd ready + SdReady bool `json:"sdReady,omitempty"` +} + +// Validate validates this printer state state flags +func (m *PrinterStateStateFlags) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PrinterStateStateFlags) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrinterStateStateFlags) UnmarshalBinary(b []byte) error { + var res PrinterStateStateFlags + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PrinterStateTemperature printer state temperature +// swagger:model PrinterStateTemperature +type PrinterStateTemperature struct { + + // bed + Bed *TemperatureData `json:"bed,omitempty"` + + // history + History []*PrinterStateTemperatureHistoryItems0 `json:"history"` + + // tool0 + Tool0 *TemperatureData `json:"tool0,omitempty"` + + // tool1 + Tool1 *TemperatureData `json:"tool1,omitempty"` +} + +// Validate validates this printer state temperature +func (m *PrinterStateTemperature) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBed(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHistory(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTool0(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTool1(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PrinterStateTemperature) validateBed(formats strfmt.Registry) error { + + if swag.IsZero(m.Bed) { // not required + return nil + } + + if m.Bed != nil { + if err := m.Bed.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("temperature" + "." + "bed") + } + return err + } + } + + return nil +} + +func (m *PrinterStateTemperature) validateHistory(formats strfmt.Registry) error { + + if swag.IsZero(m.History) { // not required + return nil + } + + for i := 0; i < len(m.History); i++ { + if swag.IsZero(m.History[i]) { // not required + continue + } + + if m.History[i] != nil { + if err := m.History[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("temperature" + "." + "history" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PrinterStateTemperature) validateTool0(formats strfmt.Registry) error { + + if swag.IsZero(m.Tool0) { // not required + return nil + } + + if m.Tool0 != nil { + if err := m.Tool0.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("temperature" + "." + "tool0") + } + return err + } + } + + return nil +} + +func (m *PrinterStateTemperature) validateTool1(formats strfmt.Registry) error { + + if swag.IsZero(m.Tool1) { // not required + return nil + } + + if m.Tool1 != nil { + if err := m.Tool1.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("temperature" + "." + "tool1") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PrinterStateTemperature) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrinterStateTemperature) UnmarshalBinary(b []byte) error { + var res PrinterStateTemperature + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PrinterStateTemperatureHistoryItems0 printer state temperature history items0 +// swagger:model PrinterStateTemperatureHistoryItems0 +type PrinterStateTemperatureHistoryItems0 struct { + + // bed + Bed *TemperatureData `json:"bed,omitempty"` + + // time + Time int64 `json:"time,omitempty"` + + // tool0 + Tool0 *TemperatureData `json:"tool0,omitempty"` + + // tool1 + Tool1 *TemperatureData `json:"tool1,omitempty"` +} + +// Validate validates this printer state temperature history items0 +func (m *PrinterStateTemperatureHistoryItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBed(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTool0(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTool1(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PrinterStateTemperatureHistoryItems0) validateBed(formats strfmt.Registry) error { + + if swag.IsZero(m.Bed) { // not required + return nil + } + + if m.Bed != nil { + if err := m.Bed.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bed") + } + return err + } + } + + return nil +} + +func (m *PrinterStateTemperatureHistoryItems0) validateTool0(formats strfmt.Registry) error { + + if swag.IsZero(m.Tool0) { // not required + return nil + } + + if m.Tool0 != nil { + if err := m.Tool0.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tool0") + } + return err + } + } + + return nil +} + +func (m *PrinterStateTemperatureHistoryItems0) validateTool1(formats strfmt.Registry) error { + + if swag.IsZero(m.Tool1) { // not required + return nil + } + + if m.Tool1 != nil { + if err := m.Tool1.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tool1") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PrinterStateTemperatureHistoryItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrinterStateTemperatureHistoryItems0) UnmarshalBinary(b []byte) error { + var res PrinterStateTemperatureHistoryItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/providers/octoprint/models/temperature_data.go b/providers/octoprint/models/temperature_data.go new file mode 100644 index 00000000..d090b5d7 --- /dev/null +++ b/providers/octoprint/models/temperature_data.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// TemperatureData temperature data +// swagger:model TemperatureData +type TemperatureData struct { + + // actual + Actual float64 `json:"actual,omitempty"` + + // offset + Offset int64 `json:"offset,omitempty"` + + // target + Target float64 `json:"target,omitempty"` +} + +// Validate validates this temperature data +func (m *TemperatureData) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TemperatureData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TemperatureData) UnmarshalBinary(b []byte) error { + var res TemperatureData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/providers/octoprint/swagger.yml b/providers/octoprint/swagger.yml index cf317d40..922dde3f 100644 --- a/providers/octoprint/swagger.yml +++ b/providers/octoprint/swagger.yml @@ -54,6 +54,35 @@ paths: description: "Successful operation" schema: $ref: "#/definitions/Languages" + /printer: + get: + operationId: "getPrinterState" + tags: + - "printer" + parameters: + - name: "history" + in: "query" + description: "The printer’s temperature history by supplying" + required: false + type: "boolean" + - name: "limit" + in: "query" + description: "The amount of data points limited" + required: false + type: "integer" + - name: "exclude" + in: "query" + description: "List of attributes to not return in the response" + required: false + type: "array" + collectionFormat: "csv" + items: + type: "string" + responses: + 200: + description: "Successful operation" + schema: + $ref: "#/definitions/PrinterState" /system/commands: get: operationId: "getCommands" @@ -189,3 +218,68 @@ definitions: type: "string" resource: type: "string" + TemperatureData: + type: "object" + properties: + actual: + type: "number" + offset: + type: "integer" + target: + type: "number" + PrinterState: + type: "object" + properties: + temperature: + type: "object" + properties: + tool0: + $ref: "#/definitions/TemperatureData" + tool1: + $ref: "#/definitions/TemperatureData" + bed: + $ref: "#/definitions/TemperatureData" + history: + type: "array" + items: + type: "object" + properties: + time: + type: "integer" + tool0: + $ref: "#/definitions/TemperatureData" + tool1: + $ref: "#/definitions/TemperatureData" + bed: + $ref: "#/definitions/TemperatureData" + sd: + type: "object" + properties: + ready: + type: "boolean" + state: + type: "object" + properties: + text: + type: "string" + flags: + type: "object" + properties: + operational: + type: "boolean" + paused: + type: "boolean" + printing: + type: "boolean" + pausing: + type: "boolean" + cancelling: + type: "boolean" + sdReady: + type: "boolean" + error: + type: "boolean" + ready: + type: "boolean" + closedOrError: + type: "boolean" \ No newline at end of file