Skip to content

User Risk Profiles

class _incydr_sdk.user_risk_profiles.client.UserRiskProfilesV1(parent)

Client for /v1/user-risk-profiles endpoints.

Usage example:

>>> import incydr
>>> client = incydr.Client(**kwargs)
>>> client.user_risk_profiles.v1.get_page()
add_cloud_alias(self, user_id, cloud_alias)

Add cloud aliases to a user risk profile.

A cloud alias is the username an employee uses to access cloud services such as Google Drive or Box. Adding a cloud alias allows Incydr to link a user's cloud activity with their Code42 username. Each user has a default cloud alias of their Code42 username. You can add one additional alias.

Parameters:

  • user_id: str - User ID of the profile to update.
  • cloud_alias: str - The new cloud alias to add to the user risk profile.

Returns: A requests.Response indicating success.

delete_cloud_alias(self, user_id, cloud_alias)

Delete a cloud alias from a user risk profile.

Parameters:

  • user_id: str - User ID of the profile to update.
  • cloud_alias: str - The cloud alias to remove from the user risk profile.

Returns: A requests.Response indicating success.

get_page(self, page_num=1, page_size=None, manager_id=None, title=None, division=None, department=None, employment_type=None, country=None, region=None, locality=None, active=None, deleted=None, support_user=None)

Get a page of user risk profiles.

Filter results by passing the appropriate parameters:

Parameters:

  • page_num: int - Page number for results, starting at 1.
  • page_size: int - Max number of results to return per page.
  • manager_id: str - The Code42 user ID of the user's manager to search for.
  • title: str - The user's job title to search for.
  • division: str - The user's division to search for.
  • department: str - The user's department to search for.
  • employment_type: str - The user's employment type to search for.
  • country: str - The user's country to search for.
  • region: str - The user's region (state) to search for.
  • locality: str - The user's locality (city) to search for. ** active: bool | None - When true, return only active users. When false, return only inactive users. Defaults to None (returning both).
  • deleted: bool | None - When true, return only deleted users. When false, return only non-deleted users. Defaults to returning both.
  • support_user: bool | None - When true, return only support users. When false, return only non-support users. Defaults to returning both

Returns: A 'UserRiskProfilesPage' object.

get_user_risk_profile(self, user_id)

Get a single user risk profile.

Parameters:

  • user_id: str (required) - The unique ID for the user.

Returns: A UserRiskProfile object representing the user risk profile.

iter_all(self, page_size=None, manager_id=None, title=None, division=None, department=None, employment_type=None, country=None, region=None, locality=None, active=None, deleted=None, support_user=None)

Iterate over all user risk profiles.

Accepts the same parameters as .get_page() except page_num.

Returns: A generator yielding individual UserRiskProfile objects.

update(self, user_id, notes=None, start_date=None, end_date=None)

Updates a user risk profile.

Parameters

  • notes: str - Additional notes for the user risk profile.
  • start_date: datetime - The starting date for the user. Accepts a datetime object or a string in the format yyyy-MM-dd (UTC) format. Pass an empty string to clear the field.
  • end_date: datetime - The departure date for the user. Accepts a datetime object or a string in the format yyyy-MM-dd (UTC) format. Pass an empty string to clear the field.

Returns: A UserRiskProfile object.