UserOption#

class teamworksams.user_option.UserOption(columns: List[str] | None = None, cache: bool = True, interactive_mode: bool = True)[source]#

Bases: object

Options for configuring user-related operations.

Customizes the behavior of get_user(), edit_user(), and create_user(), controlling output columns, caching, and interactive feedback. Optimizes performance and user experience for user data operations. See User and Group Management for usage examples.

Parameters:
  • columns (Optional[List[str]]) – List of column names to include in the output pandas.DataFrame for get_user() (e.g., [‘user_id’, ‘first_name’]). Ignored by edit_user() and create_user(). If None, includes all available columns (e.g., ‘user_id’, ‘email’, ‘groups’). Defaults to None.

  • cache (bool) – If True, reuses an existing AMSClient via get_client(), reducing API calls for multi-function workflows (e.g., fetching then updating users). Set to False for independent sessions. Defaults to True.

  • interactive_mode (bool) – If True, prints status messages (e.g., “Retrieved 5 users”) and tqdm progress bars for operations like edit_user(). Set to False for silent execution in automated scripts. Defaults to True.

columns#

The list of columns to include in the output.

Type:

Optional[List[str]]

cache#

Indicates whether caching is enabled.

Type:

bool

interactive_mode#

Indicates whether interactive mode is enabled.

Type:

bool

Examples

>>> from teamworksams import UserOption
>>> option = UserOption(
...     columns = ["user_id", "first_name", "email"],
...     cache = True,
...     interactive_mode = True
... )
__init__(columns: List[str] | None = None, cache: bool = True, interactive_mode: bool = True)[source]#

See Also#