roboto.domain.users#
Submodules#
Package Contents#
- class roboto.domain.users.CreateUserRequest(/, **data)#
Bases:
pydantic.BaseModel
Request payload to create a new user.
- Parameters:
data (Any)
- default_notification_channels: list[roboto.notifications.NotificationChannel] | None#
Default notification channels to enable for the user.
- default_notification_types: list[roboto.notifications.NotificationType] | None#
Default notification types to enable for the user.
- is_service_user: bool = False#
Whether this is a service user for automated operations.
- is_system_user: bool = False#
Whether this is a system user for internal platform operations.
- name: str | None = None#
Human-readable display name for the user.
- picture_url: str | None = None#
URL to the user’s profile picture.
- user_id: str#
Unique identifier for the user, typically an email address.
- class roboto.domain.users.UpdateUserRequest(/, **data)#
Bases:
pydantic.BaseModel
Request payload to update an existing user.
- Parameters:
data (Any)
- name: str | None = None#
Updated display name for the user.
- notification_channels_enabled: dict[roboto.notifications.NotificationChannel, bool] | None = None#
Updated notification channel preferences.
- notification_types_enabled: dict[roboto.notifications.NotificationType, bool] | None = None#
Updated notification type preferences.
- picture_url: str | None = None#
Updated URL to the user’s profile picture.
- class roboto.domain.users.User(record, roboto_client=None)#
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.http.RobotoClient])
- classmethod create(request, roboto_client=None)#
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:
request (roboto.domain.users.operations.CreateUserRequest) – User creation request containing user details.
roboto_client (Optional[roboto.http.RobotoClient]) – Optional Roboto client instance. If not provided, uses the default client.
- Returns:
A new User instance representing the created user.
- Raises:
RobotoUnauthorizedException – The caller is not authorized to create users.
RobotoInvalidRequestException – The request contains invalid data.
- Return type:
Examples
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 itself
- delete()#
Delete this user from Roboto.
Permanently removes the user and all associated data. This action cannot be undone.
- Raises:
RobotoUnauthorizedException – The caller is not authorized to delete this user.
RobotoNotFoundException – The user no longer exists.
- Return type:
None
Examples
Delete the current user:
>>> from roboto import User >>> user = User.for_self() >>> user.delete() # Permanently removes the user
- classmethod for_self(roboto_client=None)#
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.http.RobotoClient]) – Optional Roboto client instance. If not provided, uses the default client.
- Returns:
User instance representing the authenticated user.
- Raises:
RobotoUnauthorizedException – No valid authentication credentials provided.
- Return type:
Examples
Get the current user:
>>> from roboto import User >>> current_user = User.for_self() >>> print(f"Current user: {current_user.name}")
- classmethod from_id(user_id, roboto_client=None)#
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 (str) – Unique identifier for the user to retrieve.
roboto_client (Optional[roboto.http.RobotoClient]) – Optional Roboto client instance. If not provided, uses the default client.
- Returns:
User instance for the specified user ID.
- Raises:
RobotoNotFoundException – No user exists with the specified ID.
RobotoUnauthorizedException – The caller is not authorized to access this user.
- Return type:
Examples
Load a user by email:
>>> from roboto import User >>> user = User.from_id("alice@example.com") >>> print(f"User name: {user.name}")
- property name: str | None#
Human-readable display name for this user.
- Returns:
The user’s display name, or None if not set.
- Return type:
Optional[str]
- property record: roboto.domain.users.record.UserRecord#
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.
- Return type:
- to_dict()#
Convert this user to a dictionary representation.
Returns a JSON-serializable dictionary containing all user data.
- Returns:
Dictionary representation of the user.
- Return type:
dict[str, Any]
Examples
Export user data:
>>> from roboto import User >>> user = User.for_self() >>> user_data = user.to_dict() >>> print(f"User created: {user_data.get('created')}")
- update(name=None, picture_url=None, notification_channels_enabled=None, notification_types_enabled=None)#
- Parameters:
name (Optional[str])
picture_url (Optional[str])
notification_channels_enabled (Optional[dict[roboto.notifications.NotificationChannel, bool]])
notification_types_enabled (Optional[dict[roboto.notifications.NotificationType, bool]])
- Return type:
- property user_id: str#
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.
- Return type:
str
- class roboto.domain.users.UserRecord(/, **data)#
Bases:
pydantic.BaseModel
A wire-transmissible representation of a user.
- Parameters:
data (Any)
- is_comment_mentions_enabled()#
- Return type:
bool
- is_email_notifications_enabled()#
- Return type:
bool
- is_service_user: bool = False#
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.
- is_system_user: bool | None = False#
Whether this is a system user for internal platform operations.
- name: str | None = None#
Human-readable display name for the user.
- notification_channels_enabled: dict[roboto.notifications.NotificationChannel, bool] = None#
Mapping of notification channels to their enabled/disabled status.
- notification_types_enabled: dict[roboto.notifications.NotificationType, bool] = None#
Mapping of notification types to their enabled/disabled status.
- picture_url: str | None = None#
URL to the user’s profile picture.
- user_id: str#
Unique identifier for the user, typically an email address.