|
36 | 36 | ) |
37 | 37 |
|
38 | 38 | if TYPE_CHECKING: |
39 | | - from .resources import me, users, numbers, contacts, messages, profiles, webhooks, templates, conversations |
| 39 | + from .resources import ( |
| 40 | + me, |
| 41 | + calls, |
| 42 | + users, |
| 43 | + numbers, |
| 44 | + channels, |
| 45 | + contacts, |
| 46 | + messages, |
| 47 | + profiles, |
| 48 | + webhooks, |
| 49 | + templates, |
| 50 | + conversations, |
| 51 | + ) |
40 | 52 | from .resources.me import MeResource, AsyncMeResource |
41 | 53 | from .resources.users import UsersResource, AsyncUsersResource |
42 | 54 | from .resources.numbers import NumbersResource, AsyncNumbersResource |
43 | 55 | from .resources.contacts import ContactsResource, AsyncContactsResource |
44 | 56 | from .resources.messages import MessagesResource, AsyncMessagesResource |
45 | 57 | from .resources.webhooks import WebhooksResource, AsyncWebhooksResource |
46 | 58 | from .resources.templates import TemplatesResource, AsyncTemplatesResource |
| 59 | + from .resources.calls.calls import CallsResource, AsyncCallsResource |
47 | 60 | from .resources.conversations import ConversationsResource, AsyncConversationsResource |
| 61 | + from .resources.channels.channels import ChannelsResource, AsyncChannelsResource |
48 | 62 | from .resources.profiles.profiles import ProfilesResource, AsyncProfilesResource |
49 | 63 |
|
50 | 64 | __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Sent", "AsyncSent", "Client", "AsyncClient"] |
@@ -206,6 +220,24 @@ def conversations(self) -> ConversationsResource: |
206 | 220 |
|
207 | 221 | return ConversationsResource(self) |
208 | 222 |
|
| 223 | + @cached_property |
| 224 | + def calls(self) -> CallsResource: |
| 225 | + """Phone calls from the numbers you hold, driven by your own callback URL. |
| 226 | +
|
| 227 | + `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent asks what to do with each call on it, and `POST /v3/channels/voice/tokens` mints a short-lived token that lets a user of your app place and receive calls as that number. When a call arrives or a caller presses a key, a signed question is POSTed to the callback URL and the answer decides the call; `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need before a real call reaches it, and `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret. The call events themselves (`call.completed` and the rest) arrive through your webhooks. |
| 228 | +
|
| 229 | + Every call is a record under `/v3/calls`: read it, list its recordings once one is ready, hang it up, start or stop recording, and add, mute or remove conference participants while it is live. A leg to a phone number runs for at most what your balance affords at the destination's rate. |
| 230 | + """ |
| 231 | + from .resources.calls import CallsResource |
| 232 | + |
| 233 | + return CallsResource(self) |
| 234 | + |
| 235 | + @cached_property |
| 236 | + def channels(self) -> ChannelsResource: |
| 237 | + from .resources.channels import ChannelsResource |
| 238 | + |
| 239 | + return ChannelsResource(self) |
| 240 | + |
209 | 241 | @cached_property |
210 | 242 | def me(self) -> MeResource: |
211 | 243 | """Who the current key is. |
@@ -492,6 +524,24 @@ def conversations(self) -> AsyncConversationsResource: |
492 | 524 |
|
493 | 525 | return AsyncConversationsResource(self) |
494 | 526 |
|
| 527 | + @cached_property |
| 528 | + def calls(self) -> AsyncCallsResource: |
| 529 | + """Phone calls from the numbers you hold, driven by your own callback URL. |
| 530 | +
|
| 531 | + `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent asks what to do with each call on it, and `POST /v3/channels/voice/tokens` mints a short-lived token that lets a user of your app place and receive calls as that number. When a call arrives or a caller presses a key, a signed question is POSTed to the callback URL and the answer decides the call; `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need before a real call reaches it, and `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret. The call events themselves (`call.completed` and the rest) arrive through your webhooks. |
| 532 | +
|
| 533 | + Every call is a record under `/v3/calls`: read it, list its recordings once one is ready, hang it up, start or stop recording, and add, mute or remove conference participants while it is live. A leg to a phone number runs for at most what your balance affords at the destination's rate. |
| 534 | + """ |
| 535 | + from .resources.calls import AsyncCallsResource |
| 536 | + |
| 537 | + return AsyncCallsResource(self) |
| 538 | + |
| 539 | + @cached_property |
| 540 | + def channels(self) -> AsyncChannelsResource: |
| 541 | + from .resources.channels import AsyncChannelsResource |
| 542 | + |
| 543 | + return AsyncChannelsResource(self) |
| 544 | + |
495 | 545 | @cached_property |
496 | 546 | def me(self) -> AsyncMeResource: |
497 | 547 | """Who the current key is. |
@@ -720,6 +770,24 @@ def conversations(self) -> conversations.ConversationsResourceWithRawResponse: |
720 | 770 |
|
721 | 771 | return ConversationsResourceWithRawResponse(self._client.conversations) |
722 | 772 |
|
| 773 | + @cached_property |
| 774 | + def calls(self) -> calls.CallsResourceWithRawResponse: |
| 775 | + """Phone calls from the numbers you hold, driven by your own callback URL. |
| 776 | +
|
| 777 | + `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent asks what to do with each call on it, and `POST /v3/channels/voice/tokens` mints a short-lived token that lets a user of your app place and receive calls as that number. When a call arrives or a caller presses a key, a signed question is POSTed to the callback URL and the answer decides the call; `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need before a real call reaches it, and `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret. The call events themselves (`call.completed` and the rest) arrive through your webhooks. |
| 778 | +
|
| 779 | + Every call is a record under `/v3/calls`: read it, list its recordings once one is ready, hang it up, start or stop recording, and add, mute or remove conference participants while it is live. A leg to a phone number runs for at most what your balance affords at the destination's rate. |
| 780 | + """ |
| 781 | + from .resources.calls import CallsResourceWithRawResponse |
| 782 | + |
| 783 | + return CallsResourceWithRawResponse(self._client.calls) |
| 784 | + |
| 785 | + @cached_property |
| 786 | + def channels(self) -> channels.ChannelsResourceWithRawResponse: |
| 787 | + from .resources.channels import ChannelsResourceWithRawResponse |
| 788 | + |
| 789 | + return ChannelsResourceWithRawResponse(self._client.channels) |
| 790 | + |
723 | 791 | @cached_property |
724 | 792 | def me(self) -> me.MeResourceWithRawResponse: |
725 | 793 | """Who the current key is. |
@@ -829,6 +897,24 @@ def conversations(self) -> conversations.AsyncConversationsResourceWithRawRespon |
829 | 897 |
|
830 | 898 | return AsyncConversationsResourceWithRawResponse(self._client.conversations) |
831 | 899 |
|
| 900 | + @cached_property |
| 901 | + def calls(self) -> calls.AsyncCallsResourceWithRawResponse: |
| 902 | + """Phone calls from the numbers you hold, driven by your own callback URL. |
| 903 | +
|
| 904 | + `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent asks what to do with each call on it, and `POST /v3/channels/voice/tokens` mints a short-lived token that lets a user of your app place and receive calls as that number. When a call arrives or a caller presses a key, a signed question is POSTed to the callback URL and the answer decides the call; `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need before a real call reaches it, and `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret. The call events themselves (`call.completed` and the rest) arrive through your webhooks. |
| 905 | +
|
| 906 | + Every call is a record under `/v3/calls`: read it, list its recordings once one is ready, hang it up, start or stop recording, and add, mute or remove conference participants while it is live. A leg to a phone number runs for at most what your balance affords at the destination's rate. |
| 907 | + """ |
| 908 | + from .resources.calls import AsyncCallsResourceWithRawResponse |
| 909 | + |
| 910 | + return AsyncCallsResourceWithRawResponse(self._client.calls) |
| 911 | + |
| 912 | + @cached_property |
| 913 | + def channels(self) -> channels.AsyncChannelsResourceWithRawResponse: |
| 914 | + from .resources.channels import AsyncChannelsResourceWithRawResponse |
| 915 | + |
| 916 | + return AsyncChannelsResourceWithRawResponse(self._client.channels) |
| 917 | + |
832 | 918 | @cached_property |
833 | 919 | def me(self) -> me.AsyncMeResourceWithRawResponse: |
834 | 920 | """Who the current key is. |
@@ -938,6 +1024,24 @@ def conversations(self) -> conversations.ConversationsResourceWithStreamingRespo |
938 | 1024 |
|
939 | 1025 | return ConversationsResourceWithStreamingResponse(self._client.conversations) |
940 | 1026 |
|
| 1027 | + @cached_property |
| 1028 | + def calls(self) -> calls.CallsResourceWithStreamingResponse: |
| 1029 | + """Phone calls from the numbers you hold, driven by your own callback URL. |
| 1030 | +
|
| 1031 | + `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent asks what to do with each call on it, and `POST /v3/channels/voice/tokens` mints a short-lived token that lets a user of your app place and receive calls as that number. When a call arrives or a caller presses a key, a signed question is POSTed to the callback URL and the answer decides the call; `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need before a real call reaches it, and `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret. The call events themselves (`call.completed` and the rest) arrive through your webhooks. |
| 1032 | +
|
| 1033 | + Every call is a record under `/v3/calls`: read it, list its recordings once one is ready, hang it up, start or stop recording, and add, mute or remove conference participants while it is live. A leg to a phone number runs for at most what your balance affords at the destination's rate. |
| 1034 | + """ |
| 1035 | + from .resources.calls import CallsResourceWithStreamingResponse |
| 1036 | + |
| 1037 | + return CallsResourceWithStreamingResponse(self._client.calls) |
| 1038 | + |
| 1039 | + @cached_property |
| 1040 | + def channels(self) -> channels.ChannelsResourceWithStreamingResponse: |
| 1041 | + from .resources.channels import ChannelsResourceWithStreamingResponse |
| 1042 | + |
| 1043 | + return ChannelsResourceWithStreamingResponse(self._client.channels) |
| 1044 | + |
941 | 1045 | @cached_property |
942 | 1046 | def me(self) -> me.MeResourceWithStreamingResponse: |
943 | 1047 | """Who the current key is. |
@@ -1047,6 +1151,24 @@ def conversations(self) -> conversations.AsyncConversationsResourceWithStreaming |
1047 | 1151 |
|
1048 | 1152 | return AsyncConversationsResourceWithStreamingResponse(self._client.conversations) |
1049 | 1153 |
|
| 1154 | + @cached_property |
| 1155 | + def calls(self) -> calls.AsyncCallsResourceWithStreamingResponse: |
| 1156 | + """Phone calls from the numbers you hold, driven by your own callback URL. |
| 1157 | +
|
| 1158 | + `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent asks what to do with each call on it, and `POST /v3/channels/voice/tokens` mints a short-lived token that lets a user of your app place and receive calls as that number. When a call arrives or a caller presses a key, a signed question is POSTed to the callback URL and the answer decides the call; `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need before a real call reaches it, and `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret. The call events themselves (`call.completed` and the rest) arrive through your webhooks. |
| 1159 | +
|
| 1160 | + Every call is a record under `/v3/calls`: read it, list its recordings once one is ready, hang it up, start or stop recording, and add, mute or remove conference participants while it is live. A leg to a phone number runs for at most what your balance affords at the destination's rate. |
| 1161 | + """ |
| 1162 | + from .resources.calls import AsyncCallsResourceWithStreamingResponse |
| 1163 | + |
| 1164 | + return AsyncCallsResourceWithStreamingResponse(self._client.calls) |
| 1165 | + |
| 1166 | + @cached_property |
| 1167 | + def channels(self) -> channels.AsyncChannelsResourceWithStreamingResponse: |
| 1168 | + from .resources.channels import AsyncChannelsResourceWithStreamingResponse |
| 1169 | + |
| 1170 | + return AsyncChannelsResourceWithStreamingResponse(self._client.channels) |
| 1171 | + |
1050 | 1172 | @cached_property |
1051 | 1173 | def me(self) -> me.AsyncMeResourceWithStreamingResponse: |
1052 | 1174 | """Who the current key is. |
|
0 commit comments