models

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTaskInvalidDueDate              = errors.New("Invalid due date, not unix timestamp in ms")
	ErrTaskInvalidUserID               = errors.New("Required field 'userId' is invalid")
	ErrTaskInvalidExternalID           = errors.New("Required field 'externalId' is invalid")
	ErrTaskFLIDsAndNodeIdsEmpty        = errors.New("'FunctionalLocationIds' or 'NodeIds' must contain at least one value")
	ErrTaskFLIDsAndNodeIdsFilledIn     = errors.New("'FunctionalLocationIds' and 'NodeIds' cannot contain values")
	ErrTaskFLAndNodeIdsNilEmpty        = errors.New("Both 'functionalLocationIds' and 'NodeIDs' cannot be nil/empty")
	ErrTaskInvalidHierarchy            = errors.New("Required field 'hierarchyId' is invalid")
	ErrTaskInvalidID                   = errors.New("Required field 'id' is invalid")
	ErrTaskInvalidkTaskStatus          = fmt.Errorf("Field 'taskstatus' is invalid, valid statuses: %v", validTaskStatuses)
	ErrTaskInvalidkTaskStatusUpdatedAt = errors.New("Invalid taskStatusUpdateAt, not unix timestamp in ms")
	ErrTaskNodeTypeEmpty               = errors.New("Nodetype cannot be empty when 'NodeIds' is used")
)

Functions

func ValidTaskStatus

func ValidTaskStatus(status string) bool

func ValidateSetTaskStatusInput

func ValidateSetTaskStatusInput(input iotgrpcapi.SetTaskStatusInput) error

Types

type Device

type Device struct {
	ID                string `json:"id"`
	Manufacturer      string `json:"manufacturer"`
	Model             string `json:"model"`
	SerialNumber      string `json:"serialNumber"`
	DeviceCertificate string `json:"deviceCertificate,omitempty"`
	DevicePrivateKey  string `json:"devicePrivateKey,omitempty"`
}

type Node

type Node struct {
	NodeID   uuid.UUID `json:"nodeId"`
	NodeType string    `json:"nodeType"`
}

type NodeDataAndPair

type NodeDataAndPair struct {
	NodeData iotgrpcapi.NodeData `json:"nodeData"`
	NodeId   string              `json:"nodeId"`
}

type Task

type Task struct {
	ID                    uuid.UUID   `json:"id"`
	Name                  string      `json:"name"`
	HierarchyID           uuid.UUID   `json:"hierarchyId"`
	DueDate               int64       `json:"dueDate"`
	IsCompleted           bool        `json:"isCompleted"`
	UserID                uuid.UUID   `json:"userId"`
	FunctionalLocationIDs []uuid.UUID `json:"functionalLocationIds"`
	ExternalID            uuid.UUID   `json:"externalId"`
	TaskStatus            string      `json:"taskStatus"`
	TaskStatusUpdatedAt   int64       `json:"taskStatusUpdatedAt"`
	LongID                int64       `json:"longId"`
	Nodes                 []Node      `json:"nodeIds"`
}

func (*Task) FromGRPC

func (task *Task) FromGRPC(td iotgrpcapi.TaskDescription)

func (*Task) FromGRPCInitial

func (task *Task) FromGRPCInitial(request iotgrpcapi.InitialTaskDescription) (err error)

func (Task) ToGRPC

func (task Task) ToGRPC() iotgrpcapi.TaskDescription

func (Task) ToGRPCInitial

func (task Task) ToGRPCInitial() iotgrpcapi.InitialTaskDescription

func (Task) Validate

func (task Task) Validate() (err error)

type Tasks

type Tasks []Task

func (Tasks) FilterOnUncompleted

func (tasks Tasks) FilterOnUncompleted() (result Tasks)

func (Tasks) ToGRPC

func (tasks Tasks) ToGRPC() (td *iotgrpcapi.TaskDescriptions)

Jump to

Keyboard shortcuts

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