Skip to content

Commit c2a6ebb

Browse files
feat(api): api update
1 parent 122f574 commit c2a6ebb

File tree

6 files changed

+92
-38
lines changed

6 files changed

+92
-38
lines changed

.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-e4ea1ded040ebfa923df0d24ef37ae3c742383828cda85e1489bc2cb5e14da29.yml
3-
openapi_spec_hash: 4cfd1f5f0d42e1b821f70ba12089b606
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-2d3aac5f3ddf05db97231694fc7fab3f0f2abac4691944dd52bf5a250a4edaa5.yml
3+
openapi_spec_hash: 6418b750ca4a74b7248e3913fefb0bed
44
config_hash: 5c872aa99cad9b9602e84668f5b38a8a

src/knockapi/types/message.py

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,40 @@ class Source(BaseModel):
2525
"""The ID of the version of the workflow that triggered the message."""
2626

2727
step_ref: Optional[str] = None
28-
"""The step reference for the step in the workflow that generated the message"""
28+
"""The step reference for the step in the workflow that generated the message."""
2929

3030

3131
class Message(BaseModel):
32-
id: Optional[str] = None
32+
id: str
3333
"""The unique identifier for the message."""
3434

35-
api_typename: Optional[str] = FieldInfo(alias="__typename", default=None)
35+
api_typename: str = FieldInfo(alias="__typename")
3636
"""The typename of the schema."""
3737

38+
channel_id: str
39+
"""The ID for the channel the message was sent through."""
40+
41+
engagement_statuses: List[Literal["seen", "read", "interacted", "link_clicked", "archived"]]
42+
"""A list of engagement statuses."""
43+
44+
inserted_at: datetime
45+
"""Timestamp when the resource was created."""
46+
47+
recipient: RecipientReference
48+
"""
49+
A reference to a recipient, either a user identifier (string) or an object
50+
reference (ID, collection).
51+
"""
52+
53+
source: Source
54+
"""The workflow that triggered the message."""
55+
56+
status: Literal["queued", "sent", "delivered", "delivery_attempted", "undelivered", "not_sent", "bounced"]
57+
"""The message delivery status."""
58+
59+
updated_at: datetime
60+
"""The timestamp when the resource was last updated."""
61+
3862
actors: Optional[List[RecipientReference]] = None
3963
"""One or more actors that are associated with this message.
4064
@@ -45,9 +69,6 @@ class Message(BaseModel):
4569
archived_at: Optional[datetime] = None
4670
"""Timestamp when the message was archived."""
4771

48-
channel_id: Optional[str] = None
49-
"""The ID for the channel the message was sent through."""
50-
5172
clicked_at: Optional[datetime] = None
5273
"""Timestamp when the message was clicked."""
5374

@@ -61,12 +82,6 @@ class Message(BaseModel):
6182
`data` from the most-recent trigger request (the final `activity` in the batch).
6283
"""
6384

64-
engagement_statuses: Optional[List[Literal["seen", "read", "interacted", "link_clicked", "archived"]]] = None
65-
"""A list of engagement statuses."""
66-
67-
inserted_at: Optional[datetime] = None
68-
"""Timestamp when the resource was created."""
69-
7085
interacted_at: Optional[datetime] = None
7186
"""Timestamp when the message was interacted with."""
7287

@@ -79,34 +94,17 @@ class Message(BaseModel):
7994
read_at: Optional[datetime] = None
8095
"""Timestamp when the message was read."""
8196

82-
recipient: Optional[RecipientReference] = None
83-
"""
84-
A reference to a recipient, either a user identifier (string) or an object
85-
reference (ID, collection).
86-
"""
87-
8897
scheduled_at: Optional[datetime] = None
8998
"""Timestamp when the message was scheduled to be sent."""
9099

91100
seen_at: Optional[datetime] = None
92101
"""Timestamp when the message was seen."""
93102

94-
source: Optional[Source] = None
95-
"""The workflow that triggered the message."""
96-
97-
status: Optional[
98-
Literal["queued", "sent", "delivered", "delivery_attempted", "undelivered", "not_sent", "bounced"]
99-
] = None
100-
"""The message delivery status."""
101-
102103
tenant: Optional[str] = None
103104
"""The ID of the `tenant` associated with the message.
104105
105106
Only present when a `tenant` is provided on a workflow trigger request.
106107
"""
107108

108-
updated_at: Optional[datetime] = None
109-
"""The timestamp when the resource was last updated."""
110-
111109
workflow: Optional[str] = None
112110
"""The key of the workflow that generated the message."""

src/knockapi/types/object_set_channel_data_params.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,34 @@
55
from typing import Union
66
from typing_extensions import Required, TypeAlias, TypedDict
77

8+
from .._types import SequenceNotStr
89
from .recipients.push_channel_data_param import PushChannelDataParam
910
from .recipients.slack_channel_data_param import SlackChannelDataParam
1011
from .recipients.discord_channel_data_param import DiscordChannelDataParam
1112
from .recipients.ms_teams_channel_data_param import MsTeamsChannelDataParam
1213
from .recipients.one_signal_channel_data_param import OneSignalChannelDataParam
1314

14-
__all__ = ["ObjectSetChannelDataParams", "Data"]
15+
__all__ = ["ObjectSetChannelDataParams", "Data", "DataAwsSnsPushChannelData"]
1516

1617

1718
class ObjectSetChannelDataParams(TypedDict, total=False):
1819
data: Required[Data]
1920
"""Channel data for a given channel type."""
2021

2122

23+
class DataAwsSnsPushChannelData(TypedDict, total=False):
24+
target_arns: Required[SequenceNotStr[str]]
25+
"""A list of platform endpoint ARNs.
26+
27+
See
28+
[Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
29+
"""
30+
31+
2232
Data: TypeAlias = Union[
2333
PushChannelDataParam,
2434
OneSignalChannelDataParam,
35+
DataAwsSnsPushChannelData,
2536
SlackChannelDataParam,
2637
MsTeamsChannelDataParam,
2738
DiscordChannelDataParam,

src/knockapi/types/recipients/channel_data.py

Lines changed: 21 additions & 3 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 Union, Optional
3+
from typing import List, Union, Optional
44
from typing_extensions import Literal, TypeAlias
55

66
from pydantic import Field as FieldInfo
@@ -12,9 +12,26 @@
1212
from .ms_teams_channel_data import MsTeamsChannelData
1313
from .one_signal_channel_data import OneSignalChannelData
1414

15-
__all__ = ["ChannelData", "Data"]
15+
__all__ = ["ChannelData", "Data", "DataAwsSnsPushChannelData"]
1616

17-
Data: TypeAlias = Union[PushChannelData, SlackChannelData, MsTeamsChannelData, DiscordChannelData, OneSignalChannelData]
17+
18+
class DataAwsSnsPushChannelData(BaseModel):
19+
target_arns: List[str]
20+
"""A list of platform endpoint ARNs.
21+
22+
See
23+
[Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
24+
"""
25+
26+
27+
Data: TypeAlias = Union[
28+
PushChannelData,
29+
SlackChannelData,
30+
MsTeamsChannelData,
31+
DiscordChannelData,
32+
OneSignalChannelData,
33+
DataAwsSnsPushChannelData,
34+
]
1835

1936

2037
class ChannelData(BaseModel):
@@ -31,6 +48,7 @@ class ChannelData(BaseModel):
3148
Literal[
3249
"push_fcm",
3350
"push_apns",
51+
"push_aws_sns",
3452
"push_expo",
3553
"push_one_signal",
3654
"chat_slack",

src/knockapi/types/recipients/inline_channel_data_request_param.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,35 @@
33
from __future__ import annotations
44

55
from typing import Dict, Union
6-
from typing_extensions import TypeAlias
6+
from typing_extensions import Required, TypeAlias, TypedDict
77

8+
from ..._types import SequenceNotStr
89
from .push_channel_data_param import PushChannelDataParam
910
from .slack_channel_data_param import SlackChannelDataParam
1011
from .discord_channel_data_param import DiscordChannelDataParam
1112
from .ms_teams_channel_data_param import MsTeamsChannelDataParam
1213
from .one_signal_channel_data_param import OneSignalChannelDataParam
1314

14-
__all__ = ["InlineChannelDataRequestParam", "InlineChannelDataRequestParamItem"]
15+
__all__ = [
16+
"InlineChannelDataRequestParam",
17+
"InlineChannelDataRequestParamItem",
18+
"InlineChannelDataRequestParamItemAwsSnsPushChannelData",
19+
]
20+
21+
22+
class InlineChannelDataRequestParamItemAwsSnsPushChannelData(TypedDict, total=False):
23+
target_arns: Required[SequenceNotStr[str]]
24+
"""A list of platform endpoint ARNs.
25+
26+
See
27+
[Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
28+
"""
29+
1530

1631
InlineChannelDataRequestParamItem: TypeAlias = Union[
1732
PushChannelDataParam,
1833
OneSignalChannelDataParam,
34+
InlineChannelDataRequestParamItemAwsSnsPushChannelData,
1935
SlackChannelDataParam,
2036
MsTeamsChannelDataParam,
2137
DiscordChannelDataParam,

src/knockapi/types/user_set_channel_data_params.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,34 @@
55
from typing import Union
66
from typing_extensions import Required, TypeAlias, TypedDict
77

8+
from .._types import SequenceNotStr
89
from .recipients.push_channel_data_param import PushChannelDataParam
910
from .recipients.slack_channel_data_param import SlackChannelDataParam
1011
from .recipients.discord_channel_data_param import DiscordChannelDataParam
1112
from .recipients.ms_teams_channel_data_param import MsTeamsChannelDataParam
1213
from .recipients.one_signal_channel_data_param import OneSignalChannelDataParam
1314

14-
__all__ = ["UserSetChannelDataParams", "Data"]
15+
__all__ = ["UserSetChannelDataParams", "Data", "DataAwsSnsPushChannelData"]
1516

1617

1718
class UserSetChannelDataParams(TypedDict, total=False):
1819
data: Required[Data]
1920
"""Channel data for a given channel type."""
2021

2122

23+
class DataAwsSnsPushChannelData(TypedDict, total=False):
24+
target_arns: Required[SequenceNotStr[str]]
25+
"""A list of platform endpoint ARNs.
26+
27+
See
28+
[Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
29+
"""
30+
31+
2232
Data: TypeAlias = Union[
2333
PushChannelDataParam,
2434
OneSignalChannelDataParam,
35+
DataAwsSnsPushChannelData,
2536
SlackChannelDataParam,
2637
MsTeamsChannelDataParam,
2738
DiscordChannelDataParam,

0 commit comments

Comments
 (0)