roboto.principal
Module Contents
RobotoPrincipal
Bases: pydantic.BaseModel
Represents a principal (user, organization, device, etc.) in the Roboto platform.
Parameters
data AnyRobotoPrincipal.for_device()
Create a principal representing a device.
Parameters
device_id strUnique identifier for the device.
org_id strOrganization ID that owns the device.
Returns
A RobotoPrincipal instance configured for the specified device.
RobotoPrincipal.for_integration()
Create a principal representing a third-party integration.
Parameters
integration_id strUnique identifier for the integration.
Returns
A RobotoPrincipal instance configured for the specified integration.
RobotoPrincipal.for_invocation()
Create a principal representing an invocation.
Parameters
invocation_id strUnique identifier for the invocation.
Returns
A RobotoPrincipal instance configured for the specified invocation.
RobotoPrincipal.for_org()
Create a principal representing an organization.
Parameters
org_id strUnique identifier for the organization.
Returns
A RobotoPrincipal instance configured for the specified organization.
RobotoPrincipal.for_user()
Create a principal representing a user.
Parameters
user_id strUnique identifier for the user.
Returns
A RobotoPrincipal instance configured for the specified user.
RobotoPrincipal.from_string()
Create a principal from a serialized string representation.
Parameters
serialized_principal strString in format “ptype:id”.
Returns
A RobotoPrincipal instance parsed from the string.
Raises
ValueErrorIf the serialized principal is not in the correct format.
Attributes
RobotoPrincipal.id
Fully qualified principal ID.
For resources which have universally unique IDs (e.g. users, orgs, invocations, datasets, files, etc.) this will just be the resource ID.
For resources which have org-unique IDs (e.g. devices, actions), this will be the resource ID + “@” + the org ID, e.g. a device sn001 in org og_67890 will have a fully qualified ID of sn001@og_67890.
RobotoPrincipal.validate_id()
Parameters
value strReturn type
RobotoPrincipalType
Bases: roboto.compat.StrEnum
Types of principals supported by the Roboto platform.
Attributes
RobotoPrincipalType.Integration
A third-party integration which has been granted limited access to the Roboto platform.