models

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteEventRuleResponse

type DeleteEventRuleResponse struct {
	Message string `json:"message"`
}

DeleteEventRuleResponse represents response after deleting an event rule

type EventItem

type EventItem struct {
	EventID    int64                  `json:"event_id"`
	EventType  string                 `json:"event_type"`
	EventLevel string                 `json:"event_level,omitempty"`
	SpaceSlug  string                 `json:"space_slug,omitempty"`
	EntityID   string                 `json:"entity_id,omitempty"`
	TimeFired  time.Time              `json:"time_fired"`
	EventData  map[string]interface{} `json:"event_data,omitempty"`
}

EventItem represents a single event in API response

type EventRuleItem

type EventRuleItem struct {
	EventRuleID   string     `json:"event_rule_id"`
	DeviceID      *string    `json:"device_id,omitempty"`
	RuleKey       string     `json:"rule_key,omitempty"`
	Operator      string     `json:"operator,omitempty"`
	Operand       string     `json:"operand"`
	IsActive      bool       `json:"is_active"`
	StartTime     *time.Time `json:"start_time,omitempty"`
	EndTime       *time.Time `json:"end_time,omitempty"`
	AllowNewEvent bool       `json:"allow_new_event"`
	CreatedAt     time.Time  `json:"created_at"`
	UpdatedAt     time.Time  `json:"updated_at"`
}

EventRuleItem represents a single event rule in API response

type EventRulesRequest

type EventRulesRequest struct {
	Page     int    `query:"page"`
	PageSize int    `query:"page_size"`
	DeviceID string `query:"device_id"`
}

EventRulesRequest represents query parameters for event rules list

func (*EventRulesRequest) SetDefaults

func (r *EventRulesRequest) SetDefaults()

SetDefaults sets default values

type EventRulesResponse

type EventRulesResponse struct {
	Rules      []EventRuleItem `json:"rules"`
	TotalCount int             `json:"total_count"`
	Page       int             `json:"page"`
	PageSize   int             `json:"page_size"`
}

EventRulesResponse represents paginated event rules response

type EventsByDeviceRequest

type EventsByDeviceRequest struct {
	DeviceID  string `param:"device_id" validate:"required"`
	Limit     int    `query:"limit"`
	StartTime *int64 `query:"start_time"`
	EndTime   *int64 `query:"end_time"`
}

EventsByDeviceRequest represents query parameters for device events

func (*EventsByDeviceRequest) SetDefaults

func (r *EventsByDeviceRequest) SetDefaults()

SetDefaults sets default values

type EventsByDeviceResponse

type EventsByDeviceResponse struct {
	DeviceID string      `json:"device_id"`
	Events   []EventItem `json:"events"`
	Count    int         `json:"count"`
}

EventsByDeviceResponse represents response for device events

Jump to

Keyboard shortcuts

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