sentdm 0.39.0 → 0.40.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 +9 -0
- data/README.md +1 -1
- data/lib/sentdm/internal/voice_agents_page.rb +115 -0
- data/lib/sentdm/models/call_event.rb +8 -6
- data/lib/sentdm/models/call_event_payload.rb +25 -6
- data/lib/sentdm/models/channels/voice_create_params.rb +23 -11
- data/lib/sentdm/models/channels/voice_number.rb +23 -1
- data/lib/sentdm/models/channels/voice_update_params.rb +12 -1
- data/lib/sentdm/models/voice/agent_create_params.rb +142 -0
- data/lib/sentdm/models/voice/agent_delete_params.rb +28 -0
- data/lib/sentdm/models/voice/agent_list_params.rb +38 -0
- data/lib/sentdm/models/voice/agent_retrieve_params.rb +28 -0
- data/lib/sentdm/models/voice/agent_rotate_secret_params.rb +34 -0
- data/lib/sentdm/models/voice/agent_update_params.rb +141 -0
- data/lib/sentdm/models/voice/api_response_of_voice_agent.rb +51 -0
- data/lib/sentdm/models/voice/api_response_of_voice_agent_secret.rb +45 -0
- data/lib/sentdm/models/voice/api_response_of_voice_agents_list.rb +48 -0
- data/lib/sentdm/models/voice/api_response_of_voice_catalogue.rb +49 -0
- data/lib/sentdm/models/voice/call.rb +97 -5
- data/lib/sentdm/models/voice/call_list_params.rb +19 -1
- data/lib/sentdm/models/voice/catalogue_list_params.rb +22 -0
- data/lib/sentdm/models/voice/voice_agent.rb +138 -0
- data/lib/sentdm/models/voice/voice_agent_audio.rb +19 -0
- data/lib/sentdm/models/voice/voice_agent_audio_spec.rb +20 -0
- data/lib/sentdm/models/voice/voice_agent_limits.rb +31 -0
- data/lib/sentdm/models/voice/voice_agent_limits_spec.rb +40 -0
- data/lib/sentdm/models/voice/voice_agent_party.rb +25 -0
- data/lib/sentdm/models/voice/voice_agent_party_spec.rb +28 -0
- data/lib/sentdm/models/voice/voice_agent_secret.rb +27 -0
- data/lib/sentdm/models/voice/voice_agent_speech.rb +31 -0
- data/lib/sentdm/models/voice/voice_agent_speech_spec.rb +40 -0
- data/lib/sentdm/models/voice/voice_agent_transcripts.rb +25 -0
- data/lib/sentdm/models/voice/voice_agent_transcripts_spec.rb +32 -0
- data/lib/sentdm/models/voice/voice_agents_list.rb +30 -0
- data/lib/sentdm/models/voice/voice_catalogue.rb +30 -0
- data/lib/sentdm/models/voice/voice_catalogue_voice.rb +43 -0
- data/lib/sentdm/models/webhook_create_params.rb +31 -5
- data/lib/sentdm/models/webhook_response.rb +66 -4
- data/lib/sentdm/models/webhook_update_params.rb +15 -3
- data/lib/sentdm/resources/channels/voice.rb +38 -15
- data/lib/sentdm/resources/profiles/campaigns.rb +3 -2
- data/lib/sentdm/resources/voice/agents.rb +319 -0
- data/lib/sentdm/resources/voice/calls/participants.rb +11 -0
- data/lib/sentdm/resources/voice/calls.rb +44 -13
- data/lib/sentdm/resources/voice/catalogue.rb +71 -0
- data/lib/sentdm/resources/voice/tokens.rb +11 -0
- data/lib/sentdm/resources/voice.rb +86 -0
- data/lib/sentdm/resources/webhooks.rb +43 -15
- data/lib/sentdm/version.rb +1 -1
- data/lib/sentdm.rb +29 -0
- data/rbi/sentdm/internal/voice_agents_page.rbi +71 -0
- data/rbi/sentdm/models/call_event.rbi +14 -10
- data/rbi/sentdm/models/call_event_payload.rbi +28 -5
- data/rbi/sentdm/models/channels/voice_create_params.rbi +33 -17
- data/rbi/sentdm/models/channels/voice_number.rbi +31 -0
- data/rbi/sentdm/models/channels/voice_update_params.rbi +14 -0
- data/rbi/sentdm/models/voice/agent_create_params.rbi +215 -0
- data/rbi/sentdm/models/voice/agent_delete_params.rbi +48 -0
- data/rbi/sentdm/models/voice/agent_list_params.rbi +66 -0
- data/rbi/sentdm/models/voice/agent_retrieve_params.rbi +48 -0
- data/rbi/sentdm/models/voice/agent_rotate_secret_params.rbi +64 -0
- data/rbi/sentdm/models/voice/agent_update_params.rbi +211 -0
- data/rbi/sentdm/models/voice/api_response_of_voice_agent.rbi +85 -0
- data/rbi/sentdm/models/voice/api_response_of_voice_agent_secret.rbi +81 -0
- data/rbi/sentdm/models/voice/api_response_of_voice_agents_list.rbi +83 -0
- data/rbi/sentdm/models/voice/api_response_of_voice_catalogue.rbi +83 -0
- data/rbi/sentdm/models/voice/call.rbi +141 -8
- data/rbi/sentdm/models/voice/call_list_params.rbi +20 -0
- data/rbi/sentdm/models/voice/catalogue_list_params.rbi +40 -0
- data/rbi/sentdm/models/voice/voice_agent.rbi +196 -0
- data/rbi/sentdm/models/voice/voice_agent_audio.rbi +30 -0
- data/rbi/sentdm/models/voice/voice_agent_audio_spec.rbi +33 -0
- data/rbi/sentdm/models/voice/voice_agent_limits.rbi +57 -0
- data/rbi/sentdm/models/voice/voice_agent_limits_spec.rbi +62 -0
- data/rbi/sentdm/models/voice/voice_agent_party.rbi +36 -0
- data/rbi/sentdm/models/voice/voice_agent_party_spec.rbi +45 -0
- data/rbi/sentdm/models/voice/voice_agent_secret.rbi +37 -0
- data/rbi/sentdm/models/voice/voice_agent_speech.rbi +48 -0
- data/rbi/sentdm/models/voice/voice_agent_speech_spec.rbi +62 -0
- data/rbi/sentdm/models/voice/voice_agent_transcripts.rbi +43 -0
- data/rbi/sentdm/models/voice/voice_agent_transcripts_spec.rbi +51 -0
- data/rbi/sentdm/models/voice/voice_agents_list.rbi +55 -0
- data/rbi/sentdm/models/voice/voice_catalogue.rbi +59 -0
- data/rbi/sentdm/models/voice/voice_catalogue_voice.rbi +75 -0
- data/rbi/sentdm/models/webhook_create_params.rbi +41 -3
- data/rbi/sentdm/models/webhook_response.rbi +112 -3
- data/rbi/sentdm/models/webhook_update_params.rbi +18 -3
- data/rbi/sentdm/resources/channels/voice.rbi +52 -19
- data/rbi/sentdm/resources/profiles/campaigns.rbi +3 -2
- data/rbi/sentdm/resources/voice/agents.rbi +316 -0
- data/rbi/sentdm/resources/voice/calls/participants.rbi +11 -0
- data/rbi/sentdm/resources/voice/calls.rbi +46 -11
- data/rbi/sentdm/resources/voice/catalogue.rbi +59 -0
- data/rbi/sentdm/resources/voice/tokens.rbi +11 -0
- data/rbi/sentdm/resources/voice.rbi +84 -0
- data/rbi/sentdm/resources/webhooks.rbi +56 -16
- data/sig/sentdm/internal/voice_agents_page.rbs +41 -0
- data/sig/sentdm/models/call_event_payload.rbs +12 -0
- data/sig/sentdm/models/channels/voice_create_params.rbs +9 -4
- data/sig/sentdm/models/channels/voice_number.rbs +12 -0
- data/sig/sentdm/models/channels/voice_update_params.rbs +5 -0
- data/sig/sentdm/models/voice/agent_create_params.rbs +99 -0
- data/sig/sentdm/models/voice/agent_delete_params.rbs +34 -0
- data/sig/sentdm/models/voice/agent_list_params.rbs +40 -0
- data/sig/sentdm/models/voice/agent_retrieve_params.rbs +32 -0
- data/sig/sentdm/models/voice/agent_rotate_secret_params.rbs +40 -0
- data/sig/sentdm/models/voice/agent_update_params.rbs +108 -0
- data/sig/sentdm/models/voice/api_response_of_voice_agent.rbs +41 -0
- data/sig/sentdm/models/voice/api_response_of_voice_agent_secret.rbs +41 -0
- data/sig/sentdm/models/voice/api_response_of_voice_agents_list.rbs +41 -0
- data/sig/sentdm/models/voice/api_response_of_voice_catalogue.rbs +41 -0
- data/sig/sentdm/models/voice/call.rbs +65 -0
- data/sig/sentdm/models/voice/call_list_params.rbs +10 -0
- data/sig/sentdm/models/voice/catalogue_list_params.rbs +27 -0
- data/sig/sentdm/models/voice/voice_agent.rbs +116 -0
- data/sig/sentdm/models/voice/voice_agent_audio.rbs +19 -0
- data/sig/sentdm/models/voice/voice_agent_audio_spec.rbs +17 -0
- data/sig/sentdm/models/voice/voice_agent_limits.rbs +38 -0
- data/sig/sentdm/models/voice/voice_agent_limits_spec.rbs +34 -0
- data/sig/sentdm/models/voice/voice_agent_party.rbs +23 -0
- data/sig/sentdm/models/voice/voice_agent_party_spec.rbs +19 -0
- data/sig/sentdm/models/voice/voice_agent_secret.rbs +19 -0
- data/sig/sentdm/models/voice/voice_agent_speech.rbs +32 -0
- data/sig/sentdm/models/voice/voice_agent_speech_spec.rbs +26 -0
- data/sig/sentdm/models/voice/voice_agent_transcripts.rbs +23 -0
- data/sig/sentdm/models/voice/voice_agent_transcripts_spec.rbs +20 -0
- data/sig/sentdm/models/voice/voice_agents_list.rbs +35 -0
- data/sig/sentdm/models/voice/voice_catalogue.rbs +35 -0
- data/sig/sentdm/models/voice/voice_catalogue_voice.rbs +42 -0
- data/sig/sentdm/models/webhook_create_params.rbs +12 -0
- data/sig/sentdm/models/webhook_response.rbs +46 -3
- data/sig/sentdm/models/webhook_update_params.rbs +5 -0
- data/sig/sentdm/resources/channels/voice.rbs +3 -1
- data/sig/sentdm/resources/voice/agents.rbs +74 -0
- data/sig/sentdm/resources/voice/calls.rbs +2 -0
- data/sig/sentdm/resources/voice/catalogue.rbs +14 -0
- data/sig/sentdm/resources/voice.rbs +4 -0
- data/sig/sentdm/resources/webhooks.rbs +3 -0
- metadata +89 -2
|
@@ -20,6 +20,10 @@ module Sentdm
|
|
|
20
20
|
sig { params(account_id: String).void }
|
|
21
21
|
attr_writer :account_id
|
|
22
22
|
|
|
23
|
+
# The voice agent that answers the call, agent\_…. Only on an agent call.
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_accessor :agent_id
|
|
26
|
+
|
|
23
27
|
# Always voice.
|
|
24
28
|
sig { returns(T.nilable(String)) }
|
|
25
29
|
attr_reader :channel
|
|
@@ -31,6 +35,14 @@ module Sentdm
|
|
|
31
35
|
sig { returns(T.nilable(Integer)) }
|
|
32
36
|
attr_accessor :duration_seconds
|
|
33
37
|
|
|
38
|
+
# inapp, a call routed by the number's callback URL, or agent, a call one of the
|
|
39
|
+
# account's voice agents answers. The same value GET /v3/voice/calls returns.
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_reader :mode
|
|
42
|
+
|
|
43
|
+
sig { params(mode: String).void }
|
|
44
|
+
attr_writer :mode
|
|
45
|
+
|
|
34
46
|
# The customer number that owns the call, in E.164 format.
|
|
35
47
|
sig { returns(T.nilable(String)) }
|
|
36
48
|
attr_reader :number
|
|
@@ -61,15 +73,17 @@ module Sentdm
|
|
|
61
73
|
sig { params(updated_at: String).void }
|
|
62
74
|
attr_writer :updated_at
|
|
63
75
|
|
|
64
|
-
# Body of a call.initiated, call.answered, call.
|
|
65
|
-
# call.recording_ready event. Which of them occurred is the
|
|
76
|
+
# Body of a call.initiated, call.answered, call.agent_connected, call.completed,
|
|
77
|
+
# call.failed or call.recording_ready event. Which of them occurred is the
|
|
78
|
+
# envelope's event.
|
|
66
79
|
#
|
|
67
80
|
# Shaped like the message, inbound, template and channel payloads: account_id
|
|
68
81
|
# names the account the event is about, channel names the channel, and updated_at
|
|
69
82
|
# is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
|
|
70
|
-
#
|
|
71
|
-
#
|
|
72
|
-
#
|
|
83
|
+
# Every event says how the call is handled in mode, and an agent call names its
|
|
84
|
+
# agent in agent_id. duration_seconds and price are added on call.completed,
|
|
85
|
+
# reason on call.failed and recording_id on call.recording_ready; each is omitted
|
|
86
|
+
# rather than sent as null when it does not apply.
|
|
73
87
|
#
|
|
74
88
|
# Casing is snake_case because these ride the same webhook stream customers
|
|
75
89
|
# already parse message_id from; the question/answer contract is a separate
|
|
@@ -79,8 +93,10 @@ module Sentdm
|
|
|
79
93
|
params(
|
|
80
94
|
call_id: String,
|
|
81
95
|
account_id: String,
|
|
96
|
+
agent_id: T.nilable(String),
|
|
82
97
|
channel: String,
|
|
83
98
|
duration_seconds: T.nilable(Integer),
|
|
99
|
+
mode: String,
|
|
84
100
|
number: String,
|
|
85
101
|
price: T.nilable(Float),
|
|
86
102
|
reason: T.nilable(String),
|
|
@@ -94,10 +110,15 @@ module Sentdm
|
|
|
94
110
|
# The account the call belongs to: the key's own customer, or the sender profile
|
|
95
111
|
# it acted as.
|
|
96
112
|
account_id: nil,
|
|
113
|
+
# The voice agent that answers the call, agent\_…. Only on an agent call.
|
|
114
|
+
agent_id: nil,
|
|
97
115
|
# Always voice.
|
|
98
116
|
channel: nil,
|
|
99
117
|
# How long the call lasted. Only on call.completed.
|
|
100
118
|
duration_seconds: nil,
|
|
119
|
+
# inapp, a call routed by the number's callback URL, or agent, a call one of the
|
|
120
|
+
# account's voice agents answers. The same value GET /v3/voice/calls returns.
|
|
121
|
+
mode: nil,
|
|
101
122
|
# The customer number that owns the call, in E.164 format.
|
|
102
123
|
number: nil,
|
|
103
124
|
# What the call was charged. Only on call.completed, and omitted there until
|
|
@@ -120,8 +141,10 @@ module Sentdm
|
|
|
120
141
|
{
|
|
121
142
|
call_id: String,
|
|
122
143
|
account_id: String,
|
|
144
|
+
agent_id: T.nilable(String),
|
|
123
145
|
channel: String,
|
|
124
146
|
duration_seconds: T.nilable(Integer),
|
|
147
|
+
mode: String,
|
|
125
148
|
number: String,
|
|
126
149
|
price: T.nilable(Float),
|
|
127
150
|
reason: T.nilable(String),
|
|
@@ -15,14 +15,13 @@ module Sentdm
|
|
|
15
15
|
)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
attr_accessor :callback_url
|
|
18
|
+
# One of your voice agents (GET /v3/voice/agents), such as
|
|
19
|
+
# agent_9f2ab000-0000-4000-8000-000000000001, to answer calls to this number. It
|
|
20
|
+
# wins over callback_url for calls to the number, and both may be sent; calls your
|
|
21
|
+
# app places from the number still follow your app. Send it instead of
|
|
22
|
+
# callback_url for a number only an agent answers.
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_accessor :agent_id
|
|
26
25
|
|
|
27
26
|
# The US area code a new number should be in, as 212. Only for a request that
|
|
28
27
|
# leaves number out — sending both says two different things about which number to
|
|
@@ -31,6 +30,15 @@ module Sentdm
|
|
|
31
30
|
sig { returns(T.nilable(String)) }
|
|
32
31
|
attr_accessor :area_code
|
|
33
32
|
|
|
33
|
+
# Where Sent asks what to do with each call on this number: an absolute HTTP or
|
|
34
|
+
# HTTPS URL on a public host. A signed question is POSTed here when a call arrives
|
|
35
|
+
# or a caller presses a key, and the answer decides the call. Every question is
|
|
36
|
+
# signed with the callback_secret the response returns, the same way your webhooks
|
|
37
|
+
# are signed. Turning the number on again with a different URL replaces it and
|
|
38
|
+
# keeps the secret. Required unless agent_id is sent.
|
|
39
|
+
sig { returns(T.nilable(String)) }
|
|
40
|
+
attr_accessor :callback_url
|
|
41
|
+
|
|
34
42
|
# Make this the line app-originated calls are placed from when a voice token names
|
|
35
43
|
# no number. Omit it and your first voice number takes that role; a later one
|
|
36
44
|
# leaves it where it is.
|
|
@@ -65,8 +73,9 @@ module Sentdm
|
|
|
65
73
|
|
|
66
74
|
sig do
|
|
67
75
|
params(
|
|
68
|
-
|
|
76
|
+
agent_id: T.nilable(String),
|
|
69
77
|
area_code: T.nilable(String),
|
|
78
|
+
callback_url: T.nilable(String),
|
|
70
79
|
default_for_app_calls: T.nilable(T::Boolean),
|
|
71
80
|
number: T.nilable(String),
|
|
72
81
|
sandbox: T::Boolean,
|
|
@@ -76,18 +85,24 @@ module Sentdm
|
|
|
76
85
|
).returns(T.attached_class)
|
|
77
86
|
end
|
|
78
87
|
def self.new(
|
|
79
|
-
#
|
|
80
|
-
#
|
|
81
|
-
#
|
|
82
|
-
#
|
|
83
|
-
#
|
|
84
|
-
|
|
85
|
-
callback_url:,
|
|
88
|
+
# One of your voice agents (GET /v3/voice/agents), such as
|
|
89
|
+
# agent_9f2ab000-0000-4000-8000-000000000001, to answer calls to this number. It
|
|
90
|
+
# wins over callback_url for calls to the number, and both may be sent; calls your
|
|
91
|
+
# app places from the number still follow your app. Send it instead of
|
|
92
|
+
# callback_url for a number only an agent answers.
|
|
93
|
+
agent_id: nil,
|
|
86
94
|
# The US area code a new number should be in, as 212. Only for a request that
|
|
87
95
|
# leaves number out — sending both says two different things about which number to
|
|
88
96
|
# use, and is refused. Omit it too and the number comes from anywhere in the
|
|
89
97
|
# country.
|
|
90
98
|
area_code: nil,
|
|
99
|
+
# Where Sent asks what to do with each call on this number: an absolute HTTP or
|
|
100
|
+
# HTTPS URL on a public host. A signed question is POSTed here when a call arrives
|
|
101
|
+
# or a caller presses a key, and the answer decides the call. Every question is
|
|
102
|
+
# signed with the callback_secret the response returns, the same way your webhooks
|
|
103
|
+
# are signed. Turning the number on again with a different URL replaces it and
|
|
104
|
+
# keeps the secret. Required unless agent_id is sent.
|
|
105
|
+
callback_url: nil,
|
|
91
106
|
# Make this the line app-originated calls are placed from when a voice token names
|
|
92
107
|
# no number. Omit it and your first voice number takes that role; a later one
|
|
93
108
|
# leaves it where it is.
|
|
@@ -108,8 +123,9 @@ module Sentdm
|
|
|
108
123
|
sig do
|
|
109
124
|
override.returns(
|
|
110
125
|
{
|
|
111
|
-
|
|
126
|
+
agent_id: T.nilable(String),
|
|
112
127
|
area_code: T.nilable(String),
|
|
128
|
+
callback_url: T.nilable(String),
|
|
113
129
|
default_for_app_calls: T.nilable(T::Boolean),
|
|
114
130
|
number: T.nilable(String),
|
|
115
131
|
sandbox: T::Boolean,
|
|
@@ -9,6 +9,13 @@ module Sentdm
|
|
|
9
9
|
T.any(Sentdm::Channels::VoiceNumber, Sentdm::Internal::AnyHash)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
+
# The voice agent calls to this number go to, such as
|
|
13
|
+
# agent_9f2ab000-0000-4000-8000-000000000001. It wins over callback_url for calls
|
|
14
|
+
# to the number; calls your app places from the number still follow your app. Null
|
|
15
|
+
# when no agent answers the number.
|
|
16
|
+
sig { returns(T.nilable(String)) }
|
|
17
|
+
attr_accessor :agent_id
|
|
18
|
+
|
|
12
19
|
# Where Sent asks what to do with each call on this number: a signed question is
|
|
13
20
|
# POSTed here when a call arrives or a caller presses a key, and the answer
|
|
14
21
|
# decides the call. The signing secret is not on this read; it is shown when voice
|
|
@@ -38,6 +45,16 @@ module Sentdm
|
|
|
38
45
|
sig { params(number: String).void }
|
|
39
46
|
attr_writer :number
|
|
40
47
|
|
|
48
|
+
# Who answers calls to this number: agent, the voice agent in agent_id;
|
|
49
|
+
# agent_pending, that agent once the number has finished moving to it, with calls
|
|
50
|
+
# possibly unanswered until then; callback, your callback_url; or none, in which
|
|
51
|
+
# case calls to it are declined.
|
|
52
|
+
sig { returns(T.nilable(String)) }
|
|
53
|
+
attr_reader :routes_to
|
|
54
|
+
|
|
55
|
+
sig { params(routes_to: String).void }
|
|
56
|
+
attr_writer :routes_to
|
|
57
|
+
|
|
41
58
|
# ACTIVE while the number carries calls, INACTIVE once it was turned off. Nothing
|
|
42
59
|
# provisions: a number the customer holds can carry calls the moment voice is
|
|
43
60
|
# turned on for it.
|
|
@@ -56,15 +73,22 @@ module Sentdm
|
|
|
56
73
|
# One number the profile carries phone calls on.
|
|
57
74
|
sig do
|
|
58
75
|
params(
|
|
76
|
+
agent_id: T.nilable(String),
|
|
59
77
|
callback_url: T.nilable(String),
|
|
60
78
|
created_at: Time,
|
|
61
79
|
default_for_app_calls: T::Boolean,
|
|
62
80
|
number: String,
|
|
81
|
+
routes_to: String,
|
|
63
82
|
status: String,
|
|
64
83
|
updated_at: Time
|
|
65
84
|
).returns(T.attached_class)
|
|
66
85
|
end
|
|
67
86
|
def self.new(
|
|
87
|
+
# The voice agent calls to this number go to, such as
|
|
88
|
+
# agent_9f2ab000-0000-4000-8000-000000000001. It wins over callback_url for calls
|
|
89
|
+
# to the number; calls your app places from the number still follow your app. Null
|
|
90
|
+
# when no agent answers the number.
|
|
91
|
+
agent_id: nil,
|
|
68
92
|
# Where Sent asks what to do with each call on this number: a signed question is
|
|
69
93
|
# POSTed here when a call arrives or a caller presses a key, and the answer
|
|
70
94
|
# decides the call. The signing secret is not on this read; it is shown when voice
|
|
@@ -77,6 +101,11 @@ module Sentdm
|
|
|
77
101
|
default_for_app_calls: nil,
|
|
78
102
|
# The number, in E.164.
|
|
79
103
|
number: nil,
|
|
104
|
+
# Who answers calls to this number: agent, the voice agent in agent_id;
|
|
105
|
+
# agent_pending, that agent once the number has finished moving to it, with calls
|
|
106
|
+
# possibly unanswered until then; callback, your callback_url; or none, in which
|
|
107
|
+
# case calls to it are declined.
|
|
108
|
+
routes_to: nil,
|
|
80
109
|
# ACTIVE while the number carries calls, INACTIVE once it was turned off. Nothing
|
|
81
110
|
# provisions: a number the customer holds can carry calls the moment voice is
|
|
82
111
|
# turned on for it.
|
|
@@ -88,10 +117,12 @@ module Sentdm
|
|
|
88
117
|
sig do
|
|
89
118
|
override.returns(
|
|
90
119
|
{
|
|
120
|
+
agent_id: T.nilable(String),
|
|
91
121
|
callback_url: T.nilable(String),
|
|
92
122
|
created_at: Time,
|
|
93
123
|
default_for_app_calls: T::Boolean,
|
|
94
124
|
number: String,
|
|
125
|
+
routes_to: String,
|
|
95
126
|
status: String,
|
|
96
127
|
updated_at: Time
|
|
97
128
|
}
|
|
@@ -18,6 +18,13 @@ module Sentdm
|
|
|
18
18
|
sig { returns(String) }
|
|
19
19
|
attr_accessor :number
|
|
20
20
|
|
|
21
|
+
# One of your voice agents, such as agent_9f2ab000-0000-4000-8000-000000000001, to
|
|
22
|
+
# answer calls to the number, or null to unbind it so the callback URL answers
|
|
23
|
+
# them again. The agent wins over callback_url for calls to the number; calls your
|
|
24
|
+
# app places from it still follow your app.
|
|
25
|
+
sig { returns(T.nilable(String)) }
|
|
26
|
+
attr_accessor :agent_id
|
|
27
|
+
|
|
21
28
|
# A new callback URL for the number, active or not: an absolute HTTP or HTTPS URL
|
|
22
29
|
# on a public host, where Sent asks what to do with each call. The signing secret
|
|
23
30
|
# is kept.
|
|
@@ -63,6 +70,7 @@ module Sentdm
|
|
|
63
70
|
sig do
|
|
64
71
|
params(
|
|
65
72
|
number: String,
|
|
73
|
+
agent_id: T.nilable(String),
|
|
66
74
|
callback_url: T.nilable(String),
|
|
67
75
|
default_for_app_calls: T.nilable(T::Boolean),
|
|
68
76
|
sandbox: T::Boolean,
|
|
@@ -75,6 +83,11 @@ module Sentdm
|
|
|
75
83
|
end
|
|
76
84
|
def self.new(
|
|
77
85
|
number:,
|
|
86
|
+
# One of your voice agents, such as agent_9f2ab000-0000-4000-8000-000000000001, to
|
|
87
|
+
# answer calls to the number, or null to unbind it so the callback URL answers
|
|
88
|
+
# them again. The agent wins over callback_url for calls to the number; calls your
|
|
89
|
+
# app places from it still follow your app.
|
|
90
|
+
agent_id: nil,
|
|
78
91
|
# A new callback URL for the number, active or not: an absolute HTTP or HTTPS URL
|
|
79
92
|
# on a public host, where Sent asks what to do with each call. The signing secret
|
|
80
93
|
# is kept.
|
|
@@ -100,6 +113,7 @@ module Sentdm
|
|
|
100
113
|
override.returns(
|
|
101
114
|
{
|
|
102
115
|
number: String,
|
|
116
|
+
agent_id: T.nilable(String),
|
|
103
117
|
callback_url: T.nilable(String),
|
|
104
118
|
default_for_app_calls: T.nilable(T::Boolean),
|
|
105
119
|
sandbox: T::Boolean,
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
module Voice
|
|
6
|
+
class AgentCreateParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(Sentdm::Voice::AgentCreateParams, Sentdm::Internal::AnyHash)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Audio sessions only: the sound format.
|
|
16
|
+
sig { returns(T.nilable(Sentdm::Voice::VoiceAgentAudioSpec)) }
|
|
17
|
+
attr_reader :audio
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
params(
|
|
21
|
+
audio: T.nilable(Sentdm::Voice::VoiceAgentAudioSpec::OrHash)
|
|
22
|
+
).void
|
|
23
|
+
end
|
|
24
|
+
attr_writer :audio
|
|
25
|
+
|
|
26
|
+
# Who takes the call when the agent cannot: a phone number (kind: number). Omit it
|
|
27
|
+
# and such a call hangs up.
|
|
28
|
+
sig { returns(T.nilable(Sentdm::Voice::VoiceAgentPartySpec)) }
|
|
29
|
+
attr_reader :fallback
|
|
30
|
+
|
|
31
|
+
sig do
|
|
32
|
+
params(
|
|
33
|
+
fallback: T.nilable(Sentdm::Voice::VoiceAgentPartySpec::OrHash)
|
|
34
|
+
).void
|
|
35
|
+
end
|
|
36
|
+
attr_writer :fallback
|
|
37
|
+
|
|
38
|
+
# Text sessions only: what the caller hears as soon as the call is answered,
|
|
39
|
+
# before the agent's first turn. 1 to 4,096 characters. Omit it and the agent
|
|
40
|
+
# speaks first.
|
|
41
|
+
sig { returns(T.nilable(String)) }
|
|
42
|
+
attr_accessor :greeting
|
|
43
|
+
|
|
44
|
+
sig { returns(T.nilable(Sentdm::Voice::VoiceAgentLimitsSpec)) }
|
|
45
|
+
attr_reader :limits
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
limits: T.nilable(Sentdm::Voice::VoiceAgentLimitsSpec::OrHash)
|
|
50
|
+
).void
|
|
51
|
+
end
|
|
52
|
+
attr_writer :limits
|
|
53
|
+
|
|
54
|
+
# A name for your own reference, 1 to 100 characters.
|
|
55
|
+
sig { returns(T.nilable(String)) }
|
|
56
|
+
attr_accessor :name
|
|
57
|
+
|
|
58
|
+
# Sandbox flag - when true, the operation is simulated without side effects Useful
|
|
59
|
+
# for testing integrations without actual execution
|
|
60
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
61
|
+
attr_reader :sandbox
|
|
62
|
+
|
|
63
|
+
sig { params(sandbox: T::Boolean).void }
|
|
64
|
+
attr_writer :sandbox
|
|
65
|
+
|
|
66
|
+
# text: Sent turns the caller's speech into text and the agent's text into speech,
|
|
67
|
+
# so the agent exchanges text frames. audio: the agent receives and sends the
|
|
68
|
+
# sound itself.
|
|
69
|
+
sig { returns(T.nilable(String)) }
|
|
70
|
+
attr_accessor :session_type
|
|
71
|
+
|
|
72
|
+
# Text sessions only: how the caller is spoken to and listened to.
|
|
73
|
+
sig { returns(T.nilable(Sentdm::Voice::VoiceAgentSpeechSpec)) }
|
|
74
|
+
attr_reader :speech
|
|
75
|
+
|
|
76
|
+
sig do
|
|
77
|
+
params(
|
|
78
|
+
speech: T.nilable(Sentdm::Voice::VoiceAgentSpeechSpec::OrHash)
|
|
79
|
+
).void
|
|
80
|
+
end
|
|
81
|
+
attr_writer :speech
|
|
82
|
+
|
|
83
|
+
# What the agent may do to the call: any of transfer, hangup, send_dtmf and hold.
|
|
84
|
+
# Default ["hangup"]. transfer needs at least one transfer_targets entry.
|
|
85
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
86
|
+
attr_accessor :tools
|
|
87
|
+
|
|
88
|
+
sig { returns(T.nilable(Sentdm::Voice::VoiceAgentTranscriptsSpec)) }
|
|
89
|
+
attr_reader :transcripts
|
|
90
|
+
|
|
91
|
+
sig do
|
|
92
|
+
params(
|
|
93
|
+
transcripts:
|
|
94
|
+
T.nilable(Sentdm::Voice::VoiceAgentTranscriptsSpec::OrHash)
|
|
95
|
+
).void
|
|
96
|
+
end
|
|
97
|
+
attr_writer :transcripts
|
|
98
|
+
|
|
99
|
+
# Where the agent may transfer a call to, up to 20 parties: a phone number (kind:
|
|
100
|
+
# number, E.164), one of your app users (kind: user, the identity) or another of
|
|
101
|
+
# your agents (kind: agent, its id). The agent can only transfer to a party listed
|
|
102
|
+
# here.
|
|
103
|
+
sig { returns(T.nilable(T::Array[Sentdm::Voice::VoiceAgentPartySpec])) }
|
|
104
|
+
attr_accessor :transfer_targets
|
|
105
|
+
|
|
106
|
+
# Where the gateway connects to the agent for each call: an absolute wss:// URL on
|
|
107
|
+
# a public host, at most 2,048 characters. The handshake is signed with the
|
|
108
|
+
# agent's signing_secret. Leave it out and the agent dials in instead, connecting
|
|
109
|
+
# to the gateway with your API key.
|
|
110
|
+
sig { returns(T.nilable(String)) }
|
|
111
|
+
attr_accessor :websocket_url
|
|
112
|
+
|
|
113
|
+
sig { returns(T.nilable(String)) }
|
|
114
|
+
attr_reader :idempotency_key
|
|
115
|
+
|
|
116
|
+
sig { params(idempotency_key: String).void }
|
|
117
|
+
attr_writer :idempotency_key
|
|
118
|
+
|
|
119
|
+
sig { returns(T.nilable(String)) }
|
|
120
|
+
attr_reader :x_profile_id
|
|
121
|
+
|
|
122
|
+
sig { params(x_profile_id: String).void }
|
|
123
|
+
attr_writer :x_profile_id
|
|
124
|
+
|
|
125
|
+
sig do
|
|
126
|
+
params(
|
|
127
|
+
audio: T.nilable(Sentdm::Voice::VoiceAgentAudioSpec::OrHash),
|
|
128
|
+
fallback: T.nilable(Sentdm::Voice::VoiceAgentPartySpec::OrHash),
|
|
129
|
+
greeting: T.nilable(String),
|
|
130
|
+
limits: T.nilable(Sentdm::Voice::VoiceAgentLimitsSpec::OrHash),
|
|
131
|
+
name: T.nilable(String),
|
|
132
|
+
sandbox: T::Boolean,
|
|
133
|
+
session_type: T.nilable(String),
|
|
134
|
+
speech: T.nilable(Sentdm::Voice::VoiceAgentSpeechSpec::OrHash),
|
|
135
|
+
tools: T.nilable(T::Array[String]),
|
|
136
|
+
transcripts:
|
|
137
|
+
T.nilable(Sentdm::Voice::VoiceAgentTranscriptsSpec::OrHash),
|
|
138
|
+
transfer_targets:
|
|
139
|
+
T.nilable(T::Array[Sentdm::Voice::VoiceAgentPartySpec::OrHash]),
|
|
140
|
+
websocket_url: T.nilable(String),
|
|
141
|
+
idempotency_key: String,
|
|
142
|
+
x_profile_id: String,
|
|
143
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
144
|
+
).returns(T.attached_class)
|
|
145
|
+
end
|
|
146
|
+
def self.new(
|
|
147
|
+
# Audio sessions only: the sound format.
|
|
148
|
+
audio: nil,
|
|
149
|
+
# Who takes the call when the agent cannot: a phone number (kind: number). Omit it
|
|
150
|
+
# and such a call hangs up.
|
|
151
|
+
fallback: nil,
|
|
152
|
+
# Text sessions only: what the caller hears as soon as the call is answered,
|
|
153
|
+
# before the agent's first turn. 1 to 4,096 characters. Omit it and the agent
|
|
154
|
+
# speaks first.
|
|
155
|
+
greeting: nil,
|
|
156
|
+
limits: nil,
|
|
157
|
+
# A name for your own reference, 1 to 100 characters.
|
|
158
|
+
name: nil,
|
|
159
|
+
# Sandbox flag - when true, the operation is simulated without side effects Useful
|
|
160
|
+
# for testing integrations without actual execution
|
|
161
|
+
sandbox: nil,
|
|
162
|
+
# text: Sent turns the caller's speech into text and the agent's text into speech,
|
|
163
|
+
# so the agent exchanges text frames. audio: the agent receives and sends the
|
|
164
|
+
# sound itself.
|
|
165
|
+
session_type: nil,
|
|
166
|
+
# Text sessions only: how the caller is spoken to and listened to.
|
|
167
|
+
speech: nil,
|
|
168
|
+
# What the agent may do to the call: any of transfer, hangup, send_dtmf and hold.
|
|
169
|
+
# Default ["hangup"]. transfer needs at least one transfer_targets entry.
|
|
170
|
+
tools: nil,
|
|
171
|
+
transcripts: nil,
|
|
172
|
+
# Where the agent may transfer a call to, up to 20 parties: a phone number (kind:
|
|
173
|
+
# number, E.164), one of your app users (kind: user, the identity) or another of
|
|
174
|
+
# your agents (kind: agent, its id). The agent can only transfer to a party listed
|
|
175
|
+
# here.
|
|
176
|
+
transfer_targets: nil,
|
|
177
|
+
# Where the gateway connects to the agent for each call: an absolute wss:// URL on
|
|
178
|
+
# a public host, at most 2,048 characters. The handshake is signed with the
|
|
179
|
+
# agent's signing_secret. Leave it out and the agent dials in instead, connecting
|
|
180
|
+
# to the gateway with your API key.
|
|
181
|
+
websocket_url: nil,
|
|
182
|
+
idempotency_key: nil,
|
|
183
|
+
x_profile_id: nil,
|
|
184
|
+
request_options: {}
|
|
185
|
+
)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
sig do
|
|
189
|
+
override.returns(
|
|
190
|
+
{
|
|
191
|
+
audio: T.nilable(Sentdm::Voice::VoiceAgentAudioSpec),
|
|
192
|
+
fallback: T.nilable(Sentdm::Voice::VoiceAgentPartySpec),
|
|
193
|
+
greeting: T.nilable(String),
|
|
194
|
+
limits: T.nilable(Sentdm::Voice::VoiceAgentLimitsSpec),
|
|
195
|
+
name: T.nilable(String),
|
|
196
|
+
sandbox: T::Boolean,
|
|
197
|
+
session_type: T.nilable(String),
|
|
198
|
+
speech: T.nilable(Sentdm::Voice::VoiceAgentSpeechSpec),
|
|
199
|
+
tools: T.nilable(T::Array[String]),
|
|
200
|
+
transcripts: T.nilable(Sentdm::Voice::VoiceAgentTranscriptsSpec),
|
|
201
|
+
transfer_targets:
|
|
202
|
+
T.nilable(T::Array[Sentdm::Voice::VoiceAgentPartySpec]),
|
|
203
|
+
websocket_url: T.nilable(String),
|
|
204
|
+
idempotency_key: String,
|
|
205
|
+
x_profile_id: String,
|
|
206
|
+
request_options: Sentdm::RequestOptions
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
end
|
|
210
|
+
def to_hash
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
module Voice
|
|
6
|
+
class AgentDeleteParams < Sentdm::Models::MutationRequest
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(Sentdm::Voice::AgentDeleteParams, Sentdm::Internal::AnyHash)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
attr_reader :x_profile_id
|
|
20
|
+
|
|
21
|
+
sig { params(x_profile_id: String).void }
|
|
22
|
+
attr_writer :x_profile_id
|
|
23
|
+
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
id: String,
|
|
27
|
+
x_profile_id: String,
|
|
28
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
29
|
+
).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(id:, x_profile_id: nil, request_options: {})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
id: String,
|
|
38
|
+
x_profile_id: String,
|
|
39
|
+
request_options: Sentdm::RequestOptions
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
def to_hash
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
module Voice
|
|
6
|
+
class AgentListParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(Sentdm::Voice::AgentListParams, Sentdm::Internal::AnyHash)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Page number, from 1
|
|
16
|
+
sig { returns(T.nilable(Integer)) }
|
|
17
|
+
attr_reader :page
|
|
18
|
+
|
|
19
|
+
sig { params(page: Integer).void }
|
|
20
|
+
attr_writer :page
|
|
21
|
+
|
|
22
|
+
sig { returns(T.nilable(Integer)) }
|
|
23
|
+
attr_reader :page_size
|
|
24
|
+
|
|
25
|
+
sig { params(page_size: Integer).void }
|
|
26
|
+
attr_writer :page_size
|
|
27
|
+
|
|
28
|
+
sig { returns(T.nilable(String)) }
|
|
29
|
+
attr_reader :x_profile_id
|
|
30
|
+
|
|
31
|
+
sig { params(x_profile_id: String).void }
|
|
32
|
+
attr_writer :x_profile_id
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
page: Integer,
|
|
37
|
+
page_size: Integer,
|
|
38
|
+
x_profile_id: String,
|
|
39
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
40
|
+
).returns(T.attached_class)
|
|
41
|
+
end
|
|
42
|
+
def self.new(
|
|
43
|
+
# Page number, from 1
|
|
44
|
+
page: nil,
|
|
45
|
+
page_size: nil,
|
|
46
|
+
x_profile_id: nil,
|
|
47
|
+
request_options: {}
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
sig do
|
|
52
|
+
override.returns(
|
|
53
|
+
{
|
|
54
|
+
page: Integer,
|
|
55
|
+
page_size: Integer,
|
|
56
|
+
x_profile_id: String,
|
|
57
|
+
request_options: Sentdm::RequestOptions
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
def to_hash
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
module Voice
|
|
6
|
+
class AgentRetrieveParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(Sentdm::Voice::AgentRetrieveParams, Sentdm::Internal::AnyHash)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
attr_reader :x_profile_id
|
|
20
|
+
|
|
21
|
+
sig { params(x_profile_id: String).void }
|
|
22
|
+
attr_writer :x_profile_id
|
|
23
|
+
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
id: String,
|
|
27
|
+
x_profile_id: String,
|
|
28
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
29
|
+
).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(id:, x_profile_id: nil, request_options: {})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
id: String,
|
|
38
|
+
x_profile_id: String,
|
|
39
|
+
request_options: Sentdm::RequestOptions
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
def to_hash
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|