Skip to content

Commit 8a76b14

Browse files
author
stlc-bot
committed
feat(api): sync OpenAPI spec from production
Stainless-Generated-From: 00ce5f3d92b41d204ff5b40522f05cb492528bfd
1 parent 6512272 commit 8a76b14

8 files changed

Lines changed: 65 additions & 37 deletions

File tree

‎src/sent_dm/_client.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ def messages(self) -> MessagesResource:
191191
**A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.
192192
193193
**A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a finished message — typically one BLOCKED for insufficient balance — back through the send pipeline. It is a new attempt, not a free retry: every policy runs again, the message is billed again, and its status webhooks fire again. A FILTERED message is never resendable.
194+
195+
**A scheduled message can be called off.** `POST /v3/messages/{id}/cancel` cancels a send you scheduled with `scheduled_at`, as long as it has not been released yet. Cancelling is free, fires `message.cancelled`, and is final — a cancelled message cannot be resent.
194196
"""
195197
from .resources.messages import MessagesResource
196198

@@ -495,6 +497,8 @@ def messages(self) -> AsyncMessagesResource:
495497
**A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.
496498
497499
**A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a finished message — typically one BLOCKED for insufficient balance — back through the send pipeline. It is a new attempt, not a free retry: every policy runs again, the message is billed again, and its status webhooks fire again. A FILTERED message is never resendable.
500+
501+
**A scheduled message can be called off.** `POST /v3/messages/{id}/cancel` cancels a send you scheduled with `scheduled_at`, as long as it has not been released yet. Cancelling is free, fires `message.cancelled`, and is final — a cancelled message cannot be resent.
498502
"""
499503
from .resources.messages import AsyncMessagesResource
500504

@@ -741,6 +745,8 @@ def messages(self) -> messages.MessagesResourceWithRawResponse:
741745
**A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.
742746
743747
**A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a finished message — typically one BLOCKED for insufficient balance — back through the send pipeline. It is a new attempt, not a free retry: every policy runs again, the message is billed again, and its status webhooks fire again. A FILTERED message is never resendable.
748+
749+
**A scheduled message can be called off.** `POST /v3/messages/{id}/cancel` cancels a send you scheduled with `scheduled_at`, as long as it has not been released yet. Cancelling is free, fires `message.cancelled`, and is final — a cancelled message cannot be resent.
744750
"""
745751
from .resources.messages import MessagesResourceWithRawResponse
746752

@@ -868,6 +874,8 @@ def messages(self) -> messages.AsyncMessagesResourceWithRawResponse:
868874
**A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.
869875
870876
**A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a finished message — typically one BLOCKED for insufficient balance — back through the send pipeline. It is a new attempt, not a free retry: every policy runs again, the message is billed again, and its status webhooks fire again. A FILTERED message is never resendable.
877+
878+
**A scheduled message can be called off.** `POST /v3/messages/{id}/cancel` cancels a send you scheduled with `scheduled_at`, as long as it has not been released yet. Cancelling is free, fires `message.cancelled`, and is final — a cancelled message cannot be resent.
871879
"""
872880
from .resources.messages import AsyncMessagesResourceWithRawResponse
873881

@@ -995,6 +1003,8 @@ def messages(self) -> messages.MessagesResourceWithStreamingResponse:
9951003
**A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.
9961004
9971005
**A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a finished message — typically one BLOCKED for insufficient balance — back through the send pipeline. It is a new attempt, not a free retry: every policy runs again, the message is billed again, and its status webhooks fire again. A FILTERED message is never resendable.
1006+
1007+
**A scheduled message can be called off.** `POST /v3/messages/{id}/cancel` cancels a send you scheduled with `scheduled_at`, as long as it has not been released yet. Cancelling is free, fires `message.cancelled`, and is final — a cancelled message cannot be resent.
9981008
"""
9991009
from .resources.messages import MessagesResourceWithStreamingResponse
10001010

@@ -1122,6 +1132,8 @@ def messages(self) -> messages.AsyncMessagesResourceWithStreamingResponse:
11221132
**A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.
11231133
11241134
**A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a finished message — typically one BLOCKED for insufficient balance — back through the send pipeline. It is a new attempt, not a free retry: every policy runs again, the message is billed again, and its status webhooks fire again. A FILTERED message is never resendable.
1135+
1136+
**A scheduled message can be called off.** `POST /v3/messages/{id}/cancel` cancels a send you scheduled with `scheduled_at`, as long as it has not been released yet. Cancelling is free, fires `message.cancelled`, and is final — a cancelled message cannot be resent.
11251137
"""
11261138
from .resources.messages import AsyncMessagesResourceWithStreamingResponse
11271139

‎src/sent_dm/resources/calls/calls.py‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,11 @@ def hangup(
201201
) -> None:
202202
"""Ends one of your live calls.
203203
204-
The call then ends the way any other call does: its
205-
status moves to completed and call.completed is sent once the disconnect is
206-
reported. A call that has already ended answers 409, and so does a call with no
207-
phone leg, such as one between two app users.
204+
The call then ends the way any other call does once
205+
the disconnect is reported: an answered call as COMPLETED with call.completed, a
206+
call still ringing as NO_ANSWER, REJECTED or FAILED with call.failed. A call
207+
that has already ended answers 409, and so does a call with no phone leg, such
208+
as one between two app users.
208209
209210
Args:
210211
sandbox: Sandbox flag - when true, the operation is simulated without side effects Useful
@@ -511,10 +512,11 @@ async def hangup(
511512
) -> None:
512513
"""Ends one of your live calls.
513514
514-
The call then ends the way any other call does: its
515-
status moves to completed and call.completed is sent once the disconnect is
516-
reported. A call that has already ended answers 409, and so does a call with no
517-
phone leg, such as one between two app users.
515+
The call then ends the way any other call does once
516+
the disconnect is reported: an answered call as COMPLETED with call.completed, a
517+
call still ringing as NO_ANSWER, REJECTED or FAILED with call.failed. A call
518+
that has already ended answers 409, and so does a call with no phone leg, such
519+
as one between two app users.
518520
519521
Args:
520522
sandbox: Sandbox flag - when true, the operation is simulated without side effects Useful

‎src/sent_dm/resources/calls/participants.py‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ def add(
185185
conference room, and answers with the participant's own call record. The
186186
participant is a call of their own: it has its own id, can be looked up and hung
187187
up, and is billed and reported through call.completed and call.failed like any
188-
other call. A phone participant is called from caller_id, which must be one of
189-
your numbers, or from the call's owning number when omitted, and needs a
190-
destination you may call and a positive balance. Only a call your answer
191-
connected to a conference can take participants: a call connected to a user or a
192-
number answers 409.
188+
other call. Every participant needs a positive balance. A phone participant is
189+
called from caller_id, which must be one of your numbers, or from the call's
190+
owning number when omitted, and needs a destination you may call. Only a call
191+
your answer connected to a conference can take participants: a call connected to
192+
a user or a number answers 409.
193193
194194
Args:
195195
caller_id: The number shown to a phone participant as the caller, in E.164 format. Must be
@@ -483,11 +483,11 @@ async def add(
483483
conference room, and answers with the participant's own call record. The
484484
participant is a call of their own: it has its own id, can be looked up and hung
485485
up, and is billed and reported through call.completed and call.failed like any
486-
other call. A phone participant is called from caller_id, which must be one of
487-
your numbers, or from the call's owning number when omitted, and needs a
488-
destination you may call and a positive balance. Only a call your answer
489-
connected to a conference can take participants: a call connected to a user or a
490-
number answers 409.
486+
other call. Every participant needs a positive balance. A phone participant is
487+
called from caller_id, which must be one of your numbers, or from the call's
488+
owning number when omitted, and needs a destination you may call. Only a call
489+
your answer connected to a conference can take participants: a call connected to
490+
a user or a number answers 409.
491491
492492
Args:
493493
caller_id: The number shown to a phone participant as the caller, in E.164 format. Must be

‎src/sent_dm/resources/messages.py‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class MessagesResource(SyncAPIResource):
3434
**A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.
3535
3636
**A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a finished message — typically one BLOCKED for insufficient balance — back through the send pipeline. It is a new attempt, not a free retry: every policy runs again, the message is billed again, and its status webhooks fire again. A FILTERED message is never resendable.
37+
38+
**A scheduled message can be called off.** `POST /v3/messages/{id}/cancel` cancels a send you scheduled with `scheduled_at`, as long as it has not been released yet. Cancelling is free, fires `message.cancelled`, and is final — a cancelled message cannot be resent.
3739
"""
3840

3941
@cached_property
@@ -110,10 +112,11 @@ def retrieve_status(
110112
111113
Includes delivery
112114
status, timestamps, and error information if applicable. A message that is or
113-
was held for a later time (a send you scheduled with scheduled_at, or a
114-
quiet-hours hold) is returned as a ScheduledMessageResponse: the same fields
115-
plus scheduled_at, the release instant in UTC. A message sent immediately has no
116-
scheduled_at key.
115+
was held for a later time (a send you scheduled with scheduled_at, a quiet-hours
116+
hold, or a message you cancelled while it was held) is returned as a
117+
ScheduledMessageResponse: the same fields plus scheduled_at, the instant it is
118+
held for in UTC — or, on a CANCELLED message, the instant that was called off. A
119+
message sent immediately has no scheduled_at key.
117120
118121
Args:
119122
extra_headers: Send extra headers
@@ -270,6 +273,8 @@ class AsyncMessagesResource(AsyncAPIResource):
270273
**A message needs a sender.** What you can send, where, and at what cost is decided by the markets under **Channels** — so a recipient in a country you hold no sender for is refused here rather than queued.
271274
272275
**A message can be resent on its id.** `POST /v3/messages/{id}/resend` puts a finished message — typically one BLOCKED for insufficient balance — back through the send pipeline. It is a new attempt, not a free retry: every policy runs again, the message is billed again, and its status webhooks fire again. A FILTERED message is never resendable.
276+
277+
**A scheduled message can be called off.** `POST /v3/messages/{id}/cancel` cancels a send you scheduled with `scheduled_at`, as long as it has not been released yet. Cancelling is free, fires `message.cancelled`, and is final — a cancelled message cannot be resent.
273278
"""
274279

275280
@cached_property
@@ -346,10 +351,11 @@ async def retrieve_status(
346351
347352
Includes delivery
348353
status, timestamps, and error information if applicable. A message that is or
349-
was held for a later time (a send you scheduled with scheduled_at, or a
350-
quiet-hours hold) is returned as a ScheduledMessageResponse: the same fields
351-
plus scheduled_at, the release instant in UTC. A message sent immediately has no
352-
scheduled_at key.
354+
was held for a later time (a send you scheduled with scheduled_at, a quiet-hours
355+
hold, or a message you cancelled while it was held) is returned as a
356+
ScheduledMessageResponse: the same fields plus scheduled_at, the instant it is
357+
held for in UTC — or, on a CANCELLED message, the instant that was called off. A
358+
message sent immediately has no scheduled_at key.
353359
354360
Args:
355361
extra_headers: Send extra headers

‎src/sent_dm/types/call.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ class Call(BaseModel):
4242
failure_reason: Optional[str] = None
4343
"""
4444
Why the call did not complete: callback_timeout, invalid_answer,
45-
insufficient_balance, destination_blocked, rejected or no_answer. Null while the
46-
call is live, when it completed, and when it failed without a recorded reason
45+
insufficient_balance, destination_blocked, callback_not_configured, rejected or
46+
no_answer. Null while the call is live, when it completed, and when it failed
47+
without a recorded reason
4748
"""
4849

4950
from_: Optional[CallParty] = FieldInfo(alias="from", default=None)
@@ -65,7 +66,7 @@ class Call(BaseModel):
6566
"""When the call was placed (UTC)"""
6667

6768
status: Optional[str] = None
68-
"""initiated, ringing, answered, completed, failed, no_answer or rejected"""
69+
"""INITIATED, RINGING, ANSWERED, COMPLETED, FAILED, NO_ANSWER or REJECTED"""
6970

7071
timeline: Optional[List[CallTimelineEntry]] = None
7172
"""When the call entered each status, oldest first.

‎src/sent_dm/types/call_timeline_entry.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CallTimelineEntry(BaseModel):
1212
"""When a call entered a status"""
1313

1414
status: Optional[str] = None
15-
"""initiated, ringing, answered, completed, failed, no_answer or rejected"""
15+
"""INITIATED, RINGING, ANSWERED, COMPLETED, FAILED, NO_ANSWER or REJECTED"""
1616

1717
timestamp: Optional[datetime] = None
1818
"""When the call entered this status (UTC)"""

‎src/sent_dm/types/message_event_payload.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,18 @@ class MessageEventPayload(BaseModel):
7171
"""
7272
message.scheduled only: why the message is held, either because you scheduled it
7373
or because the recipient is inside a protected quiet-hours window. Omitted on
74-
every other event.
74+
every other event, including message.cancelled — that is a property of the hold,
75+
not of the cancellation, and repeating it there would read as "why was this
76+
cancelled", which it does not answer.
7577
"""
7678

7779
scheduled_at: Optional[str] = None
7880
"""
79-
message.scheduled only: when the held message will be released for delivery, in
80-
UTC (yyyy-MM-ddTHH:mm:ssZ). Omitted on every other event.
81+
message.scheduled and message.cancelled only, in UTC (yyyy-MM-ddTHH:mm:ssZ): on
82+
message.scheduled it is when the held message will be released for delivery, on
83+
message.cancelled the release instant that was called off — the same instant,
84+
before and after. A consumer that recorded a future send from the first event
85+
has what it needs to un-record it from the second. Omitted on every other event.
8186
"""
8287

8388
template_id: Optional[str] = None

‎src/sent_dm/types/message_retrieve_activities_response.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ class DataActivity(BaseModel):
6060

6161
scheduled_at: Optional[datetime] = None
6262
"""
63-
SCHEDULED activities only: when the held message will be released for delivery,
64-
in UTC. Same wire name as on the send response, the message and the webhook.
65-
Omitted on every other activity. A message that quiet hours moved at release has
66-
two SCHEDULED entries, each carrying the instant as it stood at that moment.
63+
SCHEDULED and CANCELLED activities only, in UTC: on a SCHEDULED entry, when the
64+
held message will be released for delivery; on a CANCELLED entry, the instant
65+
that was called off. Same wire name as on the send response, the message and the
66+
webhook. Omitted on every other activity. A message that quiet hours moved at
67+
release has two SCHEDULED entries, each carrying the instant as it stood at that
68+
moment.
6769
"""
6870

6971
status: Optional[str] = None

0 commit comments

Comments
 (0)