Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/source/Resources/Devices/Devices_Type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ DeviceCreateInfoBasicMutable



.. _DeviceCreateInfoBasicImutable:
.. _DeviceCreateInfoBasicImmutable:

DeviceCreateInfoBasicImutable
DeviceCreateInfoBasicImmutable
--------------------------------

**Attributes:**
Expand All @@ -281,7 +281,7 @@ DeviceCreateInfoBasicImutable
| **network**: :ref:`GenericID`
| Network ID.

| **type**: "imutable"
| **type**: "immutable"
| Device's data storage (bucket) type.
| :default: "legacy"

Expand Down Expand Up @@ -332,7 +332,7 @@ DeviceCreateInfoMutable
DeviceCreateInfoImmutable
--------------------------

**DeviceCreateInfoImmutable** = DeviceCreateInfoBasicImutable
**DeviceCreateInfoImmutable** = DeviceCreateInfoBasicImmutable


.. _DeviceCreateInfo:
Expand Down
2 changes: 1 addition & 1 deletion src/tagoio_sdk/modules/Resources/Buckets_Type.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from tagoio_sdk.common.Common_Type import TagsObj


DataStorageType = Literal["immutable", "mutable", "legacy"]
DataStorageType = Literal["immutable", "mutable", "legacy", "hybrid"]


class ExportBucketOption(TypedDict):
Expand Down
103 changes: 99 additions & 4 deletions src/tagoio_sdk/modules/Resources/Device_Type.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ class DeviceInfo(TypedDict):
"""
Date for the device's last data retention.
"""
mutable_variable_regex: str or None
"""
Regex that routes each variable to the mutable side at insert time (unanchored substring match).

It must not match every variable or no variable; use a mutable or immutable device for those cases.

Present for Hybrid devices. Can only be changed while the device is empty.
"""


class DeviceInfoList(TypedDict):
Expand Down Expand Up @@ -270,7 +278,74 @@ class DeviceCreateInfoBasicMutable(TypedDict):
"""


class DeviceCreateInfoBasicImutable(TypedDict):
class DeviceCreateInfoBasicImmutable(TypedDict):
name: str
"""
Device name.
"""
connector: GenericID
"""
Connector ID.
"""
network: GenericID
"""
Network ID.
"""
type: Literal["immutable"]
"""
Device's data storage (bucket) type.

:default: "legacy"
"""
description: str or None
"""
Description of the device.
"""
active: bool
"""
Set if the device will be active.
"""
visible: bool
"""
Set if the device will be visible.
"""
configuration_params: list[ConfigurationParams]
"""
An array of configuration params
"""
tags: list[TagsObj]
"""
An array of tags
"""
serie_number: str
"""
Device serial number.
"""
connector_parse: bool
"""
If device will use connector parser
"""
parse_function: str
"""
Javascript code for use as payload parser
"""
chunk_period: Literal["day", "week", "month", "quarter"]
"""
Chunk division to retain data in the device.

Required for Immutable devices.
"""
chunk_retention: Union[int, float]
"""
Amount of chunks to retain data according to the `chunk_period`.

Integer between in the range of 0 to 36 (inclusive).

Required for Immutable devices.
"""


class DeviceCreateInfoBasicHybrid(TypedDict):
name: str
"""
Device name.
Expand All @@ -283,7 +358,7 @@ class DeviceCreateInfoBasicImutable(TypedDict):
"""
Network ID.
"""
type: Literal["imutable"]
type: Literal["hybrid"]
"""
Device's data storage (bucket) type.

Expand Down Expand Up @@ -335,13 +410,25 @@ class DeviceCreateInfoBasicImutable(TypedDict):

Required for Immutable devices.
"""
mutable_variable_regex: str
"""
Regex that routes each variable to the mutable side at insert time (unanchored substring match).

It must not match every variable or no variable; use a mutable or immutable device for those cases.

Required for Hybrid devices. Can only be changed while the device is empty.
"""


DeviceCreateInfoMutable = DeviceCreateInfoBasicMutable

DeviceCreateInfoImmutable = DeviceCreateInfoBasicImutable
DeviceCreateInfoImmutable = DeviceCreateInfoBasicImmutable

DeviceCreateInfoHybrid = DeviceCreateInfoBasicHybrid

DeviceCreateInfo = DeviceCreateInfoMutable or DeviceCreateInfoImmutable
DeviceCreateInfo = (
DeviceCreateInfoMutable or DeviceCreateInfoImmutable or DeviceCreateInfoHybrid
)


class DeviceEditInfo(TypedDict):
Expand Down Expand Up @@ -397,6 +484,14 @@ class DeviceEditInfo(TypedDict):

Required for Immutable devices.
"""
mutable_variable_regex: Optional[str]
"""
Regex that routes each variable to the mutable side at insert time (unanchored substring match).

It must not match every variable or no variable; use a mutable or immutable device for those cases.

Required for Hybrid devices. Can only be changed while the device is empty.
"""


DeviceEditInfo = DeviceEditInfo
Expand Down
Loading