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()
, andcreate_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
forget_user()
(e.g., [‘user_id’, ‘first_name’]). Ignored byedit_user()
andcreate_user()
. If None, includes all available columns (e.g., ‘user_id’, ‘email’, ‘groups’). Defaults to None.cache (bool) – If True, reuses an existing
AMSClient
viaget_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 likeedit_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 ... )
See Also#
User and Group Management: User update workflows.