Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.principal

Module Contents

RobotoPrincipal

class roboto.principal.RobotoPrincipal(/, **data)#View Source

Bases: pydantic.BaseModel

Represents a principal (user, organization, device, etc.) in the Roboto platform.

Parameters

data Any

RobotoPrincipal.for_device()

classmethod for_device(device_id, org_id)#View Source

Create a principal representing a device.

Parameters

device_id str

Unique identifier for the device.

org_id str

Organization ID that owns the device.

Returns

A RobotoPrincipal instance configured for the specified device.

RobotoPrincipal.for_integration()

classmethod for_integration(integration_id)#View Source

Create a principal representing a third-party integration.

Parameters

integration_id str

Unique identifier for the integration.

Returns

A RobotoPrincipal instance configured for the specified integration.

RobotoPrincipal.for_invocation()

classmethod for_invocation(invocation_id)#View Source

Create a principal representing an invocation.

Parameters

invocation_id str

Unique identifier for the invocation.

Returns

A RobotoPrincipal instance configured for the specified invocation.

RobotoPrincipal.for_org()

classmethod for_org(org_id)#View Source

Create a principal representing an organization.

Parameters

org_id str

Unique identifier for the organization.

Returns

A RobotoPrincipal instance configured for the specified organization.

RobotoPrincipal.for_user()

classmethod for_user(user_id)#View Source

Create a principal representing a user.

Parameters

user_id str

Unique identifier for the user.

Returns

A RobotoPrincipal instance configured for the specified user.

RobotoPrincipal.from_string()

classmethod from_string(serialized_principal)#View Source

Create a principal from a serialized string representation.

Parameters

serialized_principal str

String in format “ptype:id”.

Returns

A RobotoPrincipal instance parsed from the string.

Raises

ValueError

If the serialized principal is not in the correct format.

Attributes

RobotoPrincipal.id

id str #

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.ptype

The type of principal (user or organization).

RobotoPrincipal.validate_id()

validate_id(value)#View Source

Parameters

value str

Return type

str

RobotoPrincipalType

class roboto.principal.RobotoPrincipalType#View Source

Bases: roboto.compat.StrEnum

Types of principals supported by the Roboto platform.

Attributes

RobotoPrincipalType.Device

Device = 'device' #

RobotoPrincipalType.Integration

Integration = 'integration' #

A third-party integration which has been granted limited access to the Roboto platform.

RobotoPrincipalType.Invocation

Invocation = 'invocation' #

RobotoPrincipalType.Org

Org = 'org' #

RobotoPrincipalType.User

User = 'user' #

Was this page helpful?