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

roboto.domain.users.user

Module Contents

User

class roboto.domain.users.user.User(record, roboto_client=None)#View Source

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

User.create()

classmethod create(request, roboto_client=None)#View Source

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.http.RobotoClient]

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 itself

User.delete()

delete()#View Source

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

None

Usage

Delete the current user:

from roboto import User
user = User.for_self()
user.delete()  # Permanently removes the user

User.for_self()

classmethod for_self(roboto_client=None)#View Source

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

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()

classmethod from_id(user_id, roboto_client=None)#View Source

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

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

name str | None #

Human-readable display name for this user.

Returns

Optional[str]

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()

to_dict()#View Source

Convert this user to a dictionary representation.

Returns a JSON-serializable dictionary containing all user data.

Returns

dict[str, Any]

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()

update(name=None, picture_url=None, notification_channels_enabled=None, notification_types_enabled=None)#View Source

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

Properties

User.user_id

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

str

The user’s unique identifier.

Was this page helpful?