roboto.association
Module Contents
Association
Bases: pydantic.BaseModel
Use to declare an association between two Roboto entities.
Parameters
data AnyAttributes
Association.URL_ENCODING_SEP
Association.association_type
association_type is the Roboto domain entity type of the association.
Association.association_version
association_version is the Roboto domain entity version of the association, if it exists.
Association.coalesce()
Parameters
associations Optional[collections.dataset_ids Optional[collections.file_ids Optional[collections.topic_ids Optional[collections.message_path_ids Optional[collections.throw_on_empty boolReturn type
Association.dataset()
Parameters
dataset_id strReturn type
Properties
Association.device()
Create an association with a device.
Parameters
universal_device_id strThe device’s Roboto-assigned dv_ ID (universal_device_id), not its customer-chosen device_id.
Return type
Usage
Association.device("dv_abc123")
# Association(association_id='dv_abc123', association_type=<AssociationType.Device: 'device'>, ...)Association.file()
Parameters
file_id strversion Optional[int]Properties
Association.from_id()
Infer the association type from the ID prefix.
Roboto IDs follow the pattern {prefix}_{random_chars} where the prefix indicates the entity type:
ds_→ Datasetfl_→ Filetp_→ Topicmp_→ MessagePathdv_→ Deviceog_→ Org
Parameters
association_id strA Roboto entity ID with a recognized prefix.
Returns
An Association with the inferred type.
Raises
If the ID prefix is not recognized.
Usage
Association.from_id("ds_abc123")
# Association(association_id='ds_abc123', association_type=AssociationType.Dataset)Association.from_url_encoded_value()
Reverse of Association::url_encode.
Parameters
encoded strReturn type
Association.group_by_type()
Parameters
associations collections.Return type
Properties
Association.msgpath()
Parameters
msgpath_id strReturn type
Association.org()
Create an association with an organization.
Parameters
org_id strThe organization’s ID.
Return type
Usage
Association.org("og_abc123")
# Association(association_id='og_abc123', association_type=<AssociationType.Org: 'org'>, ...)Attributes
Association.parent
The next level up in the hierarchy of this association. A message path’s parent is its topic, a topic’s parent is its file, and a file’s parent is its dataset.
The absense of a parent in an Association object doesn’t necessarily mean that a parent doesn’t exist; parents are only provided when they’re easily computable in the context of a given request.
Association.topic()
Parameters
topic_id strProperties
Association.url_encode()
Association encoded in a URL path segment ready format.
Return type
AssociationType
Bases: enum.Enum
AssociationType is the Roboto domain entity type of the association.