storageapi

package
v0.0.0-...-88de618 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TemplateFileExtension = ".tino"

Variables

This section is empty.

Functions

This section is empty.

Types

type BodyVariable

type BodyVariable struct {
	// Attribute attribute
	Attribute string `json:"attribute"`

	// Entity entity
	Entity string `json:"entity"`

	// Placeholder placeholder
	Placeholder string `json:"placeholder"`

	// PropertyId property_id
	PropertyId *string `json:"property_id,omitempty"`

	// ThingId thing_id
	ThingId *string `json:"thing_id,omitempty"`
}

type DashboardTemplate

type DashboardTemplate struct {
	// Id Template ID
	Id string `json:"id"`

	// Name Name
	Name string `json:"name"`

	// Widgets Widgets
	Widgets *[]Widget `json:"widgets,omitempty"`
}

type Delivery

type Delivery struct {
	// Bcc BCC
	Bcc *[]DeliveryTo `json:"bcc,omitempty"`

	// Cc CC
	Cc *[]DeliveryTo `json:"cc,omitempty"`

	// To To
	To []DeliveryTo `json:"to"`
}

type DeliveryTo

type DeliveryTo struct {
	// Email email
	Email *string `json:"email,omitempty"`

	// Username username
	Username *string `json:"username,omitempty"`
}

DeliveryTo defines model for DeliveryTo.

type DescribeTemplateResponse

type DescribeTemplateResponse struct {
	// CompatibleBoards List of devices compatible with the template
	CompatibleBoards []string `json:"compatible_boards,omitempty"`

	// CreatedAt Template creation date/time
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// DashboardTemplates List of dashboard templates
	DashboardTemplates []DashboardTemplate `json:"dashboard_templates,omitempty"`

	// DeletedAt Template soft deletion date/time
	DeletedAt *time.Time `json:"deleted_at,omitempty"`

	// Description Description of the template
	Description string `json:"description"`

	// ImageLinks Optional list of images to be included in the template
	ImageLinks []string `json:"image_links,omitempty"`

	// Name Template name
	Name string `json:"name" validate:"required,max=128"`

	// OrganizationId Organization identifier
	OrganizationId *uuid.UUID `json:"organization_id,omitempty"`
	TemplateId     uuid.UUID  `json:"template_id" validate:"required,uuid"`

	// ThingTemplates List of thing templates
	ThingTemplates []ThingTemplate `json:"thing_templates,omitempty"`

	// TriggerTemplates List of trigger templates
	TriggerTemplates []TriggerTemplate `json:"trigger_templates,omitempty"`

	// UpdatedAt Template update date/time
	UpdatedAt *time.Time `json:"updated_at,omitempty"`

	// UserId User identifier
	UserId *uuid.UUID `json:"user_id,omitempty" validate:"uuid"`
}

type EmailAction

type EmailAction struct {
	Body     NotificationBody `json:"body"`
	Delivery Delivery         `json:"delivery"`
	Subject  Subject          `json:"subject"`
}

EmailAction defines model for EmailAction.

type ImportCustomTemplateResponse

type ImportCustomTemplateResponse struct {
	Message    string `json:"message"`
	Name       string `json:"name"`
	TemplateId string `json:"template_id"`
}

type LinkedDevice

type LinkedDevice struct {
	// DeviceConnectedDelay Device connected delay
	DeviceConnectedDelay *float32 `json:"device_connected_delay,omitempty"`

	// DeviceDisconnectedDelay Device disconnected delay
	DeviceDisconnectedDelay *float32 `json:"device_disconnected_delay,omitempty"`

	// ThingId Thing ID
	ThingId string `json:"thing_id"`
}

type LinkedProperty

type LinkedProperty struct {
	// PropertyId Property ID
	PropertyId string `json:"property_id"`

	// ThingId Thing ID
	ThingId string `json:"thing_id"`
}

LinkedProperty defines model for LinkedProperty.

type NotificationBody

type NotificationBody struct {
	// Expression Expression
	Expression string `json:"expression"`

	// Variables Variables
	Variables []BodyVariable `json:"variables"`
}

NotificationBody defines model for NotificationBody.

type PushNotificationAction

type PushNotificationAction struct {
	Body     NotificationBody `json:"body"`
	Delivery Delivery         `json:"delivery"`
	Title    Subject          `json:"title"`
}

PushNotificationAction defines model for PushNotificationAction.

type StorageApiClient

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

func NewClient

func NewClient(credentials *config.Credentials) *StorageApiClient

func (*StorageApiClient) ExportCustomTemplate

func (c *StorageApiClient) ExportCustomTemplate(templateId, path string) (*string, error)

func (*StorageApiClient) GetCustomTemplate

func (c *StorageApiClient) GetCustomTemplate(templateID uuid.UUID) (*DescribeTemplateResponse, error)

func (*StorageApiClient) ImportCustomTemplate

func (c *StorageApiClient) ImportCustomTemplate(templateFile string) (*ImportCustomTemplateResponse, error)

func (*StorageApiClient) ListCustomTemplates

func (c *StorageApiClient) ListCustomTemplates() (*TemplatesListResponse, error)

type Subject

type Subject struct {
	// Expression expression
	Expression string `json:"expression"`
}

Subject defines model for Subject.

type Tag

type Tag struct {
	// Key Key
	Key string `json:"key"`

	// Value Value
	Value string `json:"value"`
}

type TemplateEntry

type TemplateEntry struct {
	TemplateId string `json:"template_id"`
	Name       string `json:"name"`
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
}

type TemplatesListResponse

type TemplatesListResponse struct {
	Templates []TemplateEntry `json:"templates"`
}

func (*TemplatesListResponse) Data

func (r *TemplatesListResponse) Data() interface{}

func (*TemplatesListResponse) String

func (r *TemplatesListResponse) String() string

type ThingTemplate

type ThingTemplate struct {
	// Id Template ID
	Id string `json:"id"`

	// Name Name
	Name string `json:"name"`

	// Tags Tags
	Tags []Tag `json:"tags,omitempty"`

	// Variables Thing variables
	Variables []Variable `json:"variables,omitempty"`

	// WebhookUri Webhook URI
	WebhookUri *string `json:"webhook_uri,omitempty"`
}

type TriggerAction

type TriggerAction struct {
	// Description Description
	Description *string      `json:"description,omitempty"`
	Email       *EmailAction `json:"email,omitempty"`

	// Kind Kind
	Kind *string `json:"kind,omitempty"`

	// Name Name
	Name             string                  `json:"name"`
	PushNotification *PushNotificationAction `json:"push_notification,omitempty"`
}

type TriggerTemplate

type TriggerTemplate struct {
	// Actions Actions
	Actions []TriggerAction `json:"actions,omitempty"`

	// Active Active
	Active *bool `json:"active,omitempty"`

	// Description Description
	Description *string `json:"description,omitempty"`

	// Id Template ID
	Id             string          `json:"id"`
	LinkedDevice   *LinkedDevice   `json:"linked_device,omitempty"`
	LinkedProperty *LinkedProperty `json:"linked_property,omitempty"`

	// Name Name
	Name string `json:"name"`
}

type Variable

type Variable struct {
	// Id Id
	Id *string `json:"id,omitempty"`

	// Name Name
	Name *string `json:"name,omitempty"`

	// Permission Permission
	Permission *string `json:"permission,omitempty"`

	// Type Type
	Type *string `json:"type,omitempty"`

	// UpdateParameter Update parameter
	UpdateParameter *float32 `json:"update_parameter,omitempty"`

	// UpdateStrategy Update strategy
	UpdateStrategy *string `json:"update_strategy,omitempty"`

	// VariableName Variable name
	VariableName *string `json:"variable_name,omitempty"`
}

type Widget

type Widget struct {
	// Height height
	Height *float32 `json:"height,omitempty"`

	// HeightMobile height mobile
	HeightMobile *float32 `json:"height_mobile,omitempty"`

	// Name Name
	Name string `json:"name"`

	// Options Widget options
	Options map[string]interface{} `json:"options,omitempty"`

	// Type Widget type
	Type string `json:"type"`

	// Variables Widget variables
	Variables []WidgetVariable `json:"variables,omitempty"`

	// Width Width
	Width *float32 `json:"width,omitempty"`

	// WidthMobile Width mobile
	WidthMobile *float32 `json:"width_mobile,omitempty"`

	// X x
	X *float32 `json:"x,omitempty"`

	// XMobile x mobile
	XMobile *float32 `json:"x_mobile,omitempty"`

	// Y y
	Y *float32 `json:"y,omitempty"`

	// YMobile y mobile
	YMobile *float32 `json:"y_mobile,omitempty"`
}

type WidgetVariable

type WidgetVariable struct {
	// Name Name
	Name string `json:"name"`

	// Permission Permission
	Permission *string `json:"permission,omitempty"`

	// ThingId Thing ID
	ThingId *string `json:"thing_id,omitempty"`

	// Type Widget type
	Type string `json:"type"`

	// VariableId Variable ID
	VariableId *string `json:"variable_id,omitempty"`
}

Jump to

Keyboard shortcuts

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