sentdm 0.38.0 → 0.39.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +1 -1
- data/lib/sentdm/client.rb +3 -20
- data/lib/sentdm/models/call_event_payload.rb +4 -3
- data/lib/sentdm/models/message_send_params.rb +8 -1
- data/lib/sentdm/models/template.rb +6 -5
- data/lib/sentdm/models/template_body.rb +8 -8
- data/lib/sentdm/models/{calls/api_response_of_list_of_call_participant.rb → voice/api_response_of_call.rb} +7 -7
- data/lib/sentdm/models/voice/api_response_of_call_recordings.rb +45 -0
- data/lib/sentdm/models/voice/api_response_of_calls_list.rb +44 -0
- data/lib/sentdm/models/{channels → voice}/api_response_of_voice_token.rb +5 -5
- data/lib/sentdm/models/voice/call.rb +149 -0
- data/lib/sentdm/models/{calls/participant_remove_params.rb → voice/call_hangup_params.rb} +8 -8
- data/lib/sentdm/models/voice/call_list_params.rb +85 -0
- data/lib/sentdm/models/{calls/participant_remove_all_params.rb → voice/call_list_recordings_params.rb} +3 -3
- data/lib/sentdm/models/voice/call_party.rb +33 -0
- data/lib/sentdm/models/{calls/participant_update_params.rb → voice/call_record_params.rb} +10 -17
- data/lib/sentdm/models/voice/call_recording.rb +40 -0
- data/lib/sentdm/models/voice/call_recordings.rb +26 -0
- data/lib/sentdm/models/{calls/participant_list_params.rb → voice/call_retrieve_params.rb} +3 -3
- data/lib/sentdm/models/voice/call_timeline_entry.rb +28 -0
- data/lib/sentdm/models/voice/calls/api_response_of_list_of_call_participant.rb +51 -0
- data/lib/sentdm/models/voice/calls/call_participant.rb +62 -0
- data/lib/sentdm/models/voice/calls/call_participant_target.rb +32 -0
- data/lib/sentdm/models/voice/calls/participant_add_params.rb +68 -0
- data/lib/sentdm/models/voice/calls/participant_list_params.rb +30 -0
- data/lib/sentdm/models/voice/calls/participant_remove_all_params.rb +30 -0
- data/lib/sentdm/models/voice/calls/participant_remove_params.rb +36 -0
- data/lib/sentdm/models/voice/calls/participant_update_params.rb +66 -0
- data/lib/sentdm/models/voice/calls_list.rb +28 -0
- data/lib/sentdm/models/{channels/voice_create_token_params.rb → voice/token_create_params.rb} +4 -4
- data/lib/sentdm/models/{channels → voice}/voice_token.rb +9 -3
- data/lib/sentdm/models.rb +2 -30
- data/lib/sentdm/resources/channels/voice.rb +13 -56
- data/lib/sentdm/resources/channels.rb +2 -2
- data/lib/sentdm/resources/voice/calls/participants.rb +233 -0
- data/lib/sentdm/resources/voice/calls.rb +238 -0
- data/lib/sentdm/resources/voice/tokens.rb +75 -0
- data/lib/sentdm/resources/voice.rb +56 -0
- data/lib/sentdm/version.rb +1 -1
- data/lib/sentdm.rb +30 -28
- data/rbi/sentdm/client.rbi +2 -19
- data/rbi/sentdm/models/call_event_payload.rbi +6 -4
- data/rbi/sentdm/models/message_send_params.rbi +16 -2
- data/rbi/sentdm/models/template.rbi +12 -10
- data/rbi/sentdm/models/template_body.rbi +12 -12
- data/rbi/sentdm/models/voice/api_response_of_call.rbi +76 -0
- data/rbi/sentdm/models/voice/api_response_of_call_recordings.rbi +81 -0
- data/rbi/sentdm/models/{calls/api_response_of_list_of_call_participant.rbi → voice/api_response_of_calls_list.rbi} +12 -9
- data/rbi/sentdm/models/{channels → voice}/api_response_of_voice_token.rbi +6 -8
- data/rbi/sentdm/models/voice/call.rbi +196 -0
- data/rbi/sentdm/models/{calls/participant_remove_params.rbi → voice/call_hangup_params.rbi} +11 -11
- data/rbi/sentdm/models/voice/call_list_params.rbi +114 -0
- data/rbi/sentdm/models/{calls/participant_list_params.rbi → voice/call_list_recordings_params.rbi} +3 -3
- data/rbi/sentdm/models/voice/call_party.rbi +47 -0
- data/rbi/sentdm/models/{calls/participant_update_params.rbi → voice/call_record_params.rbi} +12 -21
- data/rbi/sentdm/models/voice/call_recording.rbi +63 -0
- data/rbi/sentdm/models/voice/call_recordings.rbi +49 -0
- data/rbi/sentdm/models/{calls/participant_remove_all_params.rbi → voice/call_retrieve_params.rbi} +3 -6
- data/rbi/sentdm/models/voice/call_timeline_entry.rbi +44 -0
- data/rbi/sentdm/models/voice/calls/api_response_of_list_of_call_participant.rbi +84 -0
- data/rbi/sentdm/models/voice/calls/call_participant.rbi +97 -0
- data/rbi/sentdm/models/voice/calls/call_participant_target.rbi +49 -0
- data/rbi/sentdm/models/voice/calls/participant_add_params.rbi +104 -0
- data/rbi/sentdm/models/voice/calls/participant_list_params.rbi +53 -0
- data/rbi/sentdm/models/voice/calls/participant_remove_all_params.rbi +53 -0
- data/rbi/sentdm/models/voice/calls/participant_remove_params.rbi +63 -0
- data/rbi/sentdm/models/voice/calls/participant_update_params.rbi +96 -0
- data/rbi/sentdm/models/voice/calls_list.rbi +54 -0
- data/rbi/sentdm/models/{channels/voice_create_token_params.rbi → voice/token_create_params.rbi} +3 -6
- data/rbi/sentdm/models/{channels → voice}/voice_token.rbi +8 -4
- data/rbi/sentdm/models.rbi +2 -30
- data/rbi/sentdm/resources/channels/voice.rbi +13 -56
- data/rbi/sentdm/resources/channels.rbi +2 -2
- data/rbi/sentdm/resources/messages.rbi +8 -1
- data/rbi/sentdm/resources/voice/calls/participants.rbi +201 -0
- data/rbi/sentdm/resources/voice/calls.rbi +209 -0
- data/rbi/sentdm/resources/voice/tokens.rbi +73 -0
- data/rbi/sentdm/resources/voice.rbi +52 -0
- data/sig/sentdm/client.rbs +1 -1
- data/sig/sentdm/models/{calls/api_response_of_list_of_call_participant.rbs → voice/api_response_of_call.rbs} +7 -7
- data/sig/sentdm/models/voice/api_response_of_call_recordings.rbs +41 -0
- data/sig/sentdm/models/voice/api_response_of_calls_list.rbs +41 -0
- data/sig/sentdm/models/{channels → voice}/api_response_of_voice_token.rbs +5 -5
- data/sig/sentdm/models/voice/call.rbs +110 -0
- data/sig/sentdm/models/{calls/participant_remove_params.rbs → voice/call_hangup_params.rbs} +8 -8
- data/sig/sentdm/models/voice/call_list_params.rbs +69 -0
- data/sig/sentdm/models/{calls/participant_remove_all_params.rbs → voice/call_list_recordings_params.rbs} +6 -8
- data/sig/sentdm/models/voice/call_party.rbs +19 -0
- data/sig/sentdm/models/{calls/participant_update_params.rbs → voice/call_record_params.rbs} +8 -13
- data/sig/sentdm/models/voice/call_recording.rbs +34 -0
- data/sig/sentdm/models/voice/call_recordings.rbs +22 -0
- data/sig/sentdm/models/{calls/participant_list_params.rbs → voice/call_retrieve_params.rbs} +3 -3
- data/sig/sentdm/models/voice/call_timeline_entry.rbs +21 -0
- data/sig/sentdm/models/voice/calls/api_response_of_list_of_call_participant.rbs +43 -0
- data/sig/sentdm/models/voice/calls/call_participant.rbs +54 -0
- data/sig/sentdm/models/voice/calls/call_participant_target.rbs +25 -0
- data/sig/sentdm/models/voice/calls/participant_add_params.rbs +65 -0
- data/sig/sentdm/models/voice/calls/participant_list_params.rbs +34 -0
- data/sig/sentdm/models/voice/calls/participant_remove_all_params.rbs +36 -0
- data/sig/sentdm/models/voice/calls/participant_remove_params.rbs +42 -0
- data/sig/sentdm/models/voice/calls/participant_update_params.rbs +63 -0
- data/sig/sentdm/models/voice/calls_list.rbs +33 -0
- data/sig/sentdm/models/{channels/voice_create_token_params.rbs → voice/token_create_params.rbs} +3 -3
- data/sig/sentdm/models/{channels → voice}/voice_token.rbs +3 -1
- data/sig/sentdm/models.rbs +2 -30
- data/sig/sentdm/resources/channels/voice.rbs +0 -10
- data/sig/sentdm/resources/voice/calls/participants.rbs +52 -0
- data/sig/sentdm/resources/{calls/participants.rbs → voice/calls.rbs} +23 -21
- data/sig/sentdm/resources/voice/tokens.rbs +19 -0
- data/sig/sentdm/resources/voice.rbs +11 -0
- metadata +89 -83
- data/lib/sentdm/models/api_response_of_call.rb +0 -43
- data/lib/sentdm/models/api_response_of_call_recordings.rb +0 -43
- data/lib/sentdm/models/api_response_of_calls_list.rb +0 -42
- data/lib/sentdm/models/call.rb +0 -134
- data/lib/sentdm/models/call_hangup_params.rb +0 -32
- data/lib/sentdm/models/call_list_params.rb +0 -83
- data/lib/sentdm/models/call_list_recordings_params.rb +0 -26
- data/lib/sentdm/models/call_party.rb +0 -31
- data/lib/sentdm/models/call_record_params.rb +0 -55
- data/lib/sentdm/models/call_recording.rb +0 -38
- data/lib/sentdm/models/call_recordings.rb +0 -24
- data/lib/sentdm/models/call_retrieve_params.rb +0 -26
- data/lib/sentdm/models/call_timeline_entry.rb +0 -26
- data/lib/sentdm/models/calls/call_participant.rb +0 -60
- data/lib/sentdm/models/calls/call_participant_target.rb +0 -30
- data/lib/sentdm/models/calls/participant_add_params.rb +0 -66
- data/lib/sentdm/models/calls_list.rb +0 -26
- data/lib/sentdm/resources/calls/participants.rb +0 -231
- data/lib/sentdm/resources/calls.rb +0 -236
- data/rbi/sentdm/models/api_response_of_call.rbi +0 -74
- data/rbi/sentdm/models/api_response_of_call_recordings.rbi +0 -74
- data/rbi/sentdm/models/api_response_of_calls_list.rbi +0 -74
- data/rbi/sentdm/models/call.rbi +0 -179
- data/rbi/sentdm/models/call_hangup_params.rbi +0 -59
- data/rbi/sentdm/models/call_list_params.rbi +0 -112
- data/rbi/sentdm/models/call_list_recordings_params.rbi +0 -46
- data/rbi/sentdm/models/call_party.rbi +0 -41
- data/rbi/sentdm/models/call_record_params.rbi +0 -83
- data/rbi/sentdm/models/call_recording.rbi +0 -59
- data/rbi/sentdm/models/call_recordings.rbi +0 -39
- data/rbi/sentdm/models/call_retrieve_params.rbi +0 -46
- data/rbi/sentdm/models/call_timeline_entry.rbi +0 -40
- data/rbi/sentdm/models/calls/call_participant.rbi +0 -92
- data/rbi/sentdm/models/calls/call_participant_target.rbi +0 -47
- data/rbi/sentdm/models/calls/participant_add_params.rbi +0 -98
- data/rbi/sentdm/models/calls_list.rbi +0 -47
- data/rbi/sentdm/resources/calls/participants.rbi +0 -199
- data/rbi/sentdm/resources/calls.rbi +0 -207
- data/sig/sentdm/models/api_response_of_call.rbs +0 -39
- data/sig/sentdm/models/api_response_of_call_recordings.rbs +0 -39
- data/sig/sentdm/models/api_response_of_calls_list.rbs +0 -39
- data/sig/sentdm/models/call.rbs +0 -101
- data/sig/sentdm/models/call_hangup_params.rbs +0 -38
- data/sig/sentdm/models/call_list_params.rbs +0 -67
- data/sig/sentdm/models/call_list_recordings_params.rbs +0 -30
- data/sig/sentdm/models/call_party.rbs +0 -17
- data/sig/sentdm/models/call_record_params.rbs +0 -54
- data/sig/sentdm/models/call_recording.rbs +0 -32
- data/sig/sentdm/models/call_recordings.rbs +0 -17
- data/sig/sentdm/models/call_retrieve_params.rbs +0 -30
- data/sig/sentdm/models/call_timeline_entry.rbs +0 -19
- data/sig/sentdm/models/calls/call_participant.rbs +0 -52
- data/sig/sentdm/models/calls/call_participant_target.rbs +0 -23
- data/sig/sentdm/models/calls/participant_add_params.rbs +0 -63
- data/sig/sentdm/models/calls_list.rbs +0 -26
- data/sig/sentdm/resources/calls.rbs +0 -50
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Resources
|
|
5
|
+
class Voice
|
|
6
|
+
# Phone calls from the numbers you hold, driven by your own callback URL.
|
|
7
|
+
#
|
|
8
|
+
# `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
|
|
9
|
+
# asks what to do with each call on it, and `POST /v3/voice/tokens` mints a
|
|
10
|
+
# short-lived token that lets a user of your app place and receive calls as that
|
|
11
|
+
# number. When a call arrives or a caller presses a key, a signed question is
|
|
12
|
+
# POSTed to the callback URL and the answer decides the call;
|
|
13
|
+
# `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
|
|
14
|
+
# before a real call reaches it, and
|
|
15
|
+
# `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
|
|
16
|
+
# The call events themselves (`call.completed` and the rest) arrive through your
|
|
17
|
+
# webhooks.
|
|
18
|
+
#
|
|
19
|
+
# Every call is a record under `/v3/voice/calls`: read it, list its recordings
|
|
20
|
+
# once one is ready, hang it up, start or stop recording, and add, mute or remove
|
|
21
|
+
# conference participants while it is live. A leg to a phone number runs for at
|
|
22
|
+
# most what your balance affords at the destination's rate.
|
|
23
|
+
class Calls
|
|
24
|
+
# Phone calls from the numbers you hold, driven by your own callback URL.
|
|
25
|
+
#
|
|
26
|
+
# `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
|
|
27
|
+
# asks what to do with each call on it, and `POST /v3/voice/tokens` mints a
|
|
28
|
+
# short-lived token that lets a user of your app place and receive calls as that
|
|
29
|
+
# number. When a call arrives or a caller presses a key, a signed question is
|
|
30
|
+
# POSTed to the callback URL and the answer decides the call;
|
|
31
|
+
# `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
|
|
32
|
+
# before a real call reaches it, and
|
|
33
|
+
# `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
|
|
34
|
+
# The call events themselves (`call.completed` and the rest) arrive through your
|
|
35
|
+
# webhooks.
|
|
36
|
+
#
|
|
37
|
+
# Every call is a record under `/v3/voice/calls`: read it, list its recordings
|
|
38
|
+
# once one is ready, hang it up, start or stop recording, and add, mute or remove
|
|
39
|
+
# conference participants while it is live. A leg to a phone number runs for at
|
|
40
|
+
# most what your balance affords at the destination's rate.
|
|
41
|
+
sig { returns(Sentdm::Resources::Voice::Calls::Participants) }
|
|
42
|
+
attr_reader :participants
|
|
43
|
+
|
|
44
|
+
# Retrieves one of your calls by id: the parties, the owning number, the current
|
|
45
|
+
# status with its failure reason, duration, price, recording availability, and a
|
|
46
|
+
# timeline of when the call entered each status.
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
id: String,
|
|
50
|
+
x_profile_id: String,
|
|
51
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
52
|
+
).returns(Sentdm::Voice::APIResponseOfCall)
|
|
53
|
+
end
|
|
54
|
+
def retrieve(
|
|
55
|
+
# The call id from the route, as carried by call webhooks and the calls list, for
|
|
56
|
+
# example call_9f2ab000-0000-4000-8000-000000000001
|
|
57
|
+
id,
|
|
58
|
+
# Profile UUID to scope the request to a child profile. Only organization API keys
|
|
59
|
+
# can use this header. The profile must belong to the calling organization.
|
|
60
|
+
x_profile_id: nil,
|
|
61
|
+
request_options: {}
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Retrieves a paginated list of your calls, most recent first. Filter by
|
|
66
|
+
# direction, status, the owning number, and the time the call started (from and to
|
|
67
|
+
# are inclusive). Use the call webhooks for real-time updates; this list is for
|
|
68
|
+
# looking calls up afterwards.
|
|
69
|
+
sig do
|
|
70
|
+
params(
|
|
71
|
+
direction: T.nilable(String),
|
|
72
|
+
from: T.nilable(Time),
|
|
73
|
+
number: T.nilable(String),
|
|
74
|
+
page: Integer,
|
|
75
|
+
page_size: Integer,
|
|
76
|
+
status: T.nilable(String),
|
|
77
|
+
to: T.nilable(Time),
|
|
78
|
+
x_profile_id: String,
|
|
79
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
80
|
+
).returns(Sentdm::Internal::CallsPage[Sentdm::Voice::Call])
|
|
81
|
+
end
|
|
82
|
+
def list(
|
|
83
|
+
# Query param: Optional direction filter: outbound for calls placed from your app,
|
|
84
|
+
# inbound for calls to one of your numbers
|
|
85
|
+
direction: nil,
|
|
86
|
+
# Query param: Only calls started at or after this time (ISO 8601)
|
|
87
|
+
from: nil,
|
|
88
|
+
# Query param: Optional filter on the number that owns the call, one of your
|
|
89
|
+
# voice-enabled numbers in E.164 format
|
|
90
|
+
number: nil,
|
|
91
|
+
# Query param: Page number (1-indexed)
|
|
92
|
+
page: nil,
|
|
93
|
+
# Query param: Number of items per page
|
|
94
|
+
page_size: nil,
|
|
95
|
+
# Query param: Optional status filter: initiated, ringing, answered, completed,
|
|
96
|
+
# failed, no_answer or rejected
|
|
97
|
+
status: nil,
|
|
98
|
+
# Query param: Only calls started at or before this time (ISO 8601)
|
|
99
|
+
to: nil,
|
|
100
|
+
# Header param: Profile UUID to scope the request to a child profile. Only
|
|
101
|
+
# organization API keys can use this header. The profile must belong to the
|
|
102
|
+
# calling organization.
|
|
103
|
+
x_profile_id: nil,
|
|
104
|
+
request_options: {}
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Ends one of your live calls. The call then ends the way any other call does once
|
|
109
|
+
# the disconnect is reported: an answered call as COMPLETED with call.completed, a
|
|
110
|
+
# call still ringing as NO_ANSWER, REJECTED or FAILED with call.failed. A call
|
|
111
|
+
# that has already ended answers 409, and so does a call with no phone leg, such
|
|
112
|
+
# as one between two app users.
|
|
113
|
+
sig do
|
|
114
|
+
params(
|
|
115
|
+
id: String,
|
|
116
|
+
sandbox: T::Boolean,
|
|
117
|
+
idempotency_key: String,
|
|
118
|
+
x_profile_id: String,
|
|
119
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
120
|
+
).void
|
|
121
|
+
end
|
|
122
|
+
def hangup(
|
|
123
|
+
# Path param: The call id from the route, as carried by call webhooks and the
|
|
124
|
+
# calls list, for example call_9f2ab000-0000-4000-8000-000000000001
|
|
125
|
+
id,
|
|
126
|
+
# Body param: Sandbox flag - when true, the operation is simulated without side
|
|
127
|
+
# effects Useful for testing integrations without actual execution
|
|
128
|
+
sandbox: nil,
|
|
129
|
+
# Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
130
|
+
# alphanumeric characters, hyphens, or underscores. Responses are cached for 24
|
|
131
|
+
# hours per key per customer.
|
|
132
|
+
idempotency_key: nil,
|
|
133
|
+
# Header param: Profile UUID to scope the request to a child profile. Only
|
|
134
|
+
# organization API keys can use this header. The profile must belong to the
|
|
135
|
+
# calling organization.
|
|
136
|
+
x_profile_id: nil,
|
|
137
|
+
request_options: {}
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Returns pre-signed links to the recordings of one of your calls, each valid
|
|
142
|
+
# until its url_expires_at. A recording appears once the call was recorded, by a
|
|
143
|
+
# connect answer with record set, a startRecording instruction or the recordings
|
|
144
|
+
# command, and the call.recording_ready webhook has been sent; until then, and for
|
|
145
|
+
# a call that was never recorded, the list is empty. A call recorded more than
|
|
146
|
+
# once lists every recording, oldest first, each under the recording_id its
|
|
147
|
+
# call.recording_ready webhook carried.
|
|
148
|
+
sig do
|
|
149
|
+
params(
|
|
150
|
+
id: String,
|
|
151
|
+
x_profile_id: String,
|
|
152
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
153
|
+
).returns(Sentdm::Voice::APIResponseOfCallRecordings)
|
|
154
|
+
end
|
|
155
|
+
def list_recordings(
|
|
156
|
+
# The call id from the route, as carried by call webhooks and the calls list, for
|
|
157
|
+
# example call_9f2ab000-0000-4000-8000-000000000001
|
|
158
|
+
id,
|
|
159
|
+
# Profile UUID to scope the request to a child profile. Only organization API keys
|
|
160
|
+
# can use this header. The profile must belong to the calling organization.
|
|
161
|
+
x_profile_id: nil,
|
|
162
|
+
request_options: {}
|
|
163
|
+
)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Starts or stops recording one of your live calls. Use start to begin recording
|
|
167
|
+
# mid-call, or stop to end a recording, whether it was started here or by a
|
|
168
|
+
# connect answer with record set. A call that has already ended answers 409, and
|
|
169
|
+
# so does a call with no phone leg, such as one between two app users, which can't
|
|
170
|
+
# be recorded.
|
|
171
|
+
sig do
|
|
172
|
+
params(
|
|
173
|
+
id: String,
|
|
174
|
+
action: String,
|
|
175
|
+
sandbox: T::Boolean,
|
|
176
|
+
idempotency_key: String,
|
|
177
|
+
x_profile_id: String,
|
|
178
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
179
|
+
).void
|
|
180
|
+
end
|
|
181
|
+
def record(
|
|
182
|
+
# Path param: The call id from the route, as carried by call webhooks and the
|
|
183
|
+
# calls list, for example call_9f2ab000-0000-4000-8000-000000000001
|
|
184
|
+
id,
|
|
185
|
+
# Body param: start to begin recording, stop to end it
|
|
186
|
+
action: nil,
|
|
187
|
+
# Body param: Sandbox flag - when true, the operation is simulated without side
|
|
188
|
+
# effects Useful for testing integrations without actual execution
|
|
189
|
+
sandbox: nil,
|
|
190
|
+
# Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
191
|
+
# alphanumeric characters, hyphens, or underscores. Responses are cached for 24
|
|
192
|
+
# hours per key per customer.
|
|
193
|
+
idempotency_key: nil,
|
|
194
|
+
# Header param: Profile UUID to scope the request to a child profile. Only
|
|
195
|
+
# organization API keys can use this header. The profile must belong to the
|
|
196
|
+
# calling organization.
|
|
197
|
+
x_profile_id: nil,
|
|
198
|
+
request_options: {}
|
|
199
|
+
)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# @api private
|
|
203
|
+
sig { params(client: Sentdm::Client).returns(T.attached_class) }
|
|
204
|
+
def self.new(client:)
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Resources
|
|
5
|
+
class Voice
|
|
6
|
+
# Phone calls from the numbers you hold, driven by your own callback URL.
|
|
7
|
+
#
|
|
8
|
+
# `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
|
|
9
|
+
# asks what to do with each call on it, and `POST /v3/voice/tokens` mints a
|
|
10
|
+
# short-lived token that lets a user of your app place and receive calls as that
|
|
11
|
+
# number. When a call arrives or a caller presses a key, a signed question is
|
|
12
|
+
# POSTed to the callback URL and the answer decides the call;
|
|
13
|
+
# `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
|
|
14
|
+
# before a real call reaches it, and
|
|
15
|
+
# `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
|
|
16
|
+
# The call events themselves (`call.completed` and the rest) arrive through your
|
|
17
|
+
# webhooks.
|
|
18
|
+
#
|
|
19
|
+
# Every call is a record under `/v3/voice/calls`: read it, list its recordings
|
|
20
|
+
# once one is ready, hang it up, start or stop recording, and add, mute or remove
|
|
21
|
+
# conference participants while it is live. A leg to a phone number runs for at
|
|
22
|
+
# most what your balance affords at the destination's rate.
|
|
23
|
+
class Tokens
|
|
24
|
+
# Mints a short-lived token for one of your app users. Call this from your backend
|
|
25
|
+
# and return the token to your app, which passes it to the voice client SDK to
|
|
26
|
+
# register. The identity is bound to the given number, or to your default app-call
|
|
27
|
+
# number when omitted, and calls placed by that identity are routed through the
|
|
28
|
+
# bound number. Minting again re-binds the identity, so an identity can move
|
|
29
|
+
# between numbers.
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
identity: String,
|
|
33
|
+
number: T.nilable(String),
|
|
34
|
+
sandbox: T::Boolean,
|
|
35
|
+
ttl: T.nilable(Integer),
|
|
36
|
+
idempotency_key: String,
|
|
37
|
+
x_profile_id: String,
|
|
38
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
39
|
+
).returns(Sentdm::Voice::APIResponseOfVoiceToken)
|
|
40
|
+
end
|
|
41
|
+
def create(
|
|
42
|
+
# Body param: Your identifier for the app user, such as an agent or account id.
|
|
43
|
+
# Letters, digits, hyphens and underscores only, up to 200 characters.
|
|
44
|
+
identity: nil,
|
|
45
|
+
# Body param: One of your voice-enabled phone numbers in E.164 format. Calls
|
|
46
|
+
# placed by this identity are routed through that number. Omit to use your default
|
|
47
|
+
# app-call number.
|
|
48
|
+
number: nil,
|
|
49
|
+
# Body param: Sandbox flag - when true, the operation is simulated without side
|
|
50
|
+
# effects Useful for testing integrations without actual execution
|
|
51
|
+
sandbox: nil,
|
|
52
|
+
# Body param: Token lifetime in seconds. Defaults to 600 and cannot exceed 3600.
|
|
53
|
+
ttl: nil,
|
|
54
|
+
# Header param: Unique key to ensure idempotent request processing. Must be 1-255
|
|
55
|
+
# alphanumeric characters, hyphens, or underscores. Responses are cached for 24
|
|
56
|
+
# hours per key per customer.
|
|
57
|
+
idempotency_key: nil,
|
|
58
|
+
# Header param: Profile UUID to scope the request to a child profile. Only
|
|
59
|
+
# organization API keys can use this header. The profile must belong to the
|
|
60
|
+
# calling organization.
|
|
61
|
+
x_profile_id: nil,
|
|
62
|
+
request_options: {}
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# @api private
|
|
67
|
+
sig { params(client: Sentdm::Client).returns(T.attached_class) }
|
|
68
|
+
def self.new(client:)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Resources
|
|
5
|
+
class Voice
|
|
6
|
+
# Phone calls from the numbers you hold, driven by your own callback URL.
|
|
7
|
+
#
|
|
8
|
+
# `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
|
|
9
|
+
# asks what to do with each call on it, and `POST /v3/voice/tokens` mints a
|
|
10
|
+
# short-lived token that lets a user of your app place and receive calls as that
|
|
11
|
+
# number. When a call arrives or a caller presses a key, a signed question is
|
|
12
|
+
# POSTed to the callback URL and the answer decides the call;
|
|
13
|
+
# `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
|
|
14
|
+
# before a real call reaches it, and
|
|
15
|
+
# `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
|
|
16
|
+
# The call events themselves (`call.completed` and the rest) arrive through your
|
|
17
|
+
# webhooks.
|
|
18
|
+
#
|
|
19
|
+
# Every call is a record under `/v3/voice/calls`: read it, list its recordings
|
|
20
|
+
# once one is ready, hang it up, start or stop recording, and add, mute or remove
|
|
21
|
+
# conference participants while it is live. A leg to a phone number runs for at
|
|
22
|
+
# most what your balance affords at the destination's rate.
|
|
23
|
+
sig { returns(Sentdm::Resources::Voice::Calls) }
|
|
24
|
+
attr_reader :calls
|
|
25
|
+
|
|
26
|
+
# Phone calls from the numbers you hold, driven by your own callback URL.
|
|
27
|
+
#
|
|
28
|
+
# `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
|
|
29
|
+
# asks what to do with each call on it, and `POST /v3/voice/tokens` mints a
|
|
30
|
+
# short-lived token that lets a user of your app place and receive calls as that
|
|
31
|
+
# number. When a call arrives or a caller presses a key, a signed question is
|
|
32
|
+
# POSTed to the callback URL and the answer decides the call;
|
|
33
|
+
# `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
|
|
34
|
+
# before a real call reaches it, and
|
|
35
|
+
# `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
|
|
36
|
+
# The call events themselves (`call.completed` and the rest) arrive through your
|
|
37
|
+
# webhooks.
|
|
38
|
+
#
|
|
39
|
+
# Every call is a record under `/v3/voice/calls`: read it, list its recordings
|
|
40
|
+
# once one is ready, hang it up, start or stop recording, and add, mute or remove
|
|
41
|
+
# conference participants while it is live. A leg to a phone number runs for at
|
|
42
|
+
# most what your balance affords at the destination's rate.
|
|
43
|
+
sig { returns(Sentdm::Resources::Voice::Tokens) }
|
|
44
|
+
attr_reader :tokens
|
|
45
|
+
|
|
46
|
+
# @api private
|
|
47
|
+
sig { params(client: Sentdm::Client).returns(T.attached_class) }
|
|
48
|
+
def self.new(client:)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
data/sig/sentdm/client.rbs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module Sentdm
|
|
2
2
|
module Models
|
|
3
|
-
module
|
|
4
|
-
type
|
|
3
|
+
module Voice
|
|
4
|
+
type api_response_of_call =
|
|
5
5
|
{
|
|
6
|
-
data:
|
|
6
|
+
data: Sentdm::Voice::Call?,
|
|
7
7
|
error: Sentdm::ErrorDetail?,
|
|
8
8
|
meta: Sentdm::APIMeta,
|
|
9
9
|
success: bool
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
class
|
|
13
|
-
attr_accessor data:
|
|
12
|
+
class APIResponseOfCall < Sentdm::Internal::Type::BaseModel
|
|
13
|
+
attr_accessor data: Sentdm::Voice::Call?
|
|
14
14
|
|
|
15
15
|
attr_accessor error: Sentdm::ErrorDetail?
|
|
16
16
|
|
|
@@ -23,14 +23,14 @@ module Sentdm
|
|
|
23
23
|
def success=: (bool) -> bool
|
|
24
24
|
|
|
25
25
|
def initialize: (
|
|
26
|
-
?data:
|
|
26
|
+
?data: Sentdm::Voice::Call?,
|
|
27
27
|
?error: Sentdm::ErrorDetail?,
|
|
28
28
|
?meta: Sentdm::APIMeta,
|
|
29
29
|
?success: bool
|
|
30
30
|
) -> void
|
|
31
31
|
|
|
32
32
|
def to_hash: -> {
|
|
33
|
-
data:
|
|
33
|
+
data: Sentdm::Voice::Call?,
|
|
34
34
|
error: Sentdm::ErrorDetail?,
|
|
35
35
|
meta: Sentdm::APIMeta,
|
|
36
36
|
success: bool
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module Sentdm
|
|
2
|
+
module Models
|
|
3
|
+
module Voice
|
|
4
|
+
type api_response_of_call_recordings =
|
|
5
|
+
{
|
|
6
|
+
data: Sentdm::Voice::CallRecordings?,
|
|
7
|
+
error: Sentdm::ErrorDetail?,
|
|
8
|
+
meta: Sentdm::APIMeta,
|
|
9
|
+
success: bool
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class APIResponseOfCallRecordings < Sentdm::Internal::Type::BaseModel
|
|
13
|
+
attr_accessor data: Sentdm::Voice::CallRecordings?
|
|
14
|
+
|
|
15
|
+
attr_accessor error: Sentdm::ErrorDetail?
|
|
16
|
+
|
|
17
|
+
attr_reader meta: Sentdm::APIMeta?
|
|
18
|
+
|
|
19
|
+
def meta=: (Sentdm::APIMeta) -> Sentdm::APIMeta
|
|
20
|
+
|
|
21
|
+
attr_reader success: bool?
|
|
22
|
+
|
|
23
|
+
def success=: (bool) -> bool
|
|
24
|
+
|
|
25
|
+
def initialize: (
|
|
26
|
+
?data: Sentdm::Voice::CallRecordings?,
|
|
27
|
+
?error: Sentdm::ErrorDetail?,
|
|
28
|
+
?meta: Sentdm::APIMeta,
|
|
29
|
+
?success: bool
|
|
30
|
+
) -> void
|
|
31
|
+
|
|
32
|
+
def to_hash: -> {
|
|
33
|
+
data: Sentdm::Voice::CallRecordings?,
|
|
34
|
+
error: Sentdm::ErrorDetail?,
|
|
35
|
+
meta: Sentdm::APIMeta,
|
|
36
|
+
success: bool
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module Sentdm
|
|
2
|
+
module Models
|
|
3
|
+
module Voice
|
|
4
|
+
type api_response_of_calls_list =
|
|
5
|
+
{
|
|
6
|
+
data: Sentdm::Voice::CallsList?,
|
|
7
|
+
error: Sentdm::ErrorDetail?,
|
|
8
|
+
meta: Sentdm::APIMeta,
|
|
9
|
+
success: bool
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class APIResponseOfCallsList < Sentdm::Internal::Type::BaseModel
|
|
13
|
+
attr_accessor data: Sentdm::Voice::CallsList?
|
|
14
|
+
|
|
15
|
+
attr_accessor error: Sentdm::ErrorDetail?
|
|
16
|
+
|
|
17
|
+
attr_reader meta: Sentdm::APIMeta?
|
|
18
|
+
|
|
19
|
+
def meta=: (Sentdm::APIMeta) -> Sentdm::APIMeta
|
|
20
|
+
|
|
21
|
+
attr_reader success: bool?
|
|
22
|
+
|
|
23
|
+
def success=: (bool) -> bool
|
|
24
|
+
|
|
25
|
+
def initialize: (
|
|
26
|
+
?data: Sentdm::Voice::CallsList?,
|
|
27
|
+
?error: Sentdm::ErrorDetail?,
|
|
28
|
+
?meta: Sentdm::APIMeta,
|
|
29
|
+
?success: bool
|
|
30
|
+
) -> void
|
|
31
|
+
|
|
32
|
+
def to_hash: -> {
|
|
33
|
+
data: Sentdm::Voice::CallsList?,
|
|
34
|
+
error: Sentdm::ErrorDetail?,
|
|
35
|
+
meta: Sentdm::APIMeta,
|
|
36
|
+
success: bool
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module Sentdm
|
|
2
2
|
module Models
|
|
3
|
-
module
|
|
3
|
+
module Voice
|
|
4
4
|
type api_response_of_voice_token =
|
|
5
5
|
{
|
|
6
|
-
data: Sentdm::
|
|
6
|
+
data: Sentdm::Voice::VoiceToken?,
|
|
7
7
|
error: Sentdm::ErrorDetail?,
|
|
8
8
|
meta: Sentdm::APIMeta,
|
|
9
9
|
success: bool
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
class APIResponseOfVoiceToken < Sentdm::Internal::Type::BaseModel
|
|
13
|
-
attr_accessor data: Sentdm::
|
|
13
|
+
attr_accessor data: Sentdm::Voice::VoiceToken?
|
|
14
14
|
|
|
15
15
|
attr_accessor error: Sentdm::ErrorDetail?
|
|
16
16
|
|
|
@@ -23,14 +23,14 @@ module Sentdm
|
|
|
23
23
|
def success=: (bool) -> bool
|
|
24
24
|
|
|
25
25
|
def initialize: (
|
|
26
|
-
?data: Sentdm::
|
|
26
|
+
?data: Sentdm::Voice::VoiceToken?,
|
|
27
27
|
?error: Sentdm::ErrorDetail?,
|
|
28
28
|
?meta: Sentdm::APIMeta,
|
|
29
29
|
?success: bool
|
|
30
30
|
) -> void
|
|
31
31
|
|
|
32
32
|
def to_hash: -> {
|
|
33
|
-
data: Sentdm::
|
|
33
|
+
data: Sentdm::Voice::VoiceToken?,
|
|
34
34
|
error: Sentdm::ErrorDetail?,
|
|
35
35
|
meta: Sentdm::APIMeta,
|
|
36
36
|
success: bool
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
module Sentdm
|
|
2
|
+
module Models
|
|
3
|
+
module Voice
|
|
4
|
+
type call =
|
|
5
|
+
{
|
|
6
|
+
id: String,
|
|
7
|
+
answered_at: Time?,
|
|
8
|
+
direction: String,
|
|
9
|
+
duration_seconds: Integer?,
|
|
10
|
+
ended_at: Time?,
|
|
11
|
+
failure_reason: String?,
|
|
12
|
+
from: Sentdm::Voice::CallParty,
|
|
13
|
+
mode: String,
|
|
14
|
+
number: String,
|
|
15
|
+
price: Float?,
|
|
16
|
+
recording_available: bool,
|
|
17
|
+
started_at: Time,
|
|
18
|
+
status: String,
|
|
19
|
+
timeline: ::Array[Sentdm::Voice::CallTimelineEntry]?,
|
|
20
|
+
to: Sentdm::Voice::CallParty
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class Call < Sentdm::Internal::Type::BaseModel
|
|
24
|
+
attr_reader id: String?
|
|
25
|
+
|
|
26
|
+
def id=: (String) -> String
|
|
27
|
+
|
|
28
|
+
attr_accessor answered_at: Time?
|
|
29
|
+
|
|
30
|
+
attr_reader direction: String?
|
|
31
|
+
|
|
32
|
+
def direction=: (String) -> String
|
|
33
|
+
|
|
34
|
+
attr_accessor duration_seconds: Integer?
|
|
35
|
+
|
|
36
|
+
attr_accessor ended_at: Time?
|
|
37
|
+
|
|
38
|
+
attr_accessor failure_reason: String?
|
|
39
|
+
|
|
40
|
+
attr_reader from: Sentdm::Voice::CallParty?
|
|
41
|
+
|
|
42
|
+
def from=: (Sentdm::Voice::CallParty) -> Sentdm::Voice::CallParty
|
|
43
|
+
|
|
44
|
+
attr_reader mode: String?
|
|
45
|
+
|
|
46
|
+
def mode=: (String) -> String
|
|
47
|
+
|
|
48
|
+
attr_reader number: String?
|
|
49
|
+
|
|
50
|
+
def number=: (String) -> String
|
|
51
|
+
|
|
52
|
+
attr_accessor price: Float?
|
|
53
|
+
|
|
54
|
+
attr_reader recording_available: bool?
|
|
55
|
+
|
|
56
|
+
def recording_available=: (bool) -> bool
|
|
57
|
+
|
|
58
|
+
attr_reader started_at: Time?
|
|
59
|
+
|
|
60
|
+
def started_at=: (Time) -> Time
|
|
61
|
+
|
|
62
|
+
attr_reader status: String?
|
|
63
|
+
|
|
64
|
+
def status=: (String) -> String
|
|
65
|
+
|
|
66
|
+
attr_accessor timeline: ::Array[Sentdm::Voice::CallTimelineEntry]?
|
|
67
|
+
|
|
68
|
+
attr_reader to: Sentdm::Voice::CallParty?
|
|
69
|
+
|
|
70
|
+
def to=: (Sentdm::Voice::CallParty) -> Sentdm::Voice::CallParty
|
|
71
|
+
|
|
72
|
+
def initialize: (
|
|
73
|
+
?id: String,
|
|
74
|
+
?answered_at: Time?,
|
|
75
|
+
?direction: String,
|
|
76
|
+
?duration_seconds: Integer?,
|
|
77
|
+
?ended_at: Time?,
|
|
78
|
+
?failure_reason: String?,
|
|
79
|
+
?from: Sentdm::Voice::CallParty,
|
|
80
|
+
?mode: String,
|
|
81
|
+
?number: String,
|
|
82
|
+
?price: Float?,
|
|
83
|
+
?recording_available: bool,
|
|
84
|
+
?started_at: Time,
|
|
85
|
+
?status: String,
|
|
86
|
+
?timeline: ::Array[Sentdm::Voice::CallTimelineEntry]?,
|
|
87
|
+
?to: Sentdm::Voice::CallParty
|
|
88
|
+
) -> void
|
|
89
|
+
|
|
90
|
+
def to_hash: -> {
|
|
91
|
+
id: String,
|
|
92
|
+
answered_at: Time?,
|
|
93
|
+
direction: String,
|
|
94
|
+
duration_seconds: Integer?,
|
|
95
|
+
ended_at: Time?,
|
|
96
|
+
failure_reason: String?,
|
|
97
|
+
from: Sentdm::Voice::CallParty,
|
|
98
|
+
mode: String,
|
|
99
|
+
number: String,
|
|
100
|
+
price: Float?,
|
|
101
|
+
recording_available: bool,
|
|
102
|
+
started_at: Time,
|
|
103
|
+
status: String,
|
|
104
|
+
timeline: ::Array[Sentdm::Voice::CallTimelineEntry]?,
|
|
105
|
+
to: Sentdm::Voice::CallParty
|
|
106
|
+
}
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
module Sentdm
|
|
2
2
|
module Models
|
|
3
|
-
module
|
|
4
|
-
type
|
|
5
|
-
{ id: String,
|
|
3
|
+
module Voice
|
|
4
|
+
type call_hangup_params =
|
|
5
|
+
{ id: String, idempotency_key: String, x_profile_id: String }
|
|
6
6
|
& Sentdm::Internal::Type::request_parameters
|
|
7
7
|
|
|
8
|
-
class
|
|
8
|
+
class CallHangupParams < Sentdm::Models::MutationRequest
|
|
9
9
|
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
10
10
|
include Sentdm::Internal::Type::RequestParameters
|
|
11
11
|
|
|
@@ -13,9 +13,9 @@ module Sentdm
|
|
|
13
13
|
|
|
14
14
|
def id=: (String _) -> String
|
|
15
15
|
|
|
16
|
-
def
|
|
16
|
+
def idempotency_key: -> String?
|
|
17
17
|
|
|
18
|
-
def
|
|
18
|
+
def idempotency_key=: (String _) -> String
|
|
19
19
|
|
|
20
20
|
def x_profile_id: -> String?
|
|
21
21
|
|
|
@@ -23,14 +23,14 @@ module Sentdm
|
|
|
23
23
|
|
|
24
24
|
def initialize: (
|
|
25
25
|
id: String,
|
|
26
|
-
|
|
26
|
+
?idempotency_key: String,
|
|
27
27
|
?x_profile_id: String,
|
|
28
28
|
?request_options: Sentdm::request_opts
|
|
29
29
|
) -> void
|
|
30
30
|
|
|
31
31
|
def to_hash: -> {
|
|
32
32
|
id: String,
|
|
33
|
-
|
|
33
|
+
idempotency_key: String,
|
|
34
34
|
x_profile_id: String,
|
|
35
35
|
request_options: Sentdm::RequestOptions
|
|
36
36
|
}
|