otaapi

package
v0.0.0-...-e7a4495 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderDesc = "desc"
	OrderAsc  = "asc"
)

Variables

View Source
var ErrAlreadyCancelled = fmt.Errorf("already cancelled")
View Source
var ErrAlreadyInProgress = fmt.Errorf("already in progress")

Functions

This section is empty.

Types

type Ota

type Ota struct {
	ID          string `json:"id,omitempty" yaml:"id,omitempty"`
	DeviceID    string `json:"device_id,omitempty" yaml:"device_id,omitempty"`
	Status      string `json:"status" yaml:"status"`
	StartedAt   string `json:"started_at" yaml:"started_at"`
	EndedAt     string `json:"ended_at,omitempty" yaml:"ended_at,omitempty"`
	ErrorReason string `json:"error_reason,omitempty" yaml:"error_reason,omitempty"`
}

func (Ota) Data

func (r Ota) Data() interface{}

func (Ota) MapStatus

func (o Ota) MapStatus() string

func (Ota) String

func (r Ota) String() string

type OtaApiClient

type OtaApiClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(credentials *config.Credentials) *OtaApiClient

func (*OtaApiClient) CancelOta

func (c *OtaApiClient) CancelOta(otaid string) (bool, error)

func (*OtaApiClient) GetOtaLastStatusByDeviceID

func (c *OtaApiClient) GetOtaLastStatusByDeviceID(deviceID string) (*OtaStatusList, error)

func (*OtaApiClient) GetOtaStatusByDeviceID

func (c *OtaApiClient) GetOtaStatusByDeviceID(deviceID string, limit int, order string) (*OtaStatusList, error)

func (*OtaApiClient) GetOtaStatusByOtaID

func (c *OtaApiClient) GetOtaStatusByOtaID(otaid string, limit int, order string) (*OtaStatusResponse, error)

func (*OtaApiClient) GetOtaStatusByOtaIDs

func (c *OtaApiClient) GetOtaStatusByOtaIDs(otaids string) (*OtaStatusList, error)

type OtaStatusDetail

type OtaStatusDetail struct {
	Ota     Ota     `json:"ota"`
	Details []State `json:"details,omitempty"`
}

func (OtaStatusDetail) Data

func (r OtaStatusDetail) Data() interface{}

func (OtaStatusDetail) String

func (r OtaStatusDetail) String() string

type OtaStatusList

type OtaStatusList struct {
	Ota []Ota `json:"ota"`
}

func (OtaStatusList) Data

func (r OtaStatusList) Data() interface{}

func (OtaStatusList) String

func (r OtaStatusList) String() string

type OtaStatusResponse

type OtaStatusResponse struct {
	Ota    Ota     `json:"ota"`
	States []State `json:"states,omitempty"`
}

type State

type State struct {
	OtaID     string `json:"ota_id"`
	State     string `json:"state"`
	StateData string `json:"state_data,omitempty"`
	Timestamp string `json:"timestamp,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL