178178import time
179179import urllib .parse
180180import warnings
181- from typing import List , Optional
182181from datetime import datetime , timedelta , timezone
182+ from typing import List , Optional
183183
184184from . import Accounts , client
185+
185186USER_STATUS_ACTIVE = "active"
186187USER_STATUS_BYPASS = "bypass"
187188USER_STATUS_DISABLED = "disabled"
@@ -3760,6 +3761,49 @@ def update_passport_config(self, enabled_status, enabled_groups: Optional[List[s
37603761 )
37613762 return response
37623763
3764+ def start_idv (self , user_id ):
3765+ """
3766+ Start identity verification process
3767+
3768+ Args:
3769+ user_id (str) - The ID of the Duo user (required)
3770+
3771+ Returns (dict) - Dictionary containing details of IDV process
3772+ """
3773+ path = f"/admin/v2/identity_verification/{ user_id } /start"
3774+ return self .json_api_call (
3775+ "POST" ,
3776+ path ,
3777+ {}
3778+ )
3779+
3780+ def cancel_idv (self , user_id , inquiry_id ):
3781+ """
3782+ Cancel identity verification process
3783+
3784+ Args:
3785+ user_id (str) - The ID of the Duo user (required)
3786+ inquiry_id (str) - The inquiry_id of the request to cancel (required)
3787+ """
3788+ path = f"/admin/v2/identity_verification/{ user_id } /cancel"
3789+ return self .json_api_call (
3790+ "POST" ,
3791+ path ,
3792+ {"inquiry_id" : inquiry_id }
3793+ )
3794+
3795+ def get_idv_status (self , user_id ):
3796+ """
3797+ Get the status of a identity verification process
3798+
3799+ Args:
3800+ user_id (str) - The ID of the Duo user (required)
3801+
3802+ Returns (dict) - Dictionary containing details of the identity verification process status
3803+ """
3804+ path = f"/admin/v2/identity_verification/{ user_id } /status"
3805+ return self .json_api_call ("GET" , path , {})
3806+
37633807
37643808class AccountAdmin (Admin ):
37653809 """AccountAdmin manages a child account using an Accounts API integration."""
@@ -3849,4 +3893,4 @@ def set_telephony_credits(self, credits):
38493893 }
38503894 return self .json_api_call ('POST' ,
38513895 '/admin/v1/billing/telephony_credits' ,
3852- params )
3896+ params )
0 commit comments