dial_sdk.types¶
Attributes¶
Classes¶
One activity-ledger item from GET /api/v1/billing/activity. type selects |
|
One page of activity, newest-first. has_more signals further pages. |
|
dict() -> new empty dictionary |
|
dict() -> new empty dictionary |
|
Server-derived, client-facing call status (camelCase, as returned). |
|
dict() -> new empty dictionary |
|
dict() -> new empty dictionary |
|
The status the call just entered — mirrors the call record's derived |
|
dict() -> new empty dictionary |
|
dict() -> new empty dictionary |
|
One capability's state. |
|
One phone number the account's lines have talked to. |
|
One page of contacts, and whether older ones remain. |
|
A group conversation — a conversation that isn't a phone number. |
|
Raw bytes to upload as a media attachment; the MIME type is required. |
|
A media attachment on a message, hosted by Dial. |
|
dict() -> new empty dictionary |
|
dict() -> new empty dictionary |
|
dict() -> new empty dictionary |
|
dict() -> new empty dictionary |
|
An advance on one of an outbound message's two independent axes. |
|
What a phone number can receive. |
|
dict() -> new empty dictionary |
|
A change to one of a phone number's capabilities. |
|
dict() -> new empty dictionary |
|
One uninterrupted stretch of speech by one party, placed in time. |
Module Contents¶
- class dial_sdk.types.Billing¶
-
- balance_cents: int¶
- deposits: list[BillingDeposit]¶
- numbers: list[BillingNumber]¶
- numbers_release_at: str | None¶
- payment_methods: list[BillingPaymentMethod]¶
- pricing: BillingPricing¶
- subscription: BillingSubscription | None¶
- class dial_sdk.types.BillingActivityItem¶
One activity-ledger item from GET /api/v1/billing/activity. type selects which fields are populated: - ‘usage’ → fare_name, number, billed_quantity, total_cents, attribution, phone_number_id, call_id, message_id - ‘credit’ → amount_cents, kind, invoice_id - ‘payment’ → amount_cents, invoice_id, reason
- classmethod from_api(d: dict) BillingActivityItem¶
- amount_cents: int | None = None¶
- attribution: str | None = None¶
- billed_quantity: int | None = None¶
- call_id: str | None = None¶
- fare_name: str | None = None¶
- invoice_id: str | None = None¶
- kind: str | None = None¶
- message_id: str | None = None¶
- number: str | None = None¶
- occurred_at: str¶
- phone_number_id: str | None = None¶
- reason: str | None = None¶
- total_cents: int | None = None¶
- type: str¶
- class dial_sdk.types.BillingActivityPage¶
One page of activity, newest-first. has_more signals further pages.
- classmethod from_api(d: dict) BillingActivityPage¶
- data: list[BillingActivityItem]¶
- has_more: bool¶
- class dial_sdk.types.BillingDeposit¶
- classmethod from_api(d: dict) BillingDeposit¶
- amount_cents: int¶
- created_at: str¶
- invoice_id: str | None = None¶
- kind: str¶
- class dial_sdk.types.BillingNumber¶
- classmethod from_api(d: dict) BillingNumber¶
- id: str¶
- mode: str¶
- nickname: str | None = None¶
- number: str¶
- class dial_sdk.types.BillingPaymentMethod¶
- classmethod from_api(d: dict) BillingPaymentMethod¶
- brand: str¶
- email: str | None¶
- exp_month: int¶
- exp_year: int¶
- id: str¶
- is_default: bool¶
- last4: str¶
- type: str¶
- class dial_sdk.types.BillingPricing¶
- classmethod from_api(d: dict) BillingPricing¶
- annual_cents: int¶
- monthly_cents: int¶
- class dial_sdk.types.BillingSubscription¶
- classmethod from_api(d: dict) BillingSubscription¶
- cancel_at_period_end: bool¶
- interval: str¶
- period_end: str¶
- period_start: str¶
- quantity: int¶
- class dial_sdk.types.Call¶
-
- call_started_at: str | None¶
- cancel_requested_at: str | None¶
- created_at: str¶
- direction: str¶
- duration: int¶
- from_: str¶
- id: str¶
- instruction: str | None¶
- phone_number_id: str¶
- queued_at: str | None¶
- started_ringing_at: str | None¶
- status: CallStatus¶
- terminated_at: str | None¶
- termination_type: str | None¶
- to: str¶
- transcript: str | None¶
- transcript_turns: list[TranscriptTurn] | None¶
- transfer_to: str | None¶
- transferred_at: str | None¶
- class dial_sdk.types.CallEnded¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- createdAt: str¶
- data: CallEndedData¶
- id: str¶
- object: Literal['event']¶
- type: Literal['call.ended']¶
- version: int¶
- class dial_sdk.types.CallEndedData¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- callId: str¶
- canceled: bool¶
- direction: str¶
- durationSeconds: int | None¶
- from_: str¶
- status: str¶
- to: str¶
- transcriptAvailable: bool¶
- class dial_sdk.types.CallStatus¶
Bases:
TypedDictServer-derived, client-facing call status (camelCase, as returned).
Initialize self. See help(type(self)) for accurate signature.
- cancelPending: bool¶
- cancelRequested: bool¶
- label: str¶
- state: str¶
- terminationType: str | None¶
- class dial_sdk.types.CallStatusChanged¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- createdAt: str¶
- data: CallStatusChangedData¶
- id: str¶
- object: Literal['event']¶
- type: Literal['call.status_changed']¶
- version: int¶
- class dial_sdk.types.CallStatusChangedData¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- callId: str¶
- direction: str¶
- from_: str¶
- phoneNumberId: str¶
- previousState: str | None¶
- status: CallStatusChangedStatus¶
- terminationType: str | None¶
- to: str¶
- class dial_sdk.types.CallStatusChangedStatus¶
Bases:
TypedDictThe status the call just entered — mirrors the call record’s derived
status.Initialize self. See help(type(self)) for accurate signature.
- label: str¶
- state: str¶
- class dial_sdk.types.CallTranscribed¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- createdAt: str¶
- data: CallTranscribedData¶
- id: str¶
- object: Literal['event']¶
- type: Literal['call.transcribed']¶
- version: int¶
- class dial_sdk.types.CallTranscribedData¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- callId: str¶
- class dial_sdk.types.CapabilityState¶
Bases:
TypedDictOne capability’s state.
previousStatus,errorandretryAvailableAtappear only on the asynchronous capabilities (callon an iMessage number, andwhatsapp); a synchronous one has no transition to report and cannot fail.Initialize self. See help(type(self)) for accurate signature.
- error: str | None¶
- previousStatus: str | None¶
- retryAvailableAt: str | None¶
- status: str¶
- class dial_sdk.types.Contact¶
One phone number the account’s lines have talked to.
Derived from message and call history rather than stored: there is no address book to add anyone to, so a contact has no id — the number is its identity.
- call_count: int¶
- last_at: str¶
- last_body: str¶
- last_call_duration: int | None¶
- last_direction: str¶
- last_kind: str¶
- last_media_count: int¶
- last_redacted: bool¶
- message_count: int¶
- number: str¶
- class dial_sdk.types.ContactsPage¶
One page of contacts, and whether older ones remain.
- classmethod from_api(d: dict) ContactsPage¶
- has_more: bool¶
- class dial_sdk.types.DialConfig¶
- api_key: str¶
- base_url: str | None = None¶
- user_agent: str | None = None¶
- class dial_sdk.types.Group¶
A group conversation — a conversation that isn’t a phone number.
Pass
idasgroup_idwhen sending or listing messages.- channel: Literal['whatsapp', 'imessage']¶
- created_at: str¶
- id: str¶
- name: str | None¶
- class dial_sdk.types.MakeCallParams¶
- from_number: str | None = None¶
- from_number_id: str | None = None¶
- idempotency_key: str | None = None¶
- language: str | None = None¶
- max_call_duration_seconds: int | None = None¶
- outbound_instruction: str = ''¶
- to: str¶
- transfer_to: str | None = None¶
- voice_gender: str | None = None¶
- class dial_sdk.types.MediaItem¶
Raw bytes to upload as a media attachment; the MIME type is required.
- content_type: str¶
- data: bytes¶
- filename: str = 'media'¶
- class dial_sdk.types.Message¶
-
- body: str¶
- channel: str¶
- created_at: str¶
- delivery_error: str | None = None¶
- delivery_state: str | None = None¶
- direction: str¶
- from_: str¶
- group_id: str | None = None¶
- id: str¶
- media: list[MessageMediaItem] = []¶
- phone_number_id: str¶
- reaction: str | None = None¶
- read_at: str | None = None¶
- read_state: str | None = None¶
- reply_to_id: str | None = None¶
- status: str¶
- status_error: str | None = None¶
- to: str | None¶
- class dial_sdk.types.MessageMediaItem¶
A media attachment on a message, hosted by Dial.
- classmethod from_api(d: dict) MessageMediaItem¶
- content_type: str¶
- id: str¶
- original_url: str | None¶
- url: str¶
- class dial_sdk.types.MessageReceived¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- createdAt: str¶
- data: MessageReceivedData¶
- id: str¶
- object: Literal['event']¶
- type: Literal['message.received']¶
- version: int¶
- class dial_sdk.types.MessageReceivedData¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- body: str¶
- channel: str¶
- from_: str¶
- media: list[MessageReceivedMediaItem]¶
- messageId: str¶
- source: str¶
- to: str¶
- class dial_sdk.types.MessageReceivedMediaItem¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- contentType: str¶
- id: str¶
- originalUrl: str | None¶
- url: str¶
- class dial_sdk.types.MessageStatusChanged¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- createdAt: str¶
- id: str¶
- object: Literal['event']¶
- type: Literal['message.status_changed']¶
- version: int¶
- class dial_sdk.types.MessageStatusChangedData¶
Bases:
TypedDictAn advance on one of an outbound message’s two independent axes.
Delivery and reads are separate facts — not every rail reports both — so the payload carries the current value of BOTH axes plus changed naming the one that just moved. Each event is therefore a complete snapshot.
Initialize self. See help(type(self)) for accurate signature.
- changed: str¶
- channel: str¶
- deliveryError: str | None¶
- deliveryState: str¶
- from_: str¶
- messageId: str¶
- phoneNumberId: str¶
- readState: str¶
- to: str¶
- class dial_sdk.types.NumberLookup¶
What a phone number can receive.
supportsdescribes the number that was asked about, NOT one of your own lines. It is a point-in-time answer rather than a property of the number: someone who changes device or turns a service off stops being reachable, so treat aTrueas a strong signal for picking a channel, not a promise that a later send is delivered.- classmethod from_api(d: dict) NumberLookup¶
- number: str¶
- supports: dict[str, bool]¶
- class dial_sdk.types.NumberStatusChanged¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- createdAt: str¶
- data: NumberStatusChangedData¶
- id: str¶
- object: Literal['event']¶
- type: Literal['number.status_changed']¶
- version: int¶
- class dial_sdk.types.NumberStatusChangedData¶
Bases:
TypedDictA change to one of a phone number’s capabilities.
Wait on this instead of polling a number until it is usable.
statusfolds the capabilities:unsettledwhile any is still working,readywhen all are ready,degradedwhen everything has finished trying and something failed.readyanddegradedare both terminal, so waiting on either always resolves —degradedexists because WhatsApp can be declined outright while the number still works for calls and messages.Payload version 2. Version 1 was flat (
setupStatus/setupErrorand acapabilitiesstring list) and had nowhere to put a WhatsApp failure or its cooldown.Initialize self. See help(type(self)) for accurate signature.
- capabilities: dict[str, CapabilityState]¶
- changed: list[str]¶
- number: str¶
- phoneNumberId: str¶
- previousStatus: str | None¶
- status: str¶
- class dial_sdk.types.PhoneNumber¶
- classmethod from_api(d: dict) PhoneNumber¶
- account_id: str¶
- avatar_url: str | None = None¶
- calling_enabled: bool¶
- capabilities: list[str]¶
- country: str¶
- created_at: str¶
- first_name: str | None = None¶
- forward_to: str | None = None¶
- id: str¶
- inbound_instruction: str | None¶
- inbound_language: str | None¶
- inbound_voice_gender: str | None¶
- last_name: str | None = None¶
- max_call_duration_seconds: int | None¶
- nickname: str | None¶
- number: str¶
- setup_error: str | None¶
- setup_status: str¶
- whatsapp: dict | None = None¶
- whatsapp_avatar_url: str | None = None¶
- whatsapp_name: str | None = None¶
- class dial_sdk.types.PurchaseNumberParams¶
- area_code: str | None = None¶
- calling_enabled: bool | None = None¶
- explicit_programmatic_consent: str¶
- inbound_instruction: str¶
- inbound_language: str | None = None¶
- inbound_voice_gender: str | None = None¶
- include_imessage: bool = False¶
- class dial_sdk.types.RelatedObject¶
Bases:
TypedDictdict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s
(key, value) pairs
- dict(iterable) -> new dictionary initialized as if via:
d = {} for k, v in iterable:
d[k] = v
- dict(**kwargs) -> new dictionary initialized with the name=value pairs
in the keyword argument list. For example: dict(one=1, two=2)
Initialize self. See help(type(self)) for accurate signature.
- id: str¶
- type: Literal['call', 'message']¶
- url: str | None¶
- class dial_sdk.types.SendMessageParams¶
- body: str = ''¶
- channel: str | None = None¶
- force_audio_file: bool = False¶
- from_number: str | None = None¶
- from_number_id: str | None = None¶
- group_id: str | None = None¶
- media: list[SendMessageMedia] = []¶
- to: str = ''¶
- class dial_sdk.types.TranscriptTurn¶
One uninterrupted stretch of speech by one party, placed in time.
Offsets count milliseconds from the start of the call’s audio, so the pause before a turn is its
start_msminus the previous turn’send_ms.The offsets are approximate: they come from per-word timings the voice runtime does not guarantee to be exact. Ample for spotting a long silence, which is what they are for; not a basis for splitting tenths of a second.
- classmethod from_api(d: dict) TranscriptTurn¶
- end_ms: int¶
- speaker: str¶
- start_ms: int¶
- text: str¶
- dial_sdk.types.CallEvent¶
- dial_sdk.types.DialEvent¶
- dial_sdk.types.MessageEvent¶
- dial_sdk.types.SendMessageMedia¶