Skip to content

Commit e88471a

Browse files
feat(api): api update
1 parent 6793aeb commit e88471a

11 files changed

Lines changed: 45 additions & 55 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 89
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-5176d1bb3a88b127808b197c9ae1cf366fd56599fd8c7b7241ac829e72d69a42.yml
3-
openapi_spec_hash: 92953a04021af2d0132fd9eebeb844b9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-923618cb1489556307ce0be07853170d15516da8fe450578fed856e560ec361c.yml
3+
openapi_spec_hash: 1406cf9ab287412197a1907f5d66d541
44
config_hash: 2ae8965d371a03bd30c6a56819c04cf2

src/knockapi/resources/schedules/schedules.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ def create(
9494
for the `actor`, `recipient`, and `tenant` fields.
9595
9696
Args:
97-
recipients: The recipients to trigger the workflow for. Can inline identify users, objects,
98-
or use a list of user IDs. Limited to 1,000 recipients.
97+
recipients: The recipients to set the schedule for. Limited to 100 recipients per request.
9998
10099
repeats: The repeat rule for the schedule.
101100
@@ -354,8 +353,7 @@ async def create(
354353
for the `actor`, `recipient`, and `tenant` fields.
355354
356355
Args:
357-
recipients: The recipients to trigger the workflow for. Can inline identify users, objects,
358-
or use a list of user IDs. Limited to 1,000 recipients.
356+
recipients: The recipients to set the schedule for. Limited to 100 recipients per request.
359357
360358
repeats: The repeat rule for the schedule.
361359

src/knockapi/types/inline_identify_user_request_param.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class InlineIdentifyUserRequestParamTyped(TypedDict, total=False):
1717
id: Required[str]
1818
"""The ID for the user that you set when identifying them in Knock."""
1919

20+
avatar: Optional[str]
21+
"""URL to the user's avatar image."""
22+
2023
channel_data: Optional[InlineChannelDataRequestParam]
2124
"""A request to set channel data for a type of channel inline."""
2225

@@ -26,9 +29,21 @@ class InlineIdentifyUserRequestParamTyped(TypedDict, total=False):
2629
email: Optional[str]
2730
"""The primary email address for the user."""
2831

32+
locale: Optional[str]
33+
"""The locale of the user.
34+
35+
Used for [message localization](/concepts/translations).
36+
"""
37+
2938
name: Optional[str]
3039
"""Display name of the user."""
3140

41+
phone_number: Optional[str]
42+
"""
43+
The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the
44+
user (required for SMS channels).
45+
"""
46+
3247
preferences: Optional[InlinePreferenceSetRequestParam]
3348
"""Inline set preferences for a recipient, where the key is the preference set id."""
3449

src/knockapi/types/object.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import TYPE_CHECKING, Optional
3+
from typing import Dict, Optional
44
from datetime import datetime
55

66
from pydantic import Field as FieldInfo
@@ -26,8 +26,5 @@ class Object(BaseModel):
2626
created_at: Optional[datetime] = None
2727
"""Timestamp when the resource was created."""
2828

29-
if TYPE_CHECKING:
30-
# Stub to indicate that arbitrary properties are accepted.
31-
# To access properties that are not valid identifiers you can use `getattr`, e.g.
32-
# `getattr(obj, '$type')`
33-
def __getattr__(self, attr: str) -> object: ...
29+
properties: Optional[Dict[str, object]] = None
30+
"""The custom properties associated with the object."""

src/knockapi/types/recipients/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from .one_signal_channel_data import OneSignalChannelData as OneSignalChannelData
1313
from .push_channel_data_param import PushChannelDataParam as PushChannelDataParam
1414
from .slack_channel_data_param import SlackChannelDataParam as SlackChannelDataParam
15-
from .channel_data_request_param import ChannelDataRequestParam as ChannelDataRequestParam
1615
from .discord_channel_data_param import DiscordChannelDataParam as DiscordChannelDataParam
1716
from .ms_teams_channel_data_param import MsTeamsChannelDataParam as MsTeamsChannelDataParam
1817
from .preference_set_channel_types import PreferenceSetChannelTypes as PreferenceSetChannelTypes

src/knockapi/types/recipients/channel_data_request_param.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/knockapi/types/recipients/inline_channel_data_request_param.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,23 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict
5+
from typing import Dict, Union
66
from typing_extensions import TypeAlias
77

8-
from .channel_data_request_param import ChannelDataRequestParam
8+
from .push_channel_data_param import PushChannelDataParam
9+
from .slack_channel_data_param import SlackChannelDataParam
10+
from .discord_channel_data_param import DiscordChannelDataParam
11+
from .ms_teams_channel_data_param import MsTeamsChannelDataParam
12+
from .one_signal_channel_data_param import OneSignalChannelDataParam
913

10-
__all__ = ["InlineChannelDataRequestParam"]
14+
__all__ = ["InlineChannelDataRequestParam", "InlineChannelDataRequestParamItem"]
1115

12-
InlineChannelDataRequestParam: TypeAlias = Dict[str, ChannelDataRequestParam]
16+
InlineChannelDataRequestParamItem: TypeAlias = Union[
17+
PushChannelDataParam,
18+
OneSignalChannelDataParam,
19+
SlackChannelDataParam,
20+
MsTeamsChannelDataParam,
21+
DiscordChannelDataParam,
22+
]
23+
24+
InlineChannelDataRequestParam: TypeAlias = Dict[str, InlineChannelDataRequestParamItem]

src/knockapi/types/schedule_create_params.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616

1717
class ScheduleCreateParams(TypedDict, total=False):
1818
recipients: Required[List[RecipientRequestParam]]
19-
"""The recipients to trigger the workflow for.
20-
21-
Can inline identify users, objects, or use a list of user IDs. Limited to 1,000
22-
recipients.
23-
"""
19+
"""The recipients to set the schedule for. Limited to 100 recipients per request."""
2420

2521
repeats: Required[Iterable[ScheduleRepeatRuleParam]]
2622
"""The repeat rule for the schedule."""

tests/api_resources/test_objects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ def test_method_set_with_all_params(self, client: Knock) -> None:
829829
object_ = client.objects.set(
830830
collection="collection",
831831
id="id",
832-
channel_data={"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"data": {"tokens": ["push_token_123"]}}},
832+
channel_data={"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"tokens": ["push_token_123"]}},
833833
locale="en-US",
834834
preferences={
835835
"default": {
@@ -2032,7 +2032,7 @@ async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> Non
20322032
object_ = await async_client.objects.set(
20332033
collection="collection",
20342034
id="id",
2035-
channel_data={"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"data": {"tokens": ["push_token_123"]}}},
2035+
channel_data={"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"tokens": ["push_token_123"]}},
20362036
locale="en-US",
20372037
preferences={
20382038
"default": {

tests/api_resources/test_tenants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def test_method_set(self, client: Knock) -> None:
183183
def test_method_set_with_all_params(self, client: Knock) -> None:
184184
tenant = client.tenants.set(
185185
id="id",
186-
channel_data={"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"data": {"tokens": ["push_token_xxx"]}}},
186+
channel_data={"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"tokens": ["push_token_xxx"]}},
187187
preferences={
188188
"default": {
189189
"categories": {
@@ -504,7 +504,7 @@ async def test_method_set(self, async_client: AsyncKnock) -> None:
504504
async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> None:
505505
tenant = await async_client.tenants.set(
506506
id="id",
507-
channel_data={"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"data": {"tokens": ["push_token_xxx"]}}},
507+
channel_data={"97c5837d-c65c-4d54-aa39-080eeb81c69d": {"tokens": ["push_token_xxx"]}},
508508
preferences={
509509
"default": {
510510
"categories": {

0 commit comments

Comments
 (0)