Skip to content

Commit d88d2ae

Browse files
feat(digests): document digest REST endpoints in OpenAPI spec
1 parent ca43aae commit d88d2ae

15 files changed

Lines changed: 830 additions & 4 deletions

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 117
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-545ac9b590445e90e11113a1bdeb893a94389d69d95e0a7e5c6450bb15f5453a.yml
3-
openapi_spec_hash: 9e243ec62800fb4a2e443eb6481afa30
4-
config_hash: 10bd597dd6cc89023541bc551b6532b8
1+
configured_endpoints: 119
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-2ffdd7412416851da17d4cf5b0b82ed842f730866bef1d76653f7ca83d5f622e.yml
3+
openapi_spec_hash: e5296b102c88bb2226842167ba5d8731
4+
config_hash: 822a92efc80e63cdb2d496dbd6176620

api.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,21 @@ Methods:
310310
- <code title="get /bulk/{job_id}">client.bulk.<a href="./src/courier/resources/bulk.py">retrieve_job</a>(job_id) -> <a href="./src/courier/types/bulk_retrieve_job_response.py">BulkRetrieveJobResponse</a></code>
311311
- <code title="post /bulk/{job_id}/run">client.bulk.<a href="./src/courier/resources/bulk.py">run_job</a>(job_id) -> None</code>
312312

313+
# Digests
314+
315+
Types:
316+
317+
```python
318+
from courier.types import DigestCategory, DigestInstance, DigestInstanceListResponse
319+
```
320+
321+
## Schedules
322+
323+
Methods:
324+
325+
- <code title="get /digests/schedules/{schedule_id}/instances">client.digests.schedules.<a href="./src/courier/resources/digests/schedules.py">list_instances</a>(schedule_id, \*\*<a href="src/courier/types/digests/schedule_list_instances_params.py">params</a>) -> <a href="./src/courier/types/digest_instance_list_response.py">DigestInstanceListResponse</a></code>
326+
- <code title="post /digests/schedules/{schedule_id}/trigger">client.digests.schedules.<a href="./src/courier/resources/digests/schedules.py">release</a>(schedule_id) -> None</code>
327+
313328
# Inbound
314329

315330
Types:

src/courier/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
lists,
4343
users,
4444
brands,
45+
digests,
4546
inbound,
4647
tenants,
4748
journeys,
@@ -68,6 +69,7 @@
6869
from .resources.users.users import UsersResource, AsyncUsersResource
6970
from .resources.audit_events import AuditEventsResource, AsyncAuditEventsResource
7071
from .resources.translations import TranslationsResource, AsyncTranslationsResource
72+
from .resources.digests.digests import DigestsResource, AsyncDigestsResource
7173
from .resources.tenants.tenants import TenantsResource, AsyncTenantsResource
7274
from .resources.journeys.journeys import JourneysResource, AsyncJourneysResource
7375
from .resources.profiles.profiles import ProfilesResource, AsyncProfilesResource
@@ -197,6 +199,12 @@ def bulk(self) -> BulkResource:
197199

198200
return BulkResource(self)
199201

202+
@cached_property
203+
def digests(self) -> DigestsResource:
204+
from .resources.digests import DigestsResource
205+
206+
return DigestsResource(self)
207+
200208
@cached_property
201209
def inbound(self) -> InboundResource:
202210
from .resources.inbound import InboundResource
@@ -488,6 +496,12 @@ def bulk(self) -> AsyncBulkResource:
488496

489497
return AsyncBulkResource(self)
490498

499+
@cached_property
500+
def digests(self) -> AsyncDigestsResource:
501+
from .resources.digests import AsyncDigestsResource
502+
503+
return AsyncDigestsResource(self)
504+
491505
@cached_property
492506
def inbound(self) -> AsyncInboundResource:
493507
from .resources.inbound import AsyncInboundResource
@@ -721,6 +735,12 @@ def bulk(self) -> bulk.BulkResourceWithRawResponse:
721735

722736
return BulkResourceWithRawResponse(self._client.bulk)
723737

738+
@cached_property
739+
def digests(self) -> digests.DigestsResourceWithRawResponse:
740+
from .resources.digests import DigestsResourceWithRawResponse
741+
742+
return DigestsResourceWithRawResponse(self._client.digests)
743+
724744
@cached_property
725745
def inbound(self) -> inbound.InboundResourceWithRawResponse:
726746
from .resources.inbound import InboundResourceWithRawResponse
@@ -842,6 +862,12 @@ def bulk(self) -> bulk.AsyncBulkResourceWithRawResponse:
842862

843863
return AsyncBulkResourceWithRawResponse(self._client.bulk)
844864

865+
@cached_property
866+
def digests(self) -> digests.AsyncDigestsResourceWithRawResponse:
867+
from .resources.digests import AsyncDigestsResourceWithRawResponse
868+
869+
return AsyncDigestsResourceWithRawResponse(self._client.digests)
870+
845871
@cached_property
846872
def inbound(self) -> inbound.AsyncInboundResourceWithRawResponse:
847873
from .resources.inbound import AsyncInboundResourceWithRawResponse
@@ -963,6 +989,12 @@ def bulk(self) -> bulk.BulkResourceWithStreamingResponse:
963989

964990
return BulkResourceWithStreamingResponse(self._client.bulk)
965991

992+
@cached_property
993+
def digests(self) -> digests.DigestsResourceWithStreamingResponse:
994+
from .resources.digests import DigestsResourceWithStreamingResponse
995+
996+
return DigestsResourceWithStreamingResponse(self._client.digests)
997+
966998
@cached_property
967999
def inbound(self) -> inbound.InboundResourceWithStreamingResponse:
9681000
from .resources.inbound import InboundResourceWithStreamingResponse
@@ -1084,6 +1116,12 @@ def bulk(self) -> bulk.AsyncBulkResourceWithStreamingResponse:
10841116

10851117
return AsyncBulkResourceWithStreamingResponse(self._client.bulk)
10861118

1119+
@cached_property
1120+
def digests(self) -> digests.AsyncDigestsResourceWithStreamingResponse:
1121+
from .resources.digests import AsyncDigestsResourceWithStreamingResponse
1122+
1123+
return AsyncDigestsResourceWithStreamingResponse(self._client.digests)
1124+
10871125
@cached_property
10881126
def inbound(self) -> inbound.AsyncInboundResourceWithStreamingResponse:
10891127
from .resources.inbound import AsyncInboundResourceWithStreamingResponse

src/courier/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@
4848
BrandsResourceWithStreamingResponse,
4949
AsyncBrandsResourceWithStreamingResponse,
5050
)
51+
from .digests import (
52+
DigestsResource,
53+
AsyncDigestsResource,
54+
DigestsResourceWithRawResponse,
55+
AsyncDigestsResourceWithRawResponse,
56+
DigestsResourceWithStreamingResponse,
57+
AsyncDigestsResourceWithStreamingResponse,
58+
)
5159
from .inbound import (
5260
InboundResource,
5361
AsyncInboundResource,
@@ -208,6 +216,12 @@
208216
"AsyncBulkResourceWithRawResponse",
209217
"BulkResourceWithStreamingResponse",
210218
"AsyncBulkResourceWithStreamingResponse",
219+
"DigestsResource",
220+
"AsyncDigestsResource",
221+
"DigestsResourceWithRawResponse",
222+
"AsyncDigestsResourceWithRawResponse",
223+
"DigestsResourceWithStreamingResponse",
224+
"AsyncDigestsResourceWithStreamingResponse",
211225
"InboundResource",
212226
"AsyncInboundResource",
213227
"InboundResourceWithRawResponse",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .digests import (
4+
DigestsResource,
5+
AsyncDigestsResource,
6+
DigestsResourceWithRawResponse,
7+
AsyncDigestsResourceWithRawResponse,
8+
DigestsResourceWithStreamingResponse,
9+
AsyncDigestsResourceWithStreamingResponse,
10+
)
11+
from .schedules import (
12+
SchedulesResource,
13+
AsyncSchedulesResource,
14+
SchedulesResourceWithRawResponse,
15+
AsyncSchedulesResourceWithRawResponse,
16+
SchedulesResourceWithStreamingResponse,
17+
AsyncSchedulesResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"SchedulesResource",
22+
"AsyncSchedulesResource",
23+
"SchedulesResourceWithRawResponse",
24+
"AsyncSchedulesResourceWithRawResponse",
25+
"SchedulesResourceWithStreamingResponse",
26+
"AsyncSchedulesResourceWithStreamingResponse",
27+
"DigestsResource",
28+
"AsyncDigestsResource",
29+
"DigestsResourceWithRawResponse",
30+
"AsyncDigestsResourceWithRawResponse",
31+
"DigestsResourceWithStreamingResponse",
32+
"AsyncDigestsResourceWithStreamingResponse",
33+
]
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from ..._compat import cached_property
6+
from .schedules import (
7+
SchedulesResource,
8+
AsyncSchedulesResource,
9+
SchedulesResourceWithRawResponse,
10+
AsyncSchedulesResourceWithRawResponse,
11+
SchedulesResourceWithStreamingResponse,
12+
AsyncSchedulesResourceWithStreamingResponse,
13+
)
14+
from ..._resource import SyncAPIResource, AsyncAPIResource
15+
16+
__all__ = ["DigestsResource", "AsyncDigestsResource"]
17+
18+
19+
class DigestsResource(SyncAPIResource):
20+
@cached_property
21+
def schedules(self) -> SchedulesResource:
22+
return SchedulesResource(self._client)
23+
24+
@cached_property
25+
def with_raw_response(self) -> DigestsResourceWithRawResponse:
26+
"""
27+
This property can be used as a prefix for any HTTP method call to return
28+
the raw response object instead of the parsed content.
29+
30+
For more information, see https://www.github.com/trycourier/courier-python#accessing-raw-response-data-eg-headers
31+
"""
32+
return DigestsResourceWithRawResponse(self)
33+
34+
@cached_property
35+
def with_streaming_response(self) -> DigestsResourceWithStreamingResponse:
36+
"""
37+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38+
39+
For more information, see https://www.github.com/trycourier/courier-python#with_streaming_response
40+
"""
41+
return DigestsResourceWithStreamingResponse(self)
42+
43+
44+
class AsyncDigestsResource(AsyncAPIResource):
45+
@cached_property
46+
def schedules(self) -> AsyncSchedulesResource:
47+
return AsyncSchedulesResource(self._client)
48+
49+
@cached_property
50+
def with_raw_response(self) -> AsyncDigestsResourceWithRawResponse:
51+
"""
52+
This property can be used as a prefix for any HTTP method call to return
53+
the raw response object instead of the parsed content.
54+
55+
For more information, see https://www.github.com/trycourier/courier-python#accessing-raw-response-data-eg-headers
56+
"""
57+
return AsyncDigestsResourceWithRawResponse(self)
58+
59+
@cached_property
60+
def with_streaming_response(self) -> AsyncDigestsResourceWithStreamingResponse:
61+
"""
62+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
63+
64+
For more information, see https://www.github.com/trycourier/courier-python#with_streaming_response
65+
"""
66+
return AsyncDigestsResourceWithStreamingResponse(self)
67+
68+
69+
class DigestsResourceWithRawResponse:
70+
def __init__(self, digests: DigestsResource) -> None:
71+
self._digests = digests
72+
73+
@cached_property
74+
def schedules(self) -> SchedulesResourceWithRawResponse:
75+
return SchedulesResourceWithRawResponse(self._digests.schedules)
76+
77+
78+
class AsyncDigestsResourceWithRawResponse:
79+
def __init__(self, digests: AsyncDigestsResource) -> None:
80+
self._digests = digests
81+
82+
@cached_property
83+
def schedules(self) -> AsyncSchedulesResourceWithRawResponse:
84+
return AsyncSchedulesResourceWithRawResponse(self._digests.schedules)
85+
86+
87+
class DigestsResourceWithStreamingResponse:
88+
def __init__(self, digests: DigestsResource) -> None:
89+
self._digests = digests
90+
91+
@cached_property
92+
def schedules(self) -> SchedulesResourceWithStreamingResponse:
93+
return SchedulesResourceWithStreamingResponse(self._digests.schedules)
94+
95+
96+
class AsyncDigestsResourceWithStreamingResponse:
97+
def __init__(self, digests: AsyncDigestsResource) -> None:
98+
self._digests = digests
99+
100+
@cached_property
101+
def schedules(self) -> AsyncSchedulesResourceWithStreamingResponse:
102+
return AsyncSchedulesResourceWithStreamingResponse(self._digests.schedules)

0 commit comments

Comments
 (0)