Departing Employee¶
-
class
py42.clients.detectionlists.departing_employee.DepartingEmployeeClient(session, user_context)¶ Bases:
py42.clients.BaseClientA client for interacting with Code42 Departing Employee APIs.
-
create(username, tenant_id=None, notes=None, departure_epoch=None, cloud_usernames=None)¶ Adds a user to Departing Employees. REST Documentation
- Parameters
username (str) – The username of the departing employee.
tenant_id (str, optional) – The identifier of the Customer tenant the user is in. Defaults to None (the tenant_id of SDK authorization user will be used).
notes (str, optional) – Optional descriptive information. Defaults to None.
departure_epoch (int, optional) – Employee departure date as POSIX timestamp. Defaults to None.
cloud_usernames (list, optional) – List of alternate usernames for this user from external data sources being searched by Forensic File Search (Google Drive, Box, OneDrive, Gmail, Office 365). Defaults to None.
- Returns
-
get_all(tenant_id=None, departing_on_or_after_epoch=None, sort_key='CREATED_AT', sort_direction='DESC')¶ Gets all Departing Employees.
- Parameters
tenant_id (str, optional) – The identifier of the Customer tenant. Defaults to None (the tenant_id of SDK authorization user will be used).
departing_on_or_after_epoch (int, optional) – Filter results by the departure date of employee, requires a POSIX timestamp. Defaults to None.
sort_key (str, optional) – Key to sort results on. Options: (
CREATED_AT,DEPARTURE_DATE,DISPLAY_NAME,NUM_EVENTS,TOTAL_BYTES). Defaults toCREATED_AT.sort_direction (str, optional) – Sort direction. Options: (
ASC,DESC). Defaults toDESC.
- Returns
An object that iterates over
py42.sdk.response.Py42Responseobjects that each contain a page of departing employees.- Return type
generator
-
get_by_id(case_id, tenant_id=None)¶ Gets details about a Departing Employee case. REST Documentation
- Parameters
case_id (str) – Identifier of the Departing Employee case.
tenant_id (str, optional) – The identifier of the Customer tenant the case is in. Defaults to None (the tenant_id of SDK authorization user will be used).
- Returns
A response containing the Departing Employee case.
- Return type
-
get_by_username(username, tenant_id=None)¶ Gets Departing Employee case detail for a given user.
- Parameters
username (str) – Username of the Departing Employee to retrieve case info on.
tenant_id (str, optional) – The identifier of the Customer tenant the case is in. Defaults to None (the tenant_id of SDK authorization user will be used).
- Returns
A response containing the Departing Employee case.
- Return type
-
resolve(case_id, tenant_id=None)¶ Removes a user from Departing Employees. REST Documentation
- Parameters
case_id (str) – The identifier of the Departing Employee.
tenant_id (str, optional) – The identifier of the Customer tenant the case is in. Defaults to None (the tenant_id of SDK authorization user will be used).
- Returns
-
toggle_alerts(tenant_id=None, alerts_enabled=True)¶ Enable or disable email alerting on Departing Employee exposure events. REST Documentation
- Parameters
tenant_id (str, optional) – The identifier of the Customer tenant. Defaults to None (the tenant_id of SDK authorization user will be used).
alerts_enabled (bool) – Set alerting to on (True) or off (False). Defaults to True.
- Returns
-
update(case_id, tenant_id=None, display_name=None, notes=None, departure_epoch=None, cloud_usernames=None)¶ Add or modify details of an existing Departing Employee case. REST Documentation
- Parameters
case_id (str) – Identifier of the Departing Employee case.
tenant_id (str, optional) – The identifier of the Customer tenant the case is in. Defaults to None (the tenant_id of SDK authorization user will be used).
display_name (str, optional) – The display name for the Departing Employee case. This defaults to username when adding a new Departing Employee, so it can be used to make the UI more user-friendly if your Organization has usernames that don’t correspond to real names. Defaults to None.
notes (str, optional) – Optional descriptive information. Defaults to None.
departure_epoch (int, optional) – Employee departure date as POSIX timestamp. Defaults to None.
cloud_usernames (list, optional) – List of alternate usernames for this user from external data sources being searched by Forensic File Search (Google Drive, Box, OneDrive, Gmail, Office 365). Defaults to None.
- Returns
-