Skip to content

Commit e024df7

Browse files
feat(api): add routing_strategies resource
1 parent 2ffe00c commit e024df7

32 files changed

+1926
-144
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 89
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-28c3d906924905ea7f42fd645574bea0988de857d0d023770695160d8ed7435e.yml
3-
openapi_spec_hash: 59844e5d8943f8df663069f28aff328c
4-
config_hash: d7b97d207a178b94ed49b63d914f2ba6
1+
configured_endpoints: 94
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-52f1d2a99d3f91acc4753b05aeef4cc6e570d8e9a8c0a590a810a8d09d19688e.yml
3+
openapi_spec_hash: 61caa60478d63f17515378910dd53b52
4+
config_hash: 65650c7f96740a3d80de689137a790b2

api.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ from courier.types import (
88
AudienceFilter,
99
AudienceFilterConfig,
1010
AudienceRecipient,
11+
Channel,
1112
ChannelClassification,
13+
ChannelMetadata,
1214
ChannelPreference,
1315
DeviceType,
1416
Discord,
@@ -32,9 +34,13 @@ from courier.types import (
3234
ListFilter,
3335
ListPatternRecipient,
3436
ListRecipient,
37+
MessageChannels,
3538
MessageContext,
39+
MessageProviders,
40+
MessageProvidersType,
3641
MessageRouting,
3742
MessageRoutingChannel,
43+
Metadata,
3844
MsTeams,
3945
MsTeamsBaseProperties,
4046
MsTeamsRecipient,
@@ -61,6 +67,7 @@ from courier.types import (
6167
SlackBaseProperties,
6268
SlackRecipient,
6369
TextStyle,
70+
Timeouts,
6471
Token,
6572
UserProfile,
6673
UserProfileFirebaseToken,
@@ -353,6 +360,29 @@ Methods:
353360
- <code title="get /notifications/{id}/{submissionId}/checks">client.notifications.checks.<a href="./src/courier/resources/notifications/checks.py">list</a>(submission_id, \*, id) -> <a href="./src/courier/types/notifications/check_list_response.py">CheckListResponse</a></code>
354361
- <code title="delete /notifications/{id}/{submissionId}/checks">client.notifications.checks.<a href="./src/courier/resources/notifications/checks.py">delete</a>(submission_id, \*, id) -> None</code>
355362

363+
# RoutingStrategies
364+
365+
Types:
366+
367+
```python
368+
from courier.types import (
369+
RoutingStrategyCreateRequest,
370+
RoutingStrategyGetResponse,
371+
RoutingStrategyListResponse,
372+
RoutingStrategyMutationResponse,
373+
RoutingStrategyReplaceRequest,
374+
RoutingStrategySummary,
375+
)
376+
```
377+
378+
Methods:
379+
380+
- <code title="post /routing-strategies">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">create</a>(\*\*<a href="src/courier/types/routing_strategy_create_params.py">params</a>) -> <a href="./src/courier/types/routing_strategy_mutation_response.py">RoutingStrategyMutationResponse</a></code>
381+
- <code title="get /routing-strategies/{id}">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">retrieve</a>(id) -> <a href="./src/courier/types/routing_strategy_get_response.py">RoutingStrategyGetResponse</a></code>
382+
- <code title="get /routing-strategies">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">list</a>(\*\*<a href="src/courier/types/routing_strategy_list_params.py">params</a>) -> <a href="./src/courier/types/routing_strategy_list_response.py">RoutingStrategyListResponse</a></code>
383+
- <code title="delete /routing-strategies/{id}">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">archive</a>(id) -> None</code>
384+
- <code title="put /routing-strategies/{id}">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">replace</a>(id, \*\*<a href="src/courier/types/routing_strategy_replace_params.py">params</a>) -> <a href="./src/courier/types/routing_strategy_mutation_response.py">RoutingStrategyMutationResponse</a></code>
385+
356386
# Profiles
357387

358388
Types:

src/courier/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
audit_events,
5050
translations,
5151
notifications,
52+
routing_strategies,
5253
)
5354
from .resources.auth import AuthResource, AsyncAuthResource
5455
from .resources.bulk import BulkResource, AsyncBulkResource
@@ -65,6 +66,7 @@
6566
from .resources.translations import TranslationsResource, AsyncTranslationsResource
6667
from .resources.tenants.tenants import TenantsResource, AsyncTenantsResource
6768
from .resources.profiles.profiles import ProfilesResource, AsyncProfilesResource
69+
from .resources.routing_strategies import RoutingStrategiesResource, AsyncRoutingStrategiesResource
6870
from .resources.automations.automations import AutomationsResource, AsyncAutomationsResource
6971
from .resources.notifications.notifications import NotificationsResource, AsyncNotificationsResource
7072

@@ -204,6 +206,12 @@ def notifications(self) -> NotificationsResource:
204206

205207
return NotificationsResource(self)
206208

209+
@cached_property
210+
def routing_strategies(self) -> RoutingStrategiesResource:
211+
from .resources.routing_strategies import RoutingStrategiesResource
212+
213+
return RoutingStrategiesResource(self)
214+
207215
@cached_property
208216
def profiles(self) -> ProfilesResource:
209217
from .resources.profiles import ProfilesResource
@@ -474,6 +482,12 @@ def notifications(self) -> AsyncNotificationsResource:
474482

475483
return AsyncNotificationsResource(self)
476484

485+
@cached_property
486+
def routing_strategies(self) -> AsyncRoutingStrategiesResource:
487+
from .resources.routing_strategies import AsyncRoutingStrategiesResource
488+
489+
return AsyncRoutingStrategiesResource(self)
490+
477491
@cached_property
478492
def profiles(self) -> AsyncProfilesResource:
479493
from .resources.profiles import AsyncProfilesResource
@@ -695,6 +709,12 @@ def notifications(self) -> notifications.NotificationsResourceWithRawResponse:
695709

696710
return NotificationsResourceWithRawResponse(self._client.notifications)
697711

712+
@cached_property
713+
def routing_strategies(self) -> routing_strategies.RoutingStrategiesResourceWithRawResponse:
714+
from .resources.routing_strategies import RoutingStrategiesResourceWithRawResponse
715+
716+
return RoutingStrategiesResourceWithRawResponse(self._client.routing_strategies)
717+
698718
@cached_property
699719
def profiles(self) -> profiles.ProfilesResourceWithRawResponse:
700720
from .resources.profiles import ProfilesResourceWithRawResponse
@@ -804,6 +824,12 @@ def notifications(self) -> notifications.AsyncNotificationsResourceWithRawRespon
804824

805825
return AsyncNotificationsResourceWithRawResponse(self._client.notifications)
806826

827+
@cached_property
828+
def routing_strategies(self) -> routing_strategies.AsyncRoutingStrategiesResourceWithRawResponse:
829+
from .resources.routing_strategies import AsyncRoutingStrategiesResourceWithRawResponse
830+
831+
return AsyncRoutingStrategiesResourceWithRawResponse(self._client.routing_strategies)
832+
807833
@cached_property
808834
def profiles(self) -> profiles.AsyncProfilesResourceWithRawResponse:
809835
from .resources.profiles import AsyncProfilesResourceWithRawResponse
@@ -913,6 +939,12 @@ def notifications(self) -> notifications.NotificationsResourceWithStreamingRespo
913939

914940
return NotificationsResourceWithStreamingResponse(self._client.notifications)
915941

942+
@cached_property
943+
def routing_strategies(self) -> routing_strategies.RoutingStrategiesResourceWithStreamingResponse:
944+
from .resources.routing_strategies import RoutingStrategiesResourceWithStreamingResponse
945+
946+
return RoutingStrategiesResourceWithStreamingResponse(self._client.routing_strategies)
947+
916948
@cached_property
917949
def profiles(self) -> profiles.ProfilesResourceWithStreamingResponse:
918950
from .resources.profiles import ProfilesResourceWithStreamingResponse
@@ -1022,6 +1054,12 @@ def notifications(self) -> notifications.AsyncNotificationsResourceWithStreaming
10221054

10231055
return AsyncNotificationsResourceWithStreamingResponse(self._client.notifications)
10241056

1057+
@cached_property
1058+
def routing_strategies(self) -> routing_strategies.AsyncRoutingStrategiesResourceWithStreamingResponse:
1059+
from .resources.routing_strategies import AsyncRoutingStrategiesResourceWithStreamingResponse
1060+
1061+
return AsyncRoutingStrategiesResourceWithStreamingResponse(self._client.routing_strategies)
1062+
10251063
@cached_property
10261064
def profiles(self) -> profiles.AsyncProfilesResourceWithStreamingResponse:
10271065
from .resources.profiles import AsyncProfilesResourceWithStreamingResponse

src/courier/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@
136136
NotificationsResourceWithStreamingResponse,
137137
AsyncNotificationsResourceWithStreamingResponse,
138138
)
139+
from .routing_strategies import (
140+
RoutingStrategiesResource,
141+
AsyncRoutingStrategiesResource,
142+
RoutingStrategiesResourceWithRawResponse,
143+
AsyncRoutingStrategiesResourceWithRawResponse,
144+
RoutingStrategiesResourceWithStreamingResponse,
145+
AsyncRoutingStrategiesResourceWithStreamingResponse,
146+
)
139147

140148
__all__ = [
141149
"SendResource",
@@ -216,6 +224,12 @@
216224
"AsyncNotificationsResourceWithRawResponse",
217225
"NotificationsResourceWithStreamingResponse",
218226
"AsyncNotificationsResourceWithStreamingResponse",
227+
"RoutingStrategiesResource",
228+
"AsyncRoutingStrategiesResource",
229+
"RoutingStrategiesResourceWithRawResponse",
230+
"AsyncRoutingStrategiesResourceWithRawResponse",
231+
"RoutingStrategiesResourceWithStreamingResponse",
232+
"AsyncRoutingStrategiesResourceWithStreamingResponse",
219233
"ProfilesResource",
220234
"AsyncProfilesResource",
221235
"ProfilesResourceWithRawResponse",

0 commit comments

Comments
 (0)