Skip to content

Commit 5401702

Browse files
feat(api): add slack/teams/pagerduty/webhook/audience recipient types to send
1 parent 14a2c9a commit 5401702

87 files changed

Lines changed: 1423 additions & 189 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.stats.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 77
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-9859cb664d1a9de0323c857e96cf41d0a5ac5c5903c501059f36bf62553b1583.yml
3-
openapi_spec_hash: d29149d60504eba35c63f583ce4bf0bc
4-
config_hash: 3ec521d062b05b81c22bc1a25bfe3d02
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-fab4ee8a24b719456f38d4a6050f4e40158db57937a1d55035be9325df494941.yml
3+
openapi_spec_hash: be1371c71559511c79a4285238b7131c
4+
config_hash: 54d2059f36ceee17804ef6c2800affd2

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ response = client.send.message(
137137
message={
138138
"data": {"foo": "bar"},
139139
"template": "template_id",
140-
"to": {"user_id": "example_user"},
140+
"to": {"user_id": "user_id"},
141141
},
142142
)
143143
print(response.message)

‎api.md‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
```python
44
from courier.types import (
5+
AirshipProfile,
6+
AirshipProfileAudience,
57
Alignment,
8+
AudienceFilter,
9+
AudienceRecipient,
610
ChannelClassification,
711
ChannelPreference,
12+
DeviceType,
13+
Discord,
814
ElementalActionNodeWithType,
915
ElementalBaseNode,
1016
ElementalChannelNode,
@@ -17,19 +23,52 @@ from courier.types import (
1723
ElementalNode,
1824
ElementalQuoteNodeWithType,
1925
ElementalTextNodeWithType,
26+
Expo,
27+
Intercom,
28+
IntercomRecipient,
29+
ListFilter,
30+
ListPatternRecipient,
31+
ListRecipient,
2032
MessageContext,
2133
MessageRouting,
2234
MessageRoutingChannel,
35+
MsTeams,
36+
MsTeamsBaseProperties,
37+
MsTeamsRecipient,
38+
MultipleTokens,
2339
NotificationPreferenceDetails,
40+
Pagerduty,
41+
PagerdutyRecipient,
2442
Paging,
2543
Preference,
2644
PreferenceStatus,
27-
Recipient,
2845
RecipientPreferences,
2946
Rule,
47+
SendDirectMessage,
48+
SendToChannel,
49+
SendToMsTeamsChannelID,
50+
SendToMsTeamsChannelName,
51+
SendToMsTeamsConversationID,
52+
SendToMsTeamsEmail,
53+
SendToMsTeamsUserID,
54+
SendToSlackChannel,
55+
SendToSlackEmail,
56+
SendToSlackUserID,
57+
Slack,
58+
SlackBaseProperties,
59+
SlackRecipient,
3060
TextStyle,
61+
Token,
62+
UserProfile,
63+
UserProfileFirebaseToken,
3164
UserRecipient,
3265
Utm,
66+
WebhookAuthMode,
67+
WebhookAuthentication,
68+
WebhookMethod,
69+
WebhookProfile,
70+
WebhookProfileType,
71+
WebhookRecipient,
3372
)
3473
```
3574

@@ -54,6 +93,8 @@ from courier.types import (
5493
Audience,
5594
Filter,
5695
FilterConfig,
96+
NestedFilterConfig,
97+
SingleFilterConfig,
5798
AudienceUpdateResponse,
5899
AudienceListResponse,
59100
AudienceListMembersResponse,

‎src/courier/types/__init__.py‎

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
from __future__ import annotations
44

5-
from . import shared, tenants, notification_list_response
5+
from . import (
6+
shared,
7+
tenants,
8+
audience,
9+
nested_filter_config,
10+
audience_list_response,
11+
audience_update_response,
12+
notification_list_response,
13+
)
614
from .. import _compat
715
from .logo import Logo as Logo
816
from .brand import Brand as Brand
@@ -11,30 +19,69 @@
1119
from .filter import Filter as Filter
1220
from .shared import (
1321
Utm as Utm,
22+
Expo as Expo,
1423
Rule as Rule,
24+
Slack as Slack,
25+
Token as Token,
1526
Paging as Paging,
27+
Discord as Discord,
28+
MsTeams as MsTeams,
29+
Intercom as Intercom,
1630
Alignment as Alignment,
17-
Recipient as Recipient,
31+
Pagerduty as Pagerduty,
1832
TextStyle as TextStyle,
33+
DeviceType as DeviceType,
34+
ListFilter as ListFilter,
1935
Preference as Preference,
36+
UserProfile as UserProfile,
2037
ElementalNode as ElementalNode,
38+
ListRecipient as ListRecipient,
39+
SendToChannel as SendToChannel,
2140
UserRecipient as UserRecipient,
41+
WebhookMethod as WebhookMethod,
42+
AirshipProfile as AirshipProfile,
43+
AudienceFilter as AudienceFilter,
2244
MessageContext as MessageContext,
2345
MessageRouting as MessageRouting,
46+
MultipleTokens as MultipleTokens,
47+
SlackRecipient as SlackRecipient,
48+
WebhookProfile as WebhookProfile,
49+
WebhookAuthMode as WebhookAuthMode,
2450
ElementalContent as ElementalContent,
51+
MsTeamsRecipient as MsTeamsRecipient,
2552
PreferenceStatus as PreferenceStatus,
53+
SendToSlackEmail as SendToSlackEmail,
54+
WebhookRecipient as WebhookRecipient,
55+
AudienceRecipient as AudienceRecipient,
2656
ChannelPreference as ChannelPreference,
2757
ElementalBaseNode as ElementalBaseNode,
58+
IntercomRecipient as IntercomRecipient,
59+
SendDirectMessage as SendDirectMessage,
60+
SendToSlackUserID as SendToSlackUserID,
61+
PagerdutyRecipient as PagerdutyRecipient,
62+
SendToMsTeamsEmail as SendToMsTeamsEmail,
63+
SendToSlackChannel as SendToSlackChannel,
64+
WebhookProfileType as WebhookProfileType,
65+
SendToMsTeamsUserID as SendToMsTeamsUserID,
66+
SlackBaseProperties as SlackBaseProperties,
2867
ElementalChannelNode as ElementalChannelNode,
68+
ListPatternRecipient as ListPatternRecipient,
2969
RecipientPreferences as RecipientPreferences,
3070
ChannelClassification as ChannelClassification,
3171
ElementalContentSugar as ElementalContentSugar,
3272
MessageRoutingChannel as MessageRoutingChannel,
73+
MsTeamsBaseProperties as MsTeamsBaseProperties,
74+
WebhookAuthentication as WebhookAuthentication,
75+
AirshipProfileAudience as AirshipProfileAudience,
76+
SendToMsTeamsChannelID as SendToMsTeamsChannelID,
77+
SendToMsTeamsChannelName as SendToMsTeamsChannelName,
78+
UserProfileFirebaseToken as UserProfileFirebaseToken,
3379
ElementalMetaNodeWithType as ElementalMetaNodeWithType,
3480
ElementalTextNodeWithType as ElementalTextNodeWithType,
3581
ElementalImageNodeWithType as ElementalImageNodeWithType,
3682
ElementalQuoteNodeWithType as ElementalQuoteNodeWithType,
3783
ElementalActionNodeWithType as ElementalActionNodeWithType,
84+
SendToMsTeamsConversationID as SendToMsTeamsConversationID,
3885
ElementalChannelNodeWithType as ElementalChannelNodeWithType,
3986
ElementalDividerNodeWithType as ElementalDividerNodeWithType,
4087
NotificationPreferenceDetails as NotificationPreferenceDetails,
@@ -51,6 +98,7 @@
5198
from .email_header import EmailHeader as EmailHeader
5299
from .filter_param import FilterParam as FilterParam
53100
from .brand_snippet import BrandSnippet as BrandSnippet
101+
from .filter_config import FilterConfig as FilterConfig
54102
from .brand_settings import BrandSettings as BrandSettings
55103
from .brand_snippets import BrandSnippets as BrandSnippets
56104
from .brand_template import BrandTemplate as BrandTemplate
@@ -73,6 +121,7 @@
73121
from .brand_snippet_param import BrandSnippetParam as BrandSnippetParam
74122
from .brand_update_params import BrandUpdateParams as BrandUpdateParams
75123
from .default_preferences import DefaultPreferences as DefaultPreferences
124+
from .filter_config_param import FilterConfigParam as FilterConfigParam
76125
from .message_list_params import MessageListParams as MessageListParams
77126
from .send_message_params import SendMessageParams as SendMessageParams
78127
from .audience_list_params import AudienceListParams as AudienceListParams
@@ -81,6 +130,8 @@
81130
from .brand_snippets_param import BrandSnippetsParam as BrandSnippetsParam
82131
from .brand_template_param import BrandTemplateParam as BrandTemplateParam
83132
from .inbound_bulk_message import InboundBulkMessage as InboundBulkMessage
133+
from .nested_filter_config import NestedFilterConfig as NestedFilterConfig
134+
from .single_filter_config import SingleFilterConfig as SingleFilterConfig
84135
from .tenant_list_response import TenantListResponse as TenantListResponse
85136
from .tenant_update_params import TenantUpdateParams as TenantUpdateParams
86137
from .brand_settings_in_app import BrandSettingsInApp as BrandSettingsInApp
@@ -122,7 +173,9 @@
122173
from .bulk_retrieve_job_response import BulkRetrieveJobResponse as BulkRetrieveJobResponse
123174
from .inbound_bulk_message_param import InboundBulkMessageParam as InboundBulkMessageParam
124175
from .inbound_track_event_params import InboundTrackEventParams as InboundTrackEventParams
176+
from .nested_filter_config_param import NestedFilterConfigParam as NestedFilterConfigParam
125177
from .notification_list_response import NotificationListResponse as NotificationListResponse
178+
from .single_filter_config_param import SingleFilterConfigParam as SingleFilterConfigParam
126179
from .tenant_list_users_response import TenantListUsersResponse as TenantListUsersResponse
127180
from .brand_settings_in_app_param import BrandSettingsInAppParam as BrandSettingsInAppParam
128181
from .audience_list_members_params import AudienceListMembersParams as AudienceListMembersParams
@@ -140,10 +193,18 @@
140193
# Pydantic can resolve the necessary references.
141194
# See: https://github.com/pydantic/pydantic/issues/11250 for more context.
142195
if _compat.PYDANTIC_V1:
196+
audience.Audience.update_forward_refs() # type: ignore
197+
nested_filter_config.NestedFilterConfig.update_forward_refs() # type: ignore
198+
audience_update_response.AudienceUpdateResponse.update_forward_refs() # type: ignore
199+
audience_list_response.AudienceListResponse.update_forward_refs() # type: ignore
143200
notification_list_response.NotificationListResponse.update_forward_refs() # type: ignore
144201
tenants.template_list_response.TemplateListResponse.update_forward_refs() # type: ignore
145202
shared.message_routing.MessageRouting.update_forward_refs() # type: ignore
146203
else:
204+
audience.Audience.model_rebuild(_parent_namespace_depth=0)
205+
nested_filter_config.NestedFilterConfig.model_rebuild(_parent_namespace_depth=0)
206+
audience_update_response.AudienceUpdateResponse.model_rebuild(_parent_namespace_depth=0)
207+
audience_list_response.AudienceListResponse.model_rebuild(_parent_namespace_depth=0)
147208
notification_list_response.NotificationListResponse.model_rebuild(_parent_namespace_depth=0)
148209
tenants.template_list_response.TemplateListResponse.model_rebuild(_parent_namespace_depth=0)
149210
shared.message_routing.MessageRouting.model_rebuild(_parent_namespace_depth=0)

‎src/courier/types/audience.py‎

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

3-
from .filter import Filter
3+
from __future__ import annotations
4+
45
from .._models import BaseModel
56

67
__all__ = ["Audience"]
@@ -15,10 +16,13 @@ class Audience(BaseModel):
1516
description: str
1617
"""A description of the audience"""
1718

18-
filter: Filter
19+
filter: "Filter"
1920
"""A single filter to use for filtering"""
2021

2122
name: str
2223
"""The name of the audience"""
2324

2425
updated_at: str
26+
27+
28+
from .filter import Filter
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from __future__ import annotations
4+
35
from typing import List
46

57
from .._models import BaseModel
6-
from .audience import Audience
78
from .shared.paging import Paging
89

910
__all__ = ["AudienceListResponse"]
1011

1112

1213
class AudienceListResponse(BaseModel):
13-
items: List[Audience]
14+
items: List["Audience"]
1415

1516
paging: Paging
17+
18+
19+
from .audience import Audience

‎src/courier/types/audience_update_params.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
from typing import Optional
66
from typing_extensions import TypedDict
77

8-
from .filter_param import FilterParam
9-
108
__all__ = ["AudienceUpdateParams"]
119

1210

1311
class AudienceUpdateParams(TypedDict, total=False):
1412
description: Optional[str]
1513
"""A description of the audience"""
1614

17-
filter: Optional[FilterParam]
15+
filter: Optional["FilterParam"]
1816
"""A single filter to use for filtering"""
1917

2018
name: Optional[str]
2119
"""The name of the audience"""
20+
21+
22+
from .filter_param import FilterParam
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from __future__ import annotations
4+
35
from .._models import BaseModel
4-
from .audience import Audience
56

67
__all__ = ["AudienceUpdateResponse"]
78

89

910
class AudienceUpdateResponse(BaseModel):
10-
audience: Audience
11+
audience: "Audience"
12+
13+
14+
from .audience import Audience

‎src/courier/types/filter.py‎

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

3-
from typing_extensions import Literal
3+
from __future__ import annotations
44

5-
from .._models import BaseModel
6-
7-
__all__ = ["Filter"]
5+
from typing import Union
6+
from typing_extensions import TypeAlias
87

8+
from .single_filter_config import SingleFilterConfig
99

10-
class Filter(BaseModel):
11-
operator: Literal[
12-
"ENDS_WITH",
13-
"EQ",
14-
"EXISTS",
15-
"GT",
16-
"GTE",
17-
"INCLUDES",
18-
"IS_AFTER",
19-
"IS_BEFORE",
20-
"LT",
21-
"LTE",
22-
"NEQ",
23-
"OMIT",
24-
"STARTS_WITH",
25-
"AND",
26-
"OR",
27-
]
28-
"""The operator to use for filtering"""
10+
__all__ = ["Filter"]
2911

30-
path: str
31-
"""
32-
The attribe name from profile whose value will be operated against the filter
33-
value
34-
"""
12+
Filter: TypeAlias = Union[SingleFilterConfig, "NestedFilterConfig"]
3513

36-
value: str
37-
"""The value to use for filtering"""
14+
from .nested_filter_config import NestedFilterConfig

‎src/courier/types/filter_config.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import TYPE_CHECKING, Union
6+
from typing_extensions import TypeAlias, TypeAliasType
7+
8+
from .._compat import PYDANTIC_V1
9+
from .single_filter_config import SingleFilterConfig
10+
11+
__all__ = ["FilterConfig"]
12+
13+
if TYPE_CHECKING or not PYDANTIC_V1:
14+
FilterConfig = TypeAliasType("FilterConfig", Union[SingleFilterConfig, "NestedFilterConfig"])
15+
else:
16+
FilterConfig: TypeAlias = Union[SingleFilterConfig, "NestedFilterConfig"]
17+
18+
from .nested_filter_config import NestedFilterConfig

0 commit comments

Comments
 (0)