telnyx 3.1.0a0__py3-none-any.whl → 3.3.0a0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of telnyx might be problematic. Click here for more details.

Files changed (78) hide show
  1. telnyx/_client.py +5 -0
  2. telnyx/_version.py +1 -1
  3. telnyx/resources/__init__.py +3 -0
  4. telnyx/resources/documents.py +81 -0
  5. telnyx/resources/webhooks.py +34 -0
  6. telnyx/types/__init__.py +114 -0
  7. telnyx/types/call_ai_gather_ended_webhook_event.py +78 -0
  8. telnyx/types/call_ai_gather_message_history_updated_webhook_event.py +69 -0
  9. telnyx/types/call_ai_gather_partial_results_webhook_event.py +75 -0
  10. telnyx/types/call_answered_webhook_event.py +75 -0
  11. telnyx/types/call_bridged_webhook_event.py +58 -0
  12. telnyx/types/call_conversation_ended_webhook_event.py +84 -0
  13. telnyx/types/call_conversation_insights_generated_webhook_event.py +67 -0
  14. telnyx/types/call_dtmf_received_webhook_event.py +61 -0
  15. telnyx/types/call_enqueued_webhook_event.py +59 -0
  16. telnyx/types/call_fork_started_webhook_event.py +53 -0
  17. telnyx/types/call_fork_stopped_webhook_event.py +53 -0
  18. telnyx/types/call_gather_ended_webhook_event.py +64 -0
  19. telnyx/types/call_hangup_webhook_event.py +150 -0
  20. telnyx/types/call_initiated_webhook_event.py +96 -0
  21. telnyx/types/call_left_queue_webhook_event.py +62 -0
  22. telnyx/types/call_machine_detection_ended_webhook_event.py +61 -0
  23. telnyx/types/call_machine_greeting_ended_webhook_event.py +61 -0
  24. telnyx/types/call_machine_premium_detection_ended_webhook_event.py +63 -0
  25. telnyx/types/call_machine_premium_greeting_ended_webhook_event.py +61 -0
  26. telnyx/types/call_playback_ended_webhook_event.py +70 -0
  27. telnyx/types/call_playback_started_webhook_event.py +62 -0
  28. telnyx/types/call_recording_error_webhook_event.py +60 -0
  29. telnyx/types/call_recording_saved_webhook_event.py +94 -0
  30. telnyx/types/call_recording_transcription_saved_webhook_event.py +71 -0
  31. telnyx/types/call_refer_completed_webhook_event.py +61 -0
  32. telnyx/types/call_refer_failed_webhook_event.py +61 -0
  33. telnyx/types/call_refer_started_webhook_event.py +61 -0
  34. telnyx/types/call_siprec_failed_webhook_event.py +53 -0
  35. telnyx/types/call_siprec_started_webhook_event.py +50 -0
  36. telnyx/types/call_siprec_stopped_webhook_event.py +53 -0
  37. telnyx/types/call_speak_ended_webhook_event.py +53 -0
  38. telnyx/types/call_speak_started_webhook_event.py +50 -0
  39. telnyx/types/call_streaming_failed_webhook_event.py +70 -0
  40. telnyx/types/call_streaming_started_webhook_event.py +53 -0
  41. telnyx/types/call_streaming_stopped_webhook_event.py +53 -0
  42. telnyx/types/campaign_status_update_webhook_event.py +26 -0
  43. telnyx/types/conference_created_webhook_event.py +53 -0
  44. telnyx/types/conference_ended_webhook_event.py +56 -0
  45. telnyx/types/conference_floor_changed_webhook_event.py +45 -0
  46. telnyx/types/conference_participant_joined_webhook_event.py +53 -0
  47. telnyx/types/conference_participant_left_webhook_event.py +53 -0
  48. telnyx/types/conference_participant_playback_ended_webhook_event.py +65 -0
  49. telnyx/types/conference_participant_playback_started_webhook_event.py +65 -0
  50. telnyx/types/conference_participant_speak_ended_webhook_event.py +56 -0
  51. telnyx/types/conference_participant_speak_started_webhook_event.py +56 -0
  52. telnyx/types/conference_playback_ended_webhook_event.py +49 -0
  53. telnyx/types/conference_playback_started_webhook_event.py +49 -0
  54. telnyx/types/conference_recording_saved_webhook_event.py +103 -0
  55. telnyx/types/conference_speak_ended_webhook_event.py +40 -0
  56. telnyx/types/conference_speak_started_webhook_event.py +40 -0
  57. telnyx/types/custom_sip_header.py +13 -0
  58. telnyx/types/customer_service_record_status_changed_webhook_event.py +55 -0
  59. telnyx/types/delivery_update_webhook_event.py +40 -0
  60. telnyx/types/document_generate_download_link_response.py +14 -0
  61. telnyx/types/fax_delivered_webhook_event.py +69 -0
  62. telnyx/types/fax_failed_webhook_event.py +66 -0
  63. telnyx/types/fax_media_processed_webhook_event.py +63 -0
  64. telnyx/types/fax_queued_webhook_event.py +63 -0
  65. telnyx/types/fax_sending_started_webhook_event.py +63 -0
  66. telnyx/types/inbound_message_webhook_event.py +227 -0
  67. telnyx/types/number_order_status_update_webhook_event.py +12 -0
  68. telnyx/types/replaced_link_click_webhook_event.py +32 -0
  69. telnyx/types/sip_header.py +15 -0
  70. telnyx/types/streaming_failed_webhook_event.py +70 -0
  71. telnyx/types/streaming_started_webhook_event.py +53 -0
  72. telnyx/types/streaming_stopped_webhook_event.py +53 -0
  73. telnyx/types/transcription_webhook_event.py +72 -0
  74. telnyx/types/unwrap_webhook_event.py +138 -0
  75. {telnyx-3.1.0a0.dist-info → telnyx-3.3.0a0.dist-info}/METADATA +1 -1
  76. {telnyx-3.1.0a0.dist-info → telnyx-3.3.0a0.dist-info}/RECORD +78 -9
  77. {telnyx-3.1.0a0.dist-info → telnyx-3.3.0a0.dist-info}/WHEEL +0 -0
  78. {telnyx-3.1.0a0.dist-info → telnyx-3.3.0a0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,69 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+
10
+ __all__ = ["FaxDeliveredWebhookEvent", "Payload"]
11
+
12
+
13
+ class Payload(BaseModel):
14
+ call_duration_secs: Optional[int] = None
15
+ """The duration of the call in seconds."""
16
+
17
+ client_state: Optional[str] = None
18
+ """State received from a command."""
19
+
20
+ connection_id: Optional[str] = None
21
+ """The ID of the connection used to send the fax."""
22
+
23
+ direction: Optional[Literal["inbound", "outbound"]] = None
24
+ """The direction of the fax."""
25
+
26
+ fax_id: Optional[str] = None
27
+ """Identifies the fax."""
28
+
29
+ from_: Optional[str] = FieldInfo(alias="from", default=None)
30
+ """The phone number, in E.164 format, the fax will be sent from."""
31
+
32
+ media_name: Optional[str] = None
33
+ """The media_name used for the fax's media.
34
+
35
+ Must point to a file previously uploaded to api.telnyx.com/v2/media by the same
36
+ user/organization. media_name and media_url/contents can't be submitted
37
+ together.
38
+ """
39
+
40
+ original_media_url: Optional[str] = None
41
+ """The original URL to the PDF used for the fax's media.
42
+
43
+ If media_name was supplied, this is omitted
44
+ """
45
+
46
+ page_count: Optional[int] = None
47
+ """Number of transferred pages"""
48
+
49
+ status: Optional[Literal["delivered"]] = None
50
+ """The status of the fax."""
51
+
52
+ to: Optional[str] = None
53
+ """The phone number, in E.164 format, the fax will be sent to or SIP URI"""
54
+
55
+ user_id: Optional[str] = None
56
+ """Identifier of the user to whom the fax belongs"""
57
+
58
+
59
+ class FaxDeliveredWebhookEvent(BaseModel):
60
+ id: Optional[str] = None
61
+ """Identifies the type of resource."""
62
+
63
+ event_type: Optional[Literal["fax.delivered"]] = None
64
+ """The type of event being delivered."""
65
+
66
+ payload: Optional[Payload] = None
67
+
68
+ record_type: Optional[Literal["event"]] = None
69
+ """Identifies the type of the resource."""
@@ -0,0 +1,66 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+
10
+ __all__ = ["FaxFailedWebhookEvent", "Payload"]
11
+
12
+
13
+ class Payload(BaseModel):
14
+ client_state: Optional[str] = None
15
+ """State received from a command."""
16
+
17
+ connection_id: Optional[str] = None
18
+ """The ID of the connection used to send the fax."""
19
+
20
+ direction: Optional[Literal["inbound", "outbound"]] = None
21
+ """The direction of the fax."""
22
+
23
+ failure_reason: Optional[Literal["rejected"]] = None
24
+ """Cause of the sending failure"""
25
+
26
+ fax_id: Optional[str] = None
27
+ """Identifies the fax."""
28
+
29
+ from_: Optional[str] = FieldInfo(alias="from", default=None)
30
+ """The phone number, in E.164 format, the fax will be sent from."""
31
+
32
+ media_name: Optional[str] = None
33
+ """The media_name used for the fax's media.
34
+
35
+ Must point to a file previously uploaded to api.telnyx.com/v2/media by the same
36
+ user/organization. media_name and media_url/contents can't be submitted
37
+ together.
38
+ """
39
+
40
+ original_media_url: Optional[str] = None
41
+ """The original URL to the PDF used for the fax's media.
42
+
43
+ If media_name was supplied, this is omitted
44
+ """
45
+
46
+ status: Optional[Literal["failed"]] = None
47
+ """The status of the fax."""
48
+
49
+ to: Optional[str] = None
50
+ """The phone number, in E.164 format, the fax will be sent to or SIP URI"""
51
+
52
+ user_id: Optional[str] = None
53
+ """Identifier of the user to whom the fax belongs"""
54
+
55
+
56
+ class FaxFailedWebhookEvent(BaseModel):
57
+ id: Optional[str] = None
58
+ """Identifies the type of resource."""
59
+
60
+ event_type: Optional[Literal["fax.failed"]] = None
61
+ """The type of event being delivered."""
62
+
63
+ payload: Optional[Payload] = None
64
+
65
+ record_type: Optional[Literal["event"]] = None
66
+ """Identifies the type of the resource."""
@@ -0,0 +1,63 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+
10
+ __all__ = ["FaxMediaProcessedWebhookEvent", "Payload"]
11
+
12
+
13
+ class Payload(BaseModel):
14
+ client_state: Optional[str] = None
15
+ """State received from a command."""
16
+
17
+ connection_id: Optional[str] = None
18
+ """The ID of the connection used to send the fax."""
19
+
20
+ direction: Optional[Literal["inbound", "outbound"]] = None
21
+ """The direction of the fax."""
22
+
23
+ fax_id: Optional[str] = None
24
+ """Identifies the fax."""
25
+
26
+ from_: Optional[str] = FieldInfo(alias="from", default=None)
27
+ """The phone number, in E.164 format, the fax will be sent from."""
28
+
29
+ media_name: Optional[str] = None
30
+ """The media_name used for the fax's media.
31
+
32
+ Must point to a file previously uploaded to api.telnyx.com/v2/media by the same
33
+ user/organization. media_name and media_url/contents can't be submitted
34
+ together.
35
+ """
36
+
37
+ original_media_url: Optional[str] = None
38
+ """The original URL to the PDF used for the fax's media.
39
+
40
+ If media_name was supplied, this is omitted
41
+ """
42
+
43
+ status: Optional[Literal["media.processed"]] = None
44
+ """The status of the fax."""
45
+
46
+ to: Optional[str] = None
47
+ """The phone number, in E.164 format, the fax will be sent to or SIP URI"""
48
+
49
+ user_id: Optional[str] = None
50
+ """Identifier of the user to whom the fax belongs"""
51
+
52
+
53
+ class FaxMediaProcessedWebhookEvent(BaseModel):
54
+ id: Optional[str] = None
55
+ """Identifies the type of resource."""
56
+
57
+ event_type: Optional[Literal["fax.media.processed"]] = None
58
+ """The type of event being delivered."""
59
+
60
+ payload: Optional[Payload] = None
61
+
62
+ record_type: Optional[Literal["event"]] = None
63
+ """Identifies the type of the resource."""
@@ -0,0 +1,63 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+
10
+ __all__ = ["FaxQueuedWebhookEvent", "Payload"]
11
+
12
+
13
+ class Payload(BaseModel):
14
+ client_state: Optional[str] = None
15
+ """State received from a command."""
16
+
17
+ connection_id: Optional[str] = None
18
+ """The ID of the connection used to send the fax."""
19
+
20
+ direction: Optional[Literal["inbound", "outbound"]] = None
21
+ """The direction of the fax."""
22
+
23
+ fax_id: Optional[str] = None
24
+ """Identifies the fax."""
25
+
26
+ from_: Optional[str] = FieldInfo(alias="from", default=None)
27
+ """The phone number, in E.164 format, the fax will be sent from."""
28
+
29
+ media_name: Optional[str] = None
30
+ """The media_name used for the fax's media.
31
+
32
+ Must point to a file previously uploaded to api.telnyx.com/v2/media by the same
33
+ user/organization. media_name and media_url/contents can't be submitted
34
+ together.
35
+ """
36
+
37
+ original_media_url: Optional[str] = None
38
+ """The original URL to the PDF used for the fax's media.
39
+
40
+ If media_name was supplied, this is omitted
41
+ """
42
+
43
+ status: Optional[Literal["queued"]] = None
44
+ """The status of the fax."""
45
+
46
+ to: Optional[str] = None
47
+ """The phone number, in E.164 format, the fax will be sent to or SIP URI"""
48
+
49
+ user_id: Optional[str] = None
50
+ """Identifier of the user to whom the fax belongs"""
51
+
52
+
53
+ class FaxQueuedWebhookEvent(BaseModel):
54
+ id: Optional[str] = None
55
+ """Identifies the type of resource."""
56
+
57
+ event_type: Optional[Literal["fax.queued"]] = None
58
+ """The type of event being delivered."""
59
+
60
+ payload: Optional[Payload] = None
61
+
62
+ record_type: Optional[Literal["event"]] = None
63
+ """Identifies the type of the resource."""
@@ -0,0 +1,63 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+
10
+ __all__ = ["FaxSendingStartedWebhookEvent", "Payload"]
11
+
12
+
13
+ class Payload(BaseModel):
14
+ client_state: Optional[str] = None
15
+ """State received from a command."""
16
+
17
+ connection_id: Optional[str] = None
18
+ """The ID of the connection used to send the fax."""
19
+
20
+ direction: Optional[Literal["inbound", "outbound"]] = None
21
+ """The direction of the fax."""
22
+
23
+ fax_id: Optional[str] = None
24
+ """Identifies the fax."""
25
+
26
+ from_: Optional[str] = FieldInfo(alias="from", default=None)
27
+ """The phone number, in E.164 format, the fax will be sent from."""
28
+
29
+ media_name: Optional[str] = None
30
+ """The media_name used for the fax's media.
31
+
32
+ Must point to a file previously uploaded to api.telnyx.com/v2/media by the same
33
+ user/organization. media_name and media_url/contents can't be submitted
34
+ together.
35
+ """
36
+
37
+ original_media_url: Optional[str] = None
38
+ """The original URL to the PDF used for the fax's media.
39
+
40
+ If media_name was supplied, this is omitted
41
+ """
42
+
43
+ status: Optional[Literal["sending"]] = None
44
+ """The status of the fax."""
45
+
46
+ to: Optional[str] = None
47
+ """The phone number, in E.164 format, the fax will be sent to or SIP URI"""
48
+
49
+ user_id: Optional[str] = None
50
+ """Identifier of the user to whom the fax belongs"""
51
+
52
+
53
+ class FaxSendingStartedWebhookEvent(BaseModel):
54
+ id: Optional[str] = None
55
+ """Identifies the type of resource."""
56
+
57
+ event_type: Optional[Literal["fax.sending.started"]] = None
58
+ """The type of event being delivered."""
59
+
60
+ payload: Optional[Payload] = None
61
+
62
+ record_type: Optional[Literal["event"]] = None
63
+ """Identifies the type of the resource."""
@@ -0,0 +1,227 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from pydantic import Field as FieldInfo
8
+
9
+ from .._models import BaseModel
10
+ from .messaging_error import MessagingError
11
+
12
+ __all__ = [
13
+ "InboundMessageWebhookEvent",
14
+ "Data",
15
+ "DataPayload",
16
+ "DataPayloadCc",
17
+ "DataPayloadCost",
18
+ "DataPayloadCostBreakdown",
19
+ "DataPayloadCostBreakdownCarrierFee",
20
+ "DataPayloadCostBreakdownRate",
21
+ "DataPayloadFrom",
22
+ "DataPayloadMedia",
23
+ "DataPayloadTo",
24
+ ]
25
+
26
+
27
+ class DataPayloadCc(BaseModel):
28
+ carrier: Optional[str] = None
29
+ """The carrier of the receiver."""
30
+
31
+ line_type: Optional[Literal["Wireline", "Wireless", "VoWiFi", "VoIP", "Pre-Paid Wireless", ""]] = None
32
+ """The line-type of the receiver."""
33
+
34
+ phone_number: Optional[str] = None
35
+ """Receiving address (+E.164 formatted phone number or short code)."""
36
+
37
+ status: Optional[
38
+ Literal["queued", "sending", "sent", "delivered", "sending_failed", "delivery_failed", "delivery_unconfirmed"]
39
+ ] = None
40
+
41
+
42
+ class DataPayloadCost(BaseModel):
43
+ amount: Optional[str] = None
44
+ """The amount deducted from your account."""
45
+
46
+ currency: Optional[str] = None
47
+ """The ISO 4217 currency identifier."""
48
+
49
+
50
+ class DataPayloadCostBreakdownCarrierFee(BaseModel):
51
+ amount: Optional[str] = None
52
+ """The carrier fee amount."""
53
+
54
+ currency: Optional[str] = None
55
+ """The ISO 4217 currency identifier."""
56
+
57
+
58
+ class DataPayloadCostBreakdownRate(BaseModel):
59
+ amount: Optional[str] = None
60
+ """The rate amount applied."""
61
+
62
+ currency: Optional[str] = None
63
+ """The ISO 4217 currency identifier."""
64
+
65
+
66
+ class DataPayloadCostBreakdown(BaseModel):
67
+ carrier_fee: Optional[DataPayloadCostBreakdownCarrierFee] = None
68
+
69
+ rate: Optional[DataPayloadCostBreakdownRate] = None
70
+
71
+
72
+ class DataPayloadFrom(BaseModel):
73
+ carrier: Optional[str] = None
74
+ """The carrier of the sender."""
75
+
76
+ line_type: Optional[Literal["Wireline", "Wireless", "VoWiFi", "VoIP", "Pre-Paid Wireless", ""]] = None
77
+ """The line-type of the sender."""
78
+
79
+ phone_number: Optional[str] = None
80
+ """
81
+ Sending address (+E.164 formatted phone number, alphanumeric sender ID, or short
82
+ code).
83
+ """
84
+
85
+ status: Optional[Literal["received", "delivered"]] = None
86
+
87
+
88
+ class DataPayloadMedia(BaseModel):
89
+ content_type: Optional[str] = None
90
+ """The MIME type of the requested media."""
91
+
92
+ hash_sha256: Optional[str] = None
93
+ """The SHA256 hash of the requested media."""
94
+
95
+ size: Optional[int] = None
96
+ """The size of the requested media."""
97
+
98
+ url: Optional[str] = None
99
+ """The url of the media requested to be sent."""
100
+
101
+
102
+ class DataPayloadTo(BaseModel):
103
+ carrier: Optional[str] = None
104
+ """The carrier of the receiver."""
105
+
106
+ line_type: Optional[Literal["Wireline", "Wireless", "VoWiFi", "VoIP", "Pre-Paid Wireless", ""]] = None
107
+ """The line-type of the receiver."""
108
+
109
+ phone_number: Optional[str] = None
110
+ """Receiving address (+E.164 formatted phone number or short code)."""
111
+
112
+ status: Optional[
113
+ Literal[
114
+ "queued",
115
+ "sending",
116
+ "sent",
117
+ "delivered",
118
+ "sending_failed",
119
+ "delivery_failed",
120
+ "delivery_unconfirmed",
121
+ "webhook_delivered",
122
+ ]
123
+ ] = None
124
+
125
+
126
+ class DataPayload(BaseModel):
127
+ id: Optional[str] = None
128
+ """Identifies the type of resource."""
129
+
130
+ cc: Optional[List[DataPayloadCc]] = None
131
+
132
+ completed_at: Optional[datetime] = None
133
+ """Not used for inbound messages."""
134
+
135
+ cost: Optional[DataPayloadCost] = None
136
+
137
+ cost_breakdown: Optional[DataPayloadCostBreakdown] = None
138
+ """Detailed breakdown of the message cost components."""
139
+
140
+ direction: Optional[Literal["inbound"]] = None
141
+ """The direction of the message.
142
+
143
+ Inbound messages are sent to you whereas outbound messages are sent from you.
144
+ """
145
+
146
+ encoding: Optional[str] = None
147
+ """Encoding scheme used for the message body."""
148
+
149
+ errors: Optional[List[MessagingError]] = None
150
+ """
151
+ These errors may point at addressees when referring to unsuccessful/unconfirmed
152
+ delivery statuses.
153
+ """
154
+
155
+ from_: Optional[DataPayloadFrom] = FieldInfo(alias="from", default=None)
156
+
157
+ media: Optional[List[DataPayloadMedia]] = None
158
+
159
+ messaging_profile_id: Optional[str] = None
160
+ """Unique identifier for a messaging profile."""
161
+
162
+ parts: Optional[int] = None
163
+ """Number of parts into which the message's body must be split."""
164
+
165
+ received_at: Optional[datetime] = None
166
+ """ISO 8601 formatted date indicating when the message request was received."""
167
+
168
+ record_type: Optional[Literal["message"]] = None
169
+ """Identifies the type of the resource."""
170
+
171
+ sent_at: Optional[datetime] = None
172
+ """Not used for inbound messages."""
173
+
174
+ tags: Optional[List[str]] = None
175
+ """Tags associated with the resource."""
176
+
177
+ tcr_campaign_billable: Optional[bool] = None
178
+ """Indicates whether the TCR campaign is billable."""
179
+
180
+ tcr_campaign_id: Optional[str] = None
181
+ """The Campaign Registry (TCR) campaign ID associated with the message."""
182
+
183
+ tcr_campaign_registered: Optional[str] = None
184
+ """The registration status of the TCR campaign."""
185
+
186
+ text: Optional[str] = None
187
+ """Message body (i.e., content) as a non-empty string.
188
+
189
+ **Required for SMS**
190
+ """
191
+
192
+ to: Optional[List[DataPayloadTo]] = None
193
+
194
+ type: Optional[Literal["SMS", "MMS"]] = None
195
+ """The type of message. This value can be either 'sms' or 'mms'."""
196
+
197
+ valid_until: Optional[datetime] = None
198
+ """Not used for inbound messages."""
199
+
200
+ webhook_failover_url: Optional[str] = None
201
+ """
202
+ The failover URL where webhooks related to this message will be sent if sending
203
+ to the primary URL fails.
204
+ """
205
+
206
+ webhook_url: Optional[str] = None
207
+ """The URL where webhooks related to this message will be sent."""
208
+
209
+
210
+ class Data(BaseModel):
211
+ id: Optional[str] = None
212
+ """Identifies the type of resource."""
213
+
214
+ event_type: Optional[Literal["message.received"]] = None
215
+ """The type of event being delivered."""
216
+
217
+ occurred_at: Optional[datetime] = None
218
+ """ISO 8601 formatted date indicating when the resource was created."""
219
+
220
+ payload: Optional[DataPayload] = None
221
+
222
+ record_type: Optional[Literal["event"]] = None
223
+ """Identifies the type of the resource."""
224
+
225
+
226
+ class InboundMessageWebhookEvent(BaseModel):
227
+ data: Optional[Data] = None
@@ -0,0 +1,12 @@
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
+ from .number_block_order import NumberBlockOrder
7
+
8
+ __all__ = ["NumberOrderStatusUpdateWebhookEvent"]
9
+
10
+
11
+ class NumberOrderStatusUpdateWebhookEvent(BaseModel):
12
+ data: Optional[NumberBlockOrder] = None
@@ -0,0 +1,32 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from datetime import datetime
5
+
6
+ from .._models import BaseModel
7
+
8
+ __all__ = ["ReplacedLinkClickWebhookEvent", "Data"]
9
+
10
+
11
+ class Data(BaseModel):
12
+ message_id: Optional[str] = None
13
+ """The message ID associated with the clicked link."""
14
+
15
+ record_type: Optional[str] = None
16
+ """Identifies the type of the resource."""
17
+
18
+ time_clicked: Optional[datetime] = None
19
+ """ISO 8601 formatted date indicating when the message request was received."""
20
+
21
+ to: Optional[str] = None
22
+ """
23
+ Sending address (+E.164 formatted phone number, alphanumeric sender ID, or short
24
+ code).
25
+ """
26
+
27
+ url: Optional[str] = None
28
+ """The original link that was sent in the message."""
29
+
30
+
31
+ class ReplacedLinkClickWebhookEvent(BaseModel):
32
+ data: Optional[Data] = None
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing_extensions import Literal
4
+
5
+ from .._models import BaseModel
6
+
7
+ __all__ = ["SipHeader"]
8
+
9
+
10
+ class SipHeader(BaseModel):
11
+ name: Literal["User-to-User"]
12
+ """The name of the header to add."""
13
+
14
+ value: str
15
+ """The value of the header."""
@@ -0,0 +1,70 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from .._models import BaseModel
8
+
9
+ __all__ = ["StreamingFailedWebhookEvent", "Data", "DataPayload", "DataPayloadStreamParams"]
10
+
11
+
12
+ class DataPayloadStreamParams(BaseModel):
13
+ stream_url: Optional[str] = None
14
+ """The destination WebSocket address where the stream is going to be delivered."""
15
+
16
+ track: Optional[Literal["inbound_track", "outbound_track", "both_tracks"]] = None
17
+ """Specifies which track should be streamed."""
18
+
19
+
20
+ class DataPayload(BaseModel):
21
+ call_control_id: Optional[str] = None
22
+ """Call ID used to issue commands via Call Control API."""
23
+
24
+ call_leg_id: Optional[str] = None
25
+ """ID that is unique to the call and can be used to correlate webhook events."""
26
+
27
+ call_session_id: Optional[str] = None
28
+ """
29
+ ID that is unique to the call session and can be used to correlate webhook
30
+ events. Call session is a group of related call legs that logically belong to
31
+ the same phone call, e.g. an inbound and outbound leg of a transferred call.
32
+ """
33
+
34
+ client_state: Optional[str] = None
35
+ """State received from a command."""
36
+
37
+ connection_id: Optional[str] = None
38
+ """Call Control App ID (formerly Telnyx connection ID) used in the call."""
39
+
40
+ failure_reason: Optional[str] = None
41
+ """A short description explaning why the media streaming failed."""
42
+
43
+ stream_id: Optional[str] = None
44
+ """Identifies the streaming."""
45
+
46
+ stream_params: Optional[DataPayloadStreamParams] = None
47
+ """Streaming parameters as they were originally given to the Call Control API."""
48
+
49
+ stream_type: Optional[Literal["websocket", "dialogflow"]] = None
50
+ """The type of stream connection the stream is performing."""
51
+
52
+
53
+ class Data(BaseModel):
54
+ id: Optional[str] = None
55
+ """Identifies the type of resource."""
56
+
57
+ event_type: Optional[Literal["streaming.failed"]] = None
58
+ """The type of event being delivered."""
59
+
60
+ occurred_at: Optional[datetime] = None
61
+ """ISO 8601 datetime of when the event occurred."""
62
+
63
+ payload: Optional[DataPayload] = None
64
+
65
+ record_type: Optional[Literal["event"]] = None
66
+ """Identifies the resource."""
67
+
68
+
69
+ class StreamingFailedWebhookEvent(BaseModel):
70
+ data: Optional[Data] = None