Skip to content
This repository was archived by the owner on Jul 2, 2025. It is now read-only.

Commit a20fbf8

Browse files
authored
Update generated code (#38)
1 parent b7cd7fb commit a20fbf8

File tree

4 files changed

+36
-32
lines changed

4 files changed

+36
-32
lines changed

src/userhub_sdk/_internal/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
API_BASE_URL = "https://api.userhub.com"
77
API_VERSION = "2025-05-01"
8-
USER_AGENT = "UserHub-Python/0.8.1"
9-
VERSION = "0.8.1"
8+
USER_AGENT = "UserHub-Python/0.8.2"
9+
VERSION = "0.8.2"
1010

1111
AUTH_HEADER = "Authorization"
1212
API_KEY_HEADER = "UserHub-Api-Key"

src/userhub_sdk/adminapi/_users.py

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -590,52 +590,54 @@ def import_account(
590590

591591
return res.decode_body(adminv1.User.__json_decode__)
592592

593-
def report_action(
593+
def report_event(
594594
self,
595595
user_id: str,
596596
*,
597-
action: str,
597+
type: Optional[str] = None,
598598
wait: Optional[bool] = None,
599-
) -> adminv1.ReportUserActionResponse:
599+
) -> adminv1.ReportUserEventResponse:
600600
"""
601-
Report a user action.
601+
Report a user event.
602602
603603
If the `<externalId>@<connectionId>` user identifier syntax is
604604
used and the user doesn't exist, they will be imported.
605605
606-
By default, the action is processed asynchronously.
606+
By default, the event is processed asynchronously.
607607
608608
:param user_id:
609609
The identifier of the user.
610610
611611
This can be in the format `<externalId>@<connectionId>` where
612612
`externalId` is the identity provider user identifier and
613613
and `connectionId` is the User provider connection identifier.
614-
:param action:
615-
The type of action.
614+
:param type:
615+
The event type.
616+
617+
If not specified, this defaults to `CHANGED`.
616618
:param wait:
617619
Process the user action synchronously.
618620
619621
Otherwise the action is processed in the background and errors
620622
won't be returned.
621623
"""
622624
req = Request(
623-
"admin.users.reportAction",
625+
"admin.users.reportEvent",
624626
"POST",
625-
f"/admin/v1/users/{util.quote_path(user_id)}:reportAction",
627+
f"/admin/v1/users/{util.quote_path(user_id)}:event",
626628
)
627629
body: Dict[str, Any] = {}
628630

629-
if action:
630-
body["action"] = action
631+
if type:
632+
body["type"] = type
631633
if wait:
632634
body["wait"] = wait
633635

634636
req.set_body(body)
635637

636638
res = self._transport.execute(req)
637639

638-
return res.decode_body(adminv1.ReportUserActionResponse.__json_decode__)
640+
return res.decode_body(adminv1.ReportUserEventResponse.__json_decode__)
639641

640642
def create_api_session(
641643
self,
@@ -1321,52 +1323,54 @@ async def import_account(
13211323

13221324
return res.decode_body(adminv1.User.__json_decode__)
13231325

1324-
async def report_action(
1326+
async def report_event(
13251327
self,
13261328
user_id: str,
13271329
*,
1328-
action: str,
1330+
type: Optional[str] = None,
13291331
wait: Optional[bool] = None,
1330-
) -> adminv1.ReportUserActionResponse:
1332+
) -> adminv1.ReportUserEventResponse:
13311333
"""
1332-
Report a user action.
1334+
Report a user event.
13331335
13341336
If the `<externalId>@<connectionId>` user identifier syntax is
13351337
used and the user doesn't exist, they will be imported.
13361338
1337-
By default, the action is processed asynchronously.
1339+
By default, the event is processed asynchronously.
13381340
13391341
:param user_id:
13401342
The identifier of the user.
13411343
13421344
This can be in the format `<externalId>@<connectionId>` where
13431345
`externalId` is the identity provider user identifier and
13441346
and `connectionId` is the User provider connection identifier.
1345-
:param action:
1346-
The type of action.
1347+
:param type:
1348+
The event type.
1349+
1350+
If not specified, this defaults to `CHANGED`.
13471351
:param wait:
13481352
Process the user action synchronously.
13491353
13501354
Otherwise the action is processed in the background and errors
13511355
won't be returned.
13521356
"""
13531357
req = Request(
1354-
"admin.users.reportAction",
1358+
"admin.users.reportEvent",
13551359
"POST",
1356-
f"/admin/v1/users/{util.quote_path(user_id)}:reportAction",
1360+
f"/admin/v1/users/{util.quote_path(user_id)}:event",
13571361
)
13581362
body: Dict[str, Any] = {}
13591363

1360-
if action:
1361-
body["action"] = action
1364+
if type:
1365+
body["type"] = type
13621366
if wait:
13631367
body["wait"] = wait
13641368

13651369
req.set_body(body)
13661370

13671371
res = await self._transport.execute(req)
13681372

1369-
return res.decode_body(adminv1.ReportUserActionResponse.__json_decode__)
1373+
return res.decode_body(adminv1.ReportUserEventResponse.__json_decode__)
13701374

13711375
async def create_api_session(
13721376
self,

src/userhub_sdk/adminv1/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
from ._product_connection import ProductConnection
6868
from ._purge_organization_response import PurgeOrganizationResponse
6969
from ._purge_user_response import PurgeUserResponse
70-
from ._report_user_action_response import ReportUserActionResponse
70+
from ._report_user_event_response import ReportUserEventResponse
7171
from ._role import Role
7272
from ._signing_secret import SigningSecret
7373
from ._signup_flow import SignupFlow
@@ -150,7 +150,7 @@
150150
"ProductConnection",
151151
"PurgeOrganizationResponse",
152152
"PurgeUserResponse",
153-
"ReportUserActionResponse",
153+
"ReportUserEventResponse",
154154
"Role",
155155
"SigningSecret",
156156
"SignupFlow",

src/userhub_sdk/adminv1/_report_user_action_response.py renamed to src/userhub_sdk/adminv1/_report_user_event_response.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66

77
@dataclasses.dataclass
8-
class ReportUserActionResponse:
8+
class ReportUserEventResponse:
99
"""
10-
Response message for ReportUserAction.
10+
Response message for ReportUserEvent.
1111
"""
1212

1313
def __json_encode__(self) -> Dict[str, Any]:
@@ -16,10 +16,10 @@ def __json_encode__(self) -> Dict[str, Any]:
1616
return data
1717

1818
@staticmethod
19-
def __json_decode__(data: Dict[str, Any]) -> "ReportUserActionResponse":
19+
def __json_decode__(data: Dict[str, Any]) -> "ReportUserEventResponse":
2020
if data is None:
2121
data = {}
2222

2323
kwargs: Dict[str, Any] = {}
2424

25-
return ReportUserActionResponse(**kwargs)
25+
return ReportUserEventResponse(**kwargs)

0 commit comments

Comments
 (0)