Risk Profiles¶
class
_incydr_sdk.risk_profiles.client.RiskProfilesV1
(parent)Client for /v1/user-risk-profiles
endpoints.
Usage example:
>>> import incydr
>>> client = incydr.Client(**kwargs)
>>> client.risk_profiles.v1.get_page()
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 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 toNone
(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 'RiskProfilesPage' object.
get_risk_profile
(self, user_id)Get a single risk profile.
Parameters:
- user_id:
str
(required) - The unique ID for the user.
Returns: A RiskProfile
object representing the 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 risk profiles.
Accepts the same parameters as .get_page()
except page_num
.
Returns: A generator yielding individual RiskProfile
objects.
update
(self, user_id, notes=None, start_date=None, end_date=None)Updates a risk profile.
Parameters
- notes:
str
- Additional notes for the 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 RiskProfile
object.