@@ -573,7 +573,7 @@ def import_account(
573573
574574 This must be in the format `<externalId>@<connectionId>` where
575575 `externalId` is the identity provider user identifier and
576- and `connectionId` is the User Provider connection identifier.
576+ and `connectionId` is the User provider connection identifier.
577577 """
578578 req = Request (
579579 "admin.users.importAccount" ,
@@ -590,6 +590,53 @@ def import_account(
590590
591591 return res .decode_body (adminv1 .User .__json_decode__ )
592592
593+ def report_action (
594+ self ,
595+ user_id : str ,
596+ * ,
597+ action : str ,
598+ wait : Optional [bool ] = None ,
599+ ) -> adminv1 .ReportUserActionResponse :
600+ """
601+ Report a user action.
602+
603+ If the `<externalId>@<connectionId>` user identifier syntax is
604+ used and the user doesn't exist, they will be imported.
605+
606+ By default, the action is processed asynchronously.
607+
608+ :param user_id:
609+ The identifier of the user.
610+
611+ This can be in the format `<externalId>@<connectionId>` where
612+ `externalId` is the identity provider user identifier and
613+ and `connectionId` is the User provider connection identifier.
614+ :param action:
615+ The type of action.
616+ :param wait:
617+ Process the user action synchronously.
618+
619+ Otherwise the action is processed in the background and errors
620+ won't be returned.
621+ """
622+ req = Request (
623+ "admin.users.reportAction" ,
624+ "POST" ,
625+ f"/admin/v1/users/{ util .quote_path (user_id )} :reportAction" ,
626+ )
627+ body : Dict [str , Any ] = {}
628+
629+ if action :
630+ body ["action" ] = action
631+ if wait :
632+ body ["wait" ] = wait
633+
634+ req .set_body (body )
635+
636+ res = self ._transport .execute (req )
637+
638+ return res .decode_body (adminv1 .ReportUserActionResponse .__json_decode__ )
639+
593640 def create_api_session (
594641 self ,
595642 user_id : str ,
@@ -631,7 +678,7 @@ def create_portal_session(
631678 The user ID.
632679
633680 In addition to supporting the UserHub user ID,
634- you can also pass in the User Provider external identifier in the
681+ you can also pass in the User provider external identifier in the
635682 format `<externalId>@<connectionId>` and if the user doesn't
636683 exist in UserHub they will automatically be imported.
637684 :param portal_url:
@@ -1257,7 +1304,7 @@ async def import_account(
12571304
12581305 This must be in the format `<externalId>@<connectionId>` where
12591306 `externalId` is the identity provider user identifier and
1260- and `connectionId` is the User Provider connection identifier.
1307+ and `connectionId` is the User provider connection identifier.
12611308 """
12621309 req = Request (
12631310 "admin.users.importAccount" ,
@@ -1274,6 +1321,53 @@ async def import_account(
12741321
12751322 return res .decode_body (adminv1 .User .__json_decode__ )
12761323
1324+ async def report_action (
1325+ self ,
1326+ user_id : str ,
1327+ * ,
1328+ action : str ,
1329+ wait : Optional [bool ] = None ,
1330+ ) -> adminv1 .ReportUserActionResponse :
1331+ """
1332+ Report a user action.
1333+
1334+ If the `<externalId>@<connectionId>` user identifier syntax is
1335+ used and the user doesn't exist, they will be imported.
1336+
1337+ By default, the action is processed asynchronously.
1338+
1339+ :param user_id:
1340+ The identifier of the user.
1341+
1342+ This can be in the format `<externalId>@<connectionId>` where
1343+ `externalId` is the identity provider user identifier and
1344+ and `connectionId` is the User provider connection identifier.
1345+ :param action:
1346+ The type of action.
1347+ :param wait:
1348+ Process the user action synchronously.
1349+
1350+ Otherwise the action is processed in the background and errors
1351+ won't be returned.
1352+ """
1353+ req = Request (
1354+ "admin.users.reportAction" ,
1355+ "POST" ,
1356+ f"/admin/v1/users/{ util .quote_path (user_id )} :reportAction" ,
1357+ )
1358+ body : Dict [str , Any ] = {}
1359+
1360+ if action :
1361+ body ["action" ] = action
1362+ if wait :
1363+ body ["wait" ] = wait
1364+
1365+ req .set_body (body )
1366+
1367+ res = await self ._transport .execute (req )
1368+
1369+ return res .decode_body (adminv1 .ReportUserActionResponse .__json_decode__ )
1370+
12771371 async def create_api_session (
12781372 self ,
12791373 user_id : str ,
@@ -1315,7 +1409,7 @@ async def create_portal_session(
13151409 The user ID.
13161410
13171411 In addition to supporting the UserHub user ID,
1318- you can also pass in the User Provider external identifier in the
1412+ you can also pass in the User provider external identifier in the
13191413 format `<externalId>@<connectionId>` and if the user doesn't
13201414 exist in UserHub they will automatically be imported.
13211415 :param portal_url:
0 commit comments