User

class lightning_sdk.User(name=None)

Bases: Owner

Represents a user owner of teamspaces and studios.

Parameters:

Note

Arguments will be automatically inferred from environment variables if possible, unless explicitly specified

create_teamspace(name)

Create a new teamspace owned by this user.

Can only be called for the currently authenticated user.

Parameters:
  • name (str) – The name for the new teamspace.

  • name (str)

Returns:

The newly created teamspace.

Return type:

Teamspace

Raises:

ValueError – If called for a user other than the authenticated user.

delete_secret(key)

Delete an encrypted secret for the user.

Parameters:
  • key (str) – Secret name. Must contain only alphanumeric characters and underscores, and must not start with a digit.

  • key (str)

Raises:

ValueError – If the key contains invalid characters or does not exist.

Return type:

None

set_secret(key, value)

Set an encrypted secret for the user.

Parameters:
  • key (str) – Secret name. Must contain only alphanumeric characters and underscores, and must not start with a digit.

  • value (str) – The secret value to store (encrypted at rest).

  • key (str)

  • value (str)

Raises:

ValueError – If the key contains invalid characters.

Return type:

None

property id: str

The user’s ID.

property name: str

The user’s name.

property organizations: List[Organization]

All organizations the user belongs to.

Can only be retrieved for the currently authenticated user.

Returns:

The organizations this user is a member of.

Return type:

list[Organization]

Raises:

ValueError – If called for a user other than the authenticated user.

property secrets: Dict[str, str]

All (encrypted) secrets for the user.

Note

Once created, the secret values are encrypted and cannot be viewed here anymore.

Was this page helpful?

What went wrong?

↑↓ Navigate↵ Open⌘↵ New tabesc Close