Watchlists
- class py42.clients.watchlists.WatchlistType
Bases:
py42.choices.Choices
Constants available for setting the type of watchlist.
CONTRACT_EMPLOYEE
DEPARTING_EMPLOYEE
ELEVATED_ACCESS_PRIVILEGES
FLIGHT_RISK
HIGH_IMPACT_EMPLOYEE
NEW_EMPLOYEE
PERFORMANCE_CONCERNS
POOR_SECURITY_PRACTICES
SUSPICIOUS_SYSTEM_ACTIVITY
CUSTOM
- class py42.clients.watchlists.WatchlistsClient(watchlists_service)
Bases:
object
A client to expose the watchlists API.
- add_included_users_by_watchlist_id(user_ids, watchlist_id)
Explicitly include users on a watchlist.
- Parameters
user_ids (list(str) – A list of user IDs to add to the watchlist
watchlist_id (str) – A unique watchlist ID.
- Returns
- add_included_users_by_watchlist_type(user_ids, watchlist_type)
Explicitly include users on a watchlist.
- Parameters
user_ids (list(str) – A list of user IDs to add to the watchlist
watchlist_type (str) – Type of watchlist. Constants available at
py42.constants.WatchlistType
.
- Returns
- create(watchlist_type, title=None, description=None)
Create a new watchlist.
- Parameters
watchlist_type (str) – Type of watchlist. Constants available at
py42.constants.WatchlistType
.title (str, optional) – Name of watchlist (for CUSTOM watchlists only).
description (str, optional) – Description of watchlist (for CUSTOM watchlists only).
- Returns
- delete(watchlist_id)
Delete a watchlist.
- Parameters
watchlist_id (str) – A unique watchlist ID.
- Returns
- get(watchlist_id)
Get a watchlist.
- Parameters
watchlist_id (str) – A unique watchlist ID.
- Returns
- get_all()
Get all watchlists.
- Returns
An object that iterates over
py42.response.Py42Response
objects that each contain a page of watchlists.- Return type
generator
- get_all_included_users(watchlist_id)
Get all users explicitly included on a watchlist.
- Parameters
watchlist_id (str) – A unique watchlist ID.
- Returns
An object that iterates over
py42.response.Py42Response
objects that each contain a page of included users that match the given query.- Return type
generator
- get_all_watchlist_members(watchlist_id)
Get all members of a watchlist.
- Parameters
watchlist_id (str) – A unique watchlist ID.
- Returns
An object that iterates over
py42.response.Py42Response
objects that each contain a page of watchlist members.- Return type
generator
- get_watchlist_member(watchlist_id, user_id)
Get a member of a watchlist.
- Parameters
watchlist_id (str) – A unique watchlist ID.
user_id (str) – A unique user ID.
- Returns
- remove_included_users_by_watchlist_id(user_ids, watchlist_id)
Remove users that are explicitly included on a watchlist.
- Parameters
user_ids (list(str) – A list of user IDs to remove from the watchlist
watchlist_id (str) – A unique watchlist ID.
- Returns
- remove_included_users_by_watchlist_type(user_ids, watchlist_type)
Remove users that are explicitly included on a watchlist.
- Parameters
user_ids (list(str) – A list of user IDs to remove from the watchlist
watchlist_type (str) – Type of watchlist. Constants available at
py42.constants.WatchlistType
.
- Returns