Skip to content

Commit 16a7ffd

Browse files
authored
chore(1407): update Python SDK method doc comments with mention of inline identification support (#10)
1 parent 599f492 commit 16a7ffd

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

knockapi/client.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,18 @@ def notify(self, key, actor, recipients, data={}, cancellation_key=None, tenant=
8282
8383
Args:
8484
key (str): The key of the workflow to invoke.
85-
actor (str or dict): An optional reference for who/what performed the action.
86-
recipients (array): An array of recipient identifiers of who/what should be notified.
85+
86+
actor (str | dict[str, Any]): An optional reference for who/what performed the action. This can be A) a user
87+
id, B) an object reference, or C) a dictionary with data to identify a user or object.
88+
89+
recipients (list[str | dict[str, Any]]): A list of recipients that should be notified. This can be a list of
90+
A) user ids, B) object references, C) dictionaries with data to identify a user or object, or D) a
91+
combination thereof.
92+
8793
data (dict): Any data to be passed to the notify call.
88-
tenant (str): An optional identifier for the tenant object that the notifications
89-
belong to.
94+
95+
tenant (str): An optional identifier for the tenant object that the notifications belong to.
96+
9097
cancellation_key (str): A key used to cancel this notify.
9198
9299
Returns:

knockapi/resources/workflows.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ def trigger(self, key, actor, recipients, data={}, cancellation_key=None, tenant
88
99
Args:
1010
key (str): The key of the workflow to invoke.
11-
actor (str or dict): An optional reference for who/what performed the action.
12-
recipients (array): An array of recipient identifiers of who/what should be notified.
11+
12+
actor (str | dict[str, Any]): An optional reference for who/what performed the action. This can be A) a user
13+
id, B) an object reference, or C) a dictionary with data to identify a user or object.
14+
15+
recipients (list[str | dict[str, Any]]): A list of recipients that should be notified. This can be a list of
16+
A) user ids, B) object references, C) dictionaries with data to identify a user or object, or D) a
17+
combination thereof.
18+
1319
data (dict): Any data to be passed to the notify call.
14-
tenant (str): An optional identifier for the tenant object that the notifications
15-
belong to.
20+
21+
tenant (str): An optional identifier for the tenant object that the notifications belong to.
22+
1623
cancellation_key (str): A key used to cancel this notify.
1724
1825
Returns:

0 commit comments

Comments
 (0)