roboto.domain.users
Submodules
Package Contents
CreateUserRequest
Bases: pydantic.BaseModel
Request payload to create a new user.
Parameters
data AnyAttributes
CreateUserRequest.default_notification_channels
Default notification channels to enable for the user.
CreateUserRequest.default_notification_types
Default notification types to enable for the user.
CreateUserRequest.is_service_user
Whether this is a service user for automated operations.
CreateUserRequest.is_system_user
Whether this is a system user for internal platform operations.
UpdateUserRequest
Bases: pydantic.BaseModel
Request payload to update an existing user.
Parameters
data AnyAttributes
UpdateUserRequest.notification_channels_enabled
Updated notification channel preferences.
UpdateUserRequest.notification_types_enabled
Updated notification type preferences.
UpdateUserRequest.picture_url
Updated URL to the user’s profile picture.
UpdateUserRequest.validate_non_empty_string()
Parameters
value Optional[str]info pydantic.Return type
User
Represents an individual who has access to the Roboto platform.
Users are the fundamental identity entities in Roboto. They can be members of organizations, create and manage datasets and files within those organizations, and execute actions. Users are created during the signup process and cannot be instantiated directly by SDK users.
User IDs are globally unique across the entire Roboto platform and typically correspond to email addresses for human users or service identifiers for automated users.
Parameters
roboto_client Optional[roboto.User.create()
Create a new user in Roboto.
This API is only used by the Roboto platform itself as part of the signup process. Any other caller will receive an Unauthorized response from the Roboto service.
Parameters
User creation request containing user details.
roboto_client Optional[roboto.Optional Roboto client instance. If not provided, uses the default client.
Returns
A new User instance representing the created user.
Raises
The caller is not authorized to create users.
The request contains invalid data.
Usage
Create a new service user:
from roboto import CreateUserRequest, User
request = CreateUserRequest(user_id="service@example.com", name="Service User", is_service_user=True)
user = User.create(request) # Only works for platform itselfUser.delete()
Delete this user from Roboto.
Permanently removes the user and all associated data. This action cannot be undone.
Raises
The caller is not authorized to delete this user.
The user no longer exists.
Return type
Usage
Delete the current user:
from roboto import User
user = User.for_self()
user.delete() # Permanently removes the userUser.for_self()
Retrieve the current authenticated user.
Returns the User object for the currently authenticated user based on the authentication credentials in the provided or default client.
Parameters
roboto_client Optional[roboto.Optional Roboto client instance. If not provided, uses the default client.
Returns
User instance representing the authenticated user.
Raises
No valid authentication credentials provided.
Usage
Get the current user:
from roboto import User
current_user = User.for_self()
print(f"Current user: {current_user.name}")User.from_id()
Load an existing user by their unique user ID.
User IDs are globally unique across the Roboto platform and typically correspond to email addresses for human users.
Parameters
user_id strUnique identifier for the user to retrieve.
roboto_client Optional[roboto.Optional Roboto client instance. If not provided, uses the default client.
Returns
User instance for the specified user ID.
Raises
No user exists with the specified ID.
The caller is not authorized to access this user.
Usage
Load a user by email:
from roboto import User
user = User.from_id("alice@example.com")
print(f"User name: {user.name}")Properties
User.name
Human-readable display name for this user.
Returns
The user’s display name, or None if not set.
User.record
Access the underlying user record.
Provides access to the raw UserRecord containing all user data fields. This is useful for accessing fields not exposed as properties.
Returns
The underlying UserRecord instance.
User.to_dict()
Convert this user to a dictionary representation.
Returns a JSON-serializable dictionary containing all user data.
Returns
Dictionary representation of the user.
Usage
Export user data:
from roboto import User
user = User.for_self()
user_data = user.to_dict()
print(f"User created: {user_data.get('created')}")User.update()
Parameters
name Optional[str]picture_url Optional[str]notification_channels_enabled Optional[dict[roboto.notification_types_enabled Optional[dict[roboto.Return type
Properties
User.user_id
Unique identifier for this user.
User IDs are globally unique across the Roboto platform and typically correspond to email addresses for human users.
Returns
The user’s unique identifier.
UserRecord
Bases: pydantic.BaseModel
A wire-transmissible representation of a user.
Parameters
data AnyUserRecord.is_comment_mentions_enabled()
Return type
UserRecord.is_email_notifications_enabled()
Return type
Attributes
UserRecord.is_service_user
Whether this is a service user for automated operations.
Service users can be used to perform actions on behalf of customers. For example, a service user can be associated with a Trigger, which will then invoke its corresponding Action as the service user.
UserRecord.is_system_user
Whether this is a system user for internal platform operations.
UserRecord.notification_channels_enabled
Mapping of notification channels to their enabled/disabled status.
UserRecord.notification_types_enabled
Mapping of notification types to their enabled/disabled status.