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

roboto.domain.users

Submodules

Package Contents

CreateUserRequest

class roboto.domain.users.CreateUserRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload to create a new user.

Parameters

data Any

Attributes

CreateUserRequest.default_notification_channels

default_notification_channels list[roboto.notifications.NotificationChannel] | None #

Default notification channels to enable for the user.

CreateUserRequest.default_notification_types

default_notification_types list[roboto.notifications.NotificationType] | None #

Default notification types to enable for the user.

CreateUserRequest.is_service_user

is_service_user bool = False #

Whether this is a service user for automated operations.

CreateUserRequest.is_system_user

is_system_user bool = False #

Whether this is a system user for internal platform operations.

CreateUserRequest.name

name str | None = None #

Human-readable display name for the user.

CreateUserRequest.picture_url

picture_url str | None = None #

URL to the user’s profile picture.

CreateUserRequest.user_id

user_id str #

Unique identifier for the user, typically an email address.

UpdateUserRequest

class roboto.domain.users.UpdateUserRequest(/, **data)#View Source

Bases: pydantic.BaseModel

Request payload to update an existing user.

Parameters

data Any

Attributes

UpdateUserRequest.name

name str | None = None #

Updated display name for the user.

UpdateUserRequest.notification_channels_enabled

notification_channels_enabled dict[roboto.notifications.NotificationChannel, bool] | None = None #

Updated notification channel preferences.

UpdateUserRequest.notification_types_enabled

notification_types_enabled dict[roboto.notifications.NotificationType, bool] | None = None #

Updated notification type preferences.

UpdateUserRequest.picture_url

picture_url str | None = None #

Updated URL to the user’s profile picture.

UpdateUserRequest.validate_non_empty_string()

classmethod validate_non_empty_string(value, info)#View Source

Parameters

value Optional[str]
info pydantic.ValidationInfo

Return type

Optional[str]

User

class roboto.domain.users.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.

UserRecord

class roboto.domain.users.UserRecord(/, **data)#View Source

Bases: pydantic.BaseModel

A wire-transmissible representation of a user.

Parameters

data Any

UserRecord.is_comment_mentions_enabled()

is_comment_mentions_enabled()#View Source

Return type

bool

UserRecord.is_email_notifications_enabled()

is_email_notifications_enabled()#View Source

Return type

bool

Attributes

UserRecord.is_service_user

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.

UserRecord.is_system_user

is_system_user bool | None = False #

Whether this is a system user for internal platform operations.

UserRecord.name

name str | None = None #

Human-readable display name for the user.

UserRecord.notification_channels_enabled

notification_channels_enabled dict[roboto.notifications.NotificationChannel, bool] = None #

Mapping of notification channels to their enabled/disabled status.

UserRecord.notification_types_enabled

notification_types_enabled dict[roboto.notifications.NotificationType, bool] = None #

Mapping of notification types to their enabled/disabled status.

UserRecord.picture_url

picture_url str | None = None #

URL to the user’s profile picture.

UserRecord.user_id

user_id str #

Unique identifier for the user, typically an email address.

Was this page helpful?