|
| 1 | +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +from typing import Optional |
| 4 | + |
| 5 | +from .._models import BaseModel |
| 6 | + |
| 7 | +__all__ = ["ChannelEventPayload"] |
| 8 | + |
| 9 | + |
| 10 | +class ChannelEventPayload(BaseModel): |
| 11 | + """ |
| 12 | + Body of a channel event: where one of the customer's channels stands in provisioning and |
| 13 | + compliance. Delivered when a milestone moves — a registration filed, a verdict returned, a |
| 14 | + resubmission asked for, a sender gone live — so a customer's own onboarding UI does not have to |
| 15 | + poll GET /v3/channels. |
| 16 | +
|
| 17 | + The subject is one item, never the account. A customer's "SMS channel" has no |
| 18 | + status; a market does. Country, NumberType and |
| 19 | + SenderValue name which one, so a customer terminating only to Kosovo never |
| 20 | + receives an event about US 10DLC. |
| 21 | +
|
| 22 | + Status is the stable half of the contract. It is the same four-value |
| 23 | + set GET /v3/channels publishes, computed through the same code, so an event and a read of |
| 24 | + the same market cannot disagree. A subscriber that reads nothing but the status and the subject |
| 25 | + fields is a correct subscriber. The sub-type on the envelope names the specific milestone and is |
| 26 | + additive — that vocabulary comes from registries and carriers, which are parties Sent does not |
| 27 | + control. |
| 28 | +
|
| 29 | + Status means provisioning and compliance are complete, not that a send |
| 30 | + will succeed right now. An account can be suspended, or a destination blocked by a routing |
| 31 | + rule, without either showing up here. Those are separate surfaces and deliberately not modelled |
| 32 | + on this payload. |
| 33 | + """ |
| 34 | + |
| 35 | + country: str |
| 36 | + """The market's destination country as an ISO 3166-1 alpha-2 code, for example XK. |
| 37 | +
|
| 38 | + Always present, and the property that identifies this payload among the |
| 39 | + delivered envelopes — see DeliveredWebhookEvents. Every event in this family |
| 40 | + reports one market, and a market has a country. |
| 41 | + """ |
| 42 | + |
| 43 | + account_id: Optional[str] = None |
| 44 | + """The account whose market this is, named as on every other family. |
| 45 | +
|
| 46 | + When an organization receives an event for one of its sender profiles this is |
| 47 | + the profile, so a reseller compares it with its own id and anything different is |
| 48 | + one of its profiles. |
| 49 | + """ |
| 50 | + |
| 51 | + channel: Optional[str] = None |
| 52 | + """The channel this market belongs to: sms, whatsapp, or rcs. |
| 53 | +
|
| 54 | + Never sent — that value belongs to message events, where it names the |
| 55 | + smart-routing brand rather than a channel that can be provisioned. |
| 56 | + """ |
| 57 | + |
| 58 | + number_type: Optional[str] = None |
| 59 | + """The kind of sender the market uses, for example TEN_DLC, LOCAL, or ALPHANUMERIC. |
| 60 | +
|
| 61 | + Omitted when the subject has no sender type of its own. |
| 62 | + """ |
| 63 | + |
| 64 | + reason: Optional[str] = None |
| 65 | + """ |
| 66 | + Why the market reached this state, when a reason was given — a correction |
| 67 | + explained, or a campaign lapse. Free text, passed through from the registry or |
| 68 | + carrier that wrote it, so treat it as a message to show a human rather than a |
| 69 | + value to branch on. |
| 70 | + """ |
| 71 | + |
| 72 | + sender_value: Optional[str] = None |
| 73 | + """The sender itself — a number in E.164, or an alphanumeric sender ID. |
| 74 | +
|
| 75 | + Always present, and null until a sender exists. The key is on every delivery so |
| 76 | + a subscriber reads one shape rather than branching on whether the field arrived |
| 77 | + — the same choice template_id makes on the message payload. |
| 78 | +
|
| 79 | + It can carry a value at any point in the lifecycle, not only once the market is |
| 80 | + live: a number ordered and not yet active at the carrier is already known during |
| 81 | + PROVISIONING, and an alphanumeric sender the customer chose themselves is known |
| 82 | + before anything is filed. It is null while the market is still waiting on a |
| 83 | + number, which for a US 10DLC registration is every event up to |
| 84 | + channel.activated. |
| 85 | + """ |
| 86 | + |
| 87 | + status: Optional[str] = None |
| 88 | + """ |
| 89 | + Where the market stands: PENDING_REVIEW, ACTION_NEEDED, PROVISIONING, ACTIVE or |
| 90 | + INACTIVE. PENDING_REVIEW means a registry or a carrier holds it and the wait is |
| 91 | + theirs; ACTION_NEEDED means it is yours; PROVISIONING means the verdict is in |
| 92 | + and Sent is acquiring the sender; INACTIVE means it had a working sender and no |
| 93 | + longer does. |
| 94 | +
|
| 95 | + Each event name is the transition into one of these, but the two are separate |
| 96 | + fields and may legitimately differ. A resubmission filed against a market whose |
| 97 | + sender is already live is channel.submitted carrying ACTIVE: a correction is |
| 98 | + with the registry and the sender keeps working. Read both. |
| 99 | + """ |
| 100 | + |
| 101 | + updated_at: Optional[str] = None |
| 102 | + """When the transition happened, in UTC (yyyy-MM-ddTHH:mm:ssZ).""" |
0 commit comments