@@ -4,8 +4,6 @@ package dm.sent.client
44
55import dm.sent.core.ClientOptions
66import dm.sent.core.getPackageVersion
7- import dm.sent.services.async.CallServiceAsync
8- import dm.sent.services.async.CallServiceAsyncImpl
97import dm.sent.services.async.ChannelServiceAsync
108import dm.sent.services.async.ChannelServiceAsyncImpl
119import dm.sent.services.async.ContactServiceAsync
@@ -24,6 +22,8 @@ import dm.sent.services.async.TemplateServiceAsync
2422import dm.sent.services.async.TemplateServiceAsyncImpl
2523import dm.sent.services.async.UserServiceAsync
2624import dm.sent.services.async.UserServiceAsyncImpl
25+ import dm.sent.services.async.VoiceServiceAsync
26+ import dm.sent.services.async.VoiceServiceAsyncImpl
2727import dm.sent.services.async.WebhookServiceAsync
2828import dm.sent.services.async.WebhookServiceAsyncImpl
2929import java.util.function.Consumer
@@ -75,7 +75,9 @@ class SentClientAsyncImpl(private val clientOptions: ClientOptions) : SentClient
7575 ConversationServiceAsyncImpl (clientOptionsWithUserAgent)
7676 }
7777
78- private val calls: CallServiceAsync by lazy { CallServiceAsyncImpl (clientOptionsWithUserAgent) }
78+ private val voice: VoiceServiceAsync by lazy {
79+ VoiceServiceAsyncImpl (clientOptionsWithUserAgent)
80+ }
7981
8082 private val channels: ChannelServiceAsync by lazy {
8183 ChannelServiceAsyncImpl (clientOptionsWithUserAgent)
@@ -188,24 +190,7 @@ class SentClientAsyncImpl(private val clientOptions: ClientOptions) : SentClient
188190 */
189191 override fun conversations (): ConversationServiceAsync = conversations
190192
191- /* *
192- * Phone calls from the numbers you hold, driven by your own callback URL.
193- *
194- * `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent asks what to
195- * do with each call on it, and `POST /v3/channels/voice/tokens` mints a short-lived token that
196- * lets a user of your app place and receive calls as that number. When a call arrives or a
197- * caller presses a key, a signed question is POSTed to the callback URL and the answer decides
198- * the call; `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
199- * before a real call reaches it, and `POST /v3/channels/voice/{number}/rotate-secret` replaces
200- * the signing secret. The call events themselves (`call.completed` and the rest) arrive through
201- * your webhooks.
202- *
203- * Every call is a record under `/v3/calls`: read it, list its recordings once one is ready,
204- * hang it up, start or stop recording, and add, mute or remove conference participants while it
205- * is live. A leg to a phone number runs for at most what your balance affords at the
206- * destination's rate.
207- */
208- override fun calls (): CallServiceAsync = calls
193+ override fun voice (): VoiceServiceAsync = voice
209194
210195 override fun channels (): ChannelServiceAsync = channels
211196
@@ -255,8 +240,8 @@ class SentClientAsyncImpl(private val clientOptions: ClientOptions) : SentClient
255240 ConversationServiceAsyncImpl .WithRawResponseImpl (clientOptions)
256241 }
257242
258- private val calls : CallServiceAsync .WithRawResponse by lazy {
259- CallServiceAsyncImpl .WithRawResponseImpl (clientOptions)
243+ private val voice : VoiceServiceAsync .WithRawResponse by lazy {
244+ VoiceServiceAsyncImpl .WithRawResponseImpl (clientOptions)
260245 }
261246
262247 private val channels: ChannelServiceAsync .WithRawResponse by lazy {
@@ -374,24 +359,7 @@ class SentClientAsyncImpl(private val clientOptions: ClientOptions) : SentClient
374359 */
375360 override fun conversations (): ConversationServiceAsync .WithRawResponse = conversations
376361
377- /* *
378- * Phone calls from the numbers you hold, driven by your own callback URL.
379- *
380- * `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent asks
381- * what to do with each call on it, and `POST /v3/channels/voice/tokens` mints a short-lived
382- * token that lets a user of your app place and receive calls as that number. When a call
383- * arrives or a caller presses a key, a signed question is POSTed to the callback URL and
384- * the answer decides the call; `POST /v3/channels/voice/{number}/test` checks the URL
385- * answers the way we need before a real call reaches it, and `POST
386- * /v3/channels/voice/{number}/rotate-secret` replaces the signing secret. The call events
387- * themselves (`call.completed` and the rest) arrive through your webhooks.
388- *
389- * Every call is a record under `/v3/calls`: read it, list its recordings once one is ready,
390- * hang it up, start or stop recording, and add, mute or remove conference participants
391- * while it is live. A leg to a phone number runs for at most what your balance affords at
392- * the destination's rate.
393- */
394- override fun calls (): CallServiceAsync .WithRawResponse = calls
362+ override fun voice (): VoiceServiceAsync .WithRawResponse = voice
395363
396364 override fun channels (): ChannelServiceAsync .WithRawResponse = channels
397365
0 commit comments