sentdm 0.34.0 → 0.36.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 +16 -0
- data/README.md +11 -9
- data/lib/sentdm/client.rb +30 -0
- data/lib/sentdm/internal/calls_page.rb +115 -0
- data/lib/sentdm/models/api_response_of_call.rb +43 -0
- data/lib/sentdm/models/api_response_of_call_recordings.rb +43 -0
- data/lib/sentdm/models/api_response_of_calls_list.rb +42 -0
- data/lib/sentdm/models/call.rb +134 -0
- data/lib/sentdm/models/call_event.rb +72 -0
- data/lib/sentdm/models/call_event_payload.rb +102 -0
- data/lib/sentdm/models/call_hangup_params.rb +32 -0
- data/lib/sentdm/models/call_list_params.rb +83 -0
- data/lib/sentdm/models/call_list_recordings_params.rb +26 -0
- data/lib/sentdm/models/call_party.rb +31 -0
- data/lib/sentdm/models/call_record_params.rb +55 -0
- data/lib/sentdm/models/call_recording.rb +38 -0
- data/lib/sentdm/models/call_recordings.rb +24 -0
- data/lib/sentdm/models/call_retrieve_params.rb +26 -0
- data/lib/sentdm/models/call_timeline_entry.rb +26 -0
- data/lib/sentdm/models/calls/api_response_of_list_of_call_participant.rb +45 -0
- data/lib/sentdm/models/calls/call_participant.rb +60 -0
- data/lib/sentdm/models/calls/call_participant_target.rb +30 -0
- data/lib/sentdm/models/calls/participant_add_params.rb +66 -0
- data/lib/sentdm/models/calls/participant_list_params.rb +28 -0
- data/lib/sentdm/models/calls/participant_remove_all_params.rb +28 -0
- data/lib/sentdm/models/calls/participant_remove_params.rb +34 -0
- data/lib/sentdm/models/calls/participant_update_params.rb +64 -0
- data/lib/sentdm/models/calls_list.rb +26 -0
- data/lib/sentdm/models/channels/api_response_of_list_of_voice_number.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_callback_test.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_number.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_number_created.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_secret.rb +45 -0
- data/lib/sentdm/models/channels/api_response_of_voice_token.rb +45 -0
- data/lib/sentdm/models/channels/voice_callback_test.rb +65 -0
- data/lib/sentdm/models/channels/voice_callback_test_error_info.rb +41 -0
- data/lib/sentdm/models/channels/voice_callback_test_request_info.rb +40 -0
- data/lib/sentdm/models/channels/voice_callback_test_response_info.rb +28 -0
- data/lib/sentdm/models/channels/voice_create_params.rb +86 -0
- data/lib/sentdm/models/channels/voice_create_token_params.rb +69 -0
- data/lib/sentdm/models/channels/voice_list_params.rb +22 -0
- data/lib/sentdm/models/channels/voice_number.rb +68 -0
- data/lib/sentdm/models/channels/voice_number_created.rb +26 -0
- data/lib/sentdm/models/channels/voice_retrieve_params.rb +28 -0
- data/lib/sentdm/models/channels/voice_rotate_secret_params.rb +34 -0
- data/lib/sentdm/models/channels/voice_secret.rb +25 -0
- data/lib/sentdm/models/channels/voice_test_params.rb +34 -0
- data/lib/sentdm/models/channels/voice_token.rb +44 -0
- data/lib/sentdm/models/channels/voice_update_params.rb +95 -0
- data/lib/sentdm/models/message_event_payload.rb +9 -4
- data/lib/sentdm/models/message_retrieve_activities_response.rb +7 -5
- data/lib/sentdm/models/webhook_list_events_response.rb +4 -173
- data/lib/sentdm/models.rb +36 -0
- data/lib/sentdm/resources/calls/participants.rb +231 -0
- data/lib/sentdm/resources/calls.rb +236 -0
- data/lib/sentdm/resources/channels/voice.rb +381 -0
- data/lib/sentdm/resources/channels.rb +45 -0
- data/lib/sentdm/resources/messages.rb +10 -4
- data/lib/sentdm/version.rb +1 -1
- data/lib/sentdm.rb +50 -0
- data/rbi/sentdm/client.rbi +28 -0
- data/rbi/sentdm/internal/calls_page.rbi +71 -0
- data/rbi/sentdm/models/api_response_of_call.rbi +74 -0
- data/rbi/sentdm/models/api_response_of_call_recordings.rbi +74 -0
- data/rbi/sentdm/models/api_response_of_calls_list.rbi +74 -0
- data/rbi/sentdm/models/call.rbi +179 -0
- data/rbi/sentdm/models/call_event.rbi +114 -0
- data/rbi/sentdm/models/call_event_payload.rbi +135 -0
- data/rbi/sentdm/models/call_hangup_params.rbi +59 -0
- data/rbi/sentdm/models/call_list_params.rbi +112 -0
- data/rbi/sentdm/models/call_list_recordings_params.rbi +46 -0
- data/rbi/sentdm/models/call_party.rbi +41 -0
- data/rbi/sentdm/models/call_record_params.rbi +83 -0
- data/rbi/sentdm/models/call_recording.rbi +59 -0
- data/rbi/sentdm/models/call_recordings.rbi +39 -0
- data/rbi/sentdm/models/call_retrieve_params.rbi +46 -0
- data/rbi/sentdm/models/call_timeline_entry.rbi +40 -0
- data/rbi/sentdm/models/calls/api_response_of_list_of_call_participant.rbi +76 -0
- data/rbi/sentdm/models/calls/call_participant.rbi +92 -0
- data/rbi/sentdm/models/calls/call_participant_target.rbi +47 -0
- data/rbi/sentdm/models/calls/participant_add_params.rbi +98 -0
- data/rbi/sentdm/models/calls/participant_list_params.rbi +51 -0
- data/rbi/sentdm/models/calls/participant_remove_all_params.rbi +51 -0
- data/rbi/sentdm/models/calls/participant_remove_params.rbi +61 -0
- data/rbi/sentdm/models/calls/participant_update_params.rbi +94 -0
- data/rbi/sentdm/models/calls_list.rbi +47 -0
- data/rbi/sentdm/models/channels/api_response_of_list_of_voice_number.rbi +76 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_callback_test.rbi +83 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_number.rbi +81 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_number_created.rbi +83 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_secret.rbi +81 -0
- data/rbi/sentdm/models/channels/api_response_of_voice_token.rbi +81 -0
- data/rbi/sentdm/models/channels/voice_callback_test.rbi +126 -0
- data/rbi/sentdm/models/channels/voice_callback_test_error_info.rbi +65 -0
- data/rbi/sentdm/models/channels/voice_callback_test_request_info.rbi +66 -0
- data/rbi/sentdm/models/channels/voice_callback_test_response_info.rbi +48 -0
- data/rbi/sentdm/models/channels/voice_create_params.rbi +127 -0
- data/rbi/sentdm/models/channels/voice_create_token_params.rbi +104 -0
- data/rbi/sentdm/models/channels/voice_list_params.rbi +40 -0
- data/rbi/sentdm/models/channels/voice_number.rbi +105 -0
- data/rbi/sentdm/models/channels/voice_number_created.rbi +42 -0
- data/rbi/sentdm/models/channels/voice_retrieve_params.rbi +51 -0
- data/rbi/sentdm/models/channels/voice_rotate_secret_params.rbi +64 -0
- data/rbi/sentdm/models/channels/voice_secret.rbi +35 -0
- data/rbi/sentdm/models/channels/voice_test_params.rbi +61 -0
- data/rbi/sentdm/models/channels/voice_token.rbi +76 -0
- data/rbi/sentdm/models/channels/voice_update_params.rbi +158 -0
- data/rbi/sentdm/models/message_event_payload.rbi +16 -6
- data/rbi/sentdm/models/message_retrieve_activities_response.rbi +12 -8
- data/rbi/sentdm/models/webhook_list_events_response.rbi +3 -269
- data/rbi/sentdm/models.rbi +36 -0
- data/rbi/sentdm/resources/calls/participants.rbi +199 -0
- data/rbi/sentdm/resources/calls.rbi +207 -0
- data/rbi/sentdm/resources/channels/voice.rbi +371 -0
- data/rbi/sentdm/resources/channels.rbi +42 -0
- data/rbi/sentdm/resources/messages.rbi +10 -4
- data/sig/sentdm/client.rbs +4 -0
- data/sig/sentdm/internal/calls_page.rbs +41 -0
- data/sig/sentdm/models/api_response_of_call.rbs +39 -0
- data/sig/sentdm/models/api_response_of_call_recordings.rbs +39 -0
- data/sig/sentdm/models/api_response_of_calls_list.rbs +39 -0
- data/sig/sentdm/models/call.rbs +101 -0
- data/sig/sentdm/models/call_event.rbs +44 -0
- data/sig/sentdm/models/call_event_payload.rbs +68 -0
- data/sig/sentdm/models/call_hangup_params.rbs +38 -0
- data/sig/sentdm/models/call_list_params.rbs +67 -0
- data/sig/sentdm/models/call_list_recordings_params.rbs +30 -0
- data/sig/sentdm/models/call_party.rbs +17 -0
- data/sig/sentdm/models/call_record_params.rbs +54 -0
- data/sig/sentdm/models/call_recording.rbs +32 -0
- data/sig/sentdm/models/call_recordings.rbs +17 -0
- data/sig/sentdm/models/call_retrieve_params.rbs +30 -0
- data/sig/sentdm/models/call_timeline_entry.rbs +19 -0
- data/sig/sentdm/models/calls/api_response_of_list_of_call_participant.rbs +41 -0
- data/sig/sentdm/models/calls/call_participant.rbs +52 -0
- data/sig/sentdm/models/calls/call_participant_target.rbs +23 -0
- data/sig/sentdm/models/calls/participant_add_params.rbs +63 -0
- data/sig/sentdm/models/calls/participant_list_params.rbs +32 -0
- data/sig/sentdm/models/calls/participant_remove_all_params.rbs +34 -0
- data/sig/sentdm/models/calls/participant_remove_params.rbs +40 -0
- data/sig/sentdm/models/calls/participant_update_params.rbs +61 -0
- data/sig/sentdm/models/calls_list.rbs +26 -0
- data/sig/sentdm/models/channels/api_response_of_list_of_voice_number.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_callback_test.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_number.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_number_created.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_secret.rbs +41 -0
- data/sig/sentdm/models/channels/api_response_of_voice_token.rbs +41 -0
- data/sig/sentdm/models/channels/voice_callback_test.rbs +51 -0
- data/sig/sentdm/models/channels/voice_callback_test_error_info.rbs +28 -0
- data/sig/sentdm/models/channels/voice_callback_test_request_info.rbs +34 -0
- data/sig/sentdm/models/channels/voice_callback_test_response_info.rbs +20 -0
- data/sig/sentdm/models/channels/voice_create_params.rbs +64 -0
- data/sig/sentdm/models/channels/voice_create_token_params.rbs +61 -0
- data/sig/sentdm/models/channels/voice_list_params.rbs +27 -0
- data/sig/sentdm/models/channels/voice_number.rbs +57 -0
- data/sig/sentdm/models/channels/voice_number_created.rbs +17 -0
- data/sig/sentdm/models/channels/voice_retrieve_params.rbs +32 -0
- data/sig/sentdm/models/channels/voice_rotate_secret_params.rbs +40 -0
- data/sig/sentdm/models/channels/voice_secret.rbs +17 -0
- data/sig/sentdm/models/channels/voice_test_params.rbs +40 -0
- data/sig/sentdm/models/channels/voice_token.rbs +40 -0
- data/sig/sentdm/models/channels/voice_update_params.rbs +78 -0
- data/sig/sentdm/models/webhook_list_events_response.rbs +1 -107
- data/sig/sentdm/models.rbs +36 -0
- data/sig/sentdm/resources/calls/participants.rbs +50 -0
- data/sig/sentdm/resources/calls.rbs +50 -0
- data/sig/sentdm/resources/channels/voice.rbs +68 -0
- data/sig/sentdm/resources/channels.rbs +9 -0
- metadata +152 -2
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class CallEvent < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Sentdm::CallEvent, Sentdm::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# The specific event within the family, for example message.delivered,
|
|
10
|
+
# message.received or contact.opt_out. Absent on events that have no subtype, so
|
|
11
|
+
# treat it as optional.
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_accessor :event
|
|
14
|
+
|
|
15
|
+
# The event family, for example message, templates or contact. Route on this
|
|
16
|
+
# first, then on event for the specific change.
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :field
|
|
19
|
+
|
|
20
|
+
sig { params(field: String).void }
|
|
21
|
+
attr_writer :field
|
|
22
|
+
|
|
23
|
+
# Body of a call.initiated, call.answered, call.completed, call.failed or
|
|
24
|
+
# call.recording_ready event. Which of them occurred is the envelope's event.
|
|
25
|
+
#
|
|
26
|
+
# Shaped like the message, inbound, template and channel payloads: account_id
|
|
27
|
+
# names the account the event is about, channel names the channel, and updated_at
|
|
28
|
+
# is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
|
|
29
|
+
# duration_seconds and price are added on call.completed, reason on call.failed
|
|
30
|
+
# and recording_id on call.recording_ready; each is omitted rather than sent as
|
|
31
|
+
# null when it does not apply.
|
|
32
|
+
#
|
|
33
|
+
# Casing is snake_case because these ride the same webhook stream customers
|
|
34
|
+
# already parse message_id from; the question/answer contract is a separate
|
|
35
|
+
# surface and stays camelCase. Nothing here is provider-shaped: no provider call
|
|
36
|
+
# id, no namespaced identity.
|
|
37
|
+
sig { returns(T.nilable(Sentdm::CallEventPayload)) }
|
|
38
|
+
attr_reader :payload
|
|
39
|
+
|
|
40
|
+
sig { params(payload: T.nilable(Sentdm::CallEventPayload::OrHash)).void }
|
|
41
|
+
attr_writer :payload
|
|
42
|
+
|
|
43
|
+
# The event-specific body.
|
|
44
|
+
sig { returns(T.nilable(String)) }
|
|
45
|
+
attr_accessor :request_id
|
|
46
|
+
|
|
47
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
48
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
49
|
+
# payload for the latter.
|
|
50
|
+
sig { returns(T.nilable(String)) }
|
|
51
|
+
attr_reader :timestamp
|
|
52
|
+
|
|
53
|
+
sig { params(timestamp: String).void }
|
|
54
|
+
attr_writer :timestamp
|
|
55
|
+
|
|
56
|
+
# The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
|
|
57
|
+
# this shape and varies only in Payload.
|
|
58
|
+
sig do
|
|
59
|
+
params(
|
|
60
|
+
event: T.nilable(String),
|
|
61
|
+
field: String,
|
|
62
|
+
payload: T.nilable(Sentdm::CallEventPayload::OrHash),
|
|
63
|
+
request_id: T.nilable(String),
|
|
64
|
+
timestamp: String
|
|
65
|
+
).returns(T.attached_class)
|
|
66
|
+
end
|
|
67
|
+
def self.new(
|
|
68
|
+
# The specific event within the family, for example message.delivered,
|
|
69
|
+
# message.received or contact.opt_out. Absent on events that have no subtype, so
|
|
70
|
+
# treat it as optional.
|
|
71
|
+
event: nil,
|
|
72
|
+
# The event family, for example message, templates or contact. Route on this
|
|
73
|
+
# first, then on event for the specific change.
|
|
74
|
+
field: nil,
|
|
75
|
+
# Body of a call.initiated, call.answered, call.completed, call.failed or
|
|
76
|
+
# call.recording_ready event. Which of them occurred is the envelope's event.
|
|
77
|
+
#
|
|
78
|
+
# Shaped like the message, inbound, template and channel payloads: account_id
|
|
79
|
+
# names the account the event is about, channel names the channel, and updated_at
|
|
80
|
+
# is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
|
|
81
|
+
# duration_seconds and price are added on call.completed, reason on call.failed
|
|
82
|
+
# and recording_id on call.recording_ready; each is omitted rather than sent as
|
|
83
|
+
# null when it does not apply.
|
|
84
|
+
#
|
|
85
|
+
# Casing is snake_case because these ride the same webhook stream customers
|
|
86
|
+
# already parse message_id from; the question/answer contract is a separate
|
|
87
|
+
# surface and stays camelCase. Nothing here is provider-shaped: no provider call
|
|
88
|
+
# id, no namespaced identity.
|
|
89
|
+
payload: nil,
|
|
90
|
+
# The event-specific body.
|
|
91
|
+
request_id: nil,
|
|
92
|
+
# When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
|
|
93
|
+
# time, not the time the underlying change happened. Use the timestamp inside the
|
|
94
|
+
# payload for the latter.
|
|
95
|
+
timestamp: nil
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
sig do
|
|
100
|
+
override.returns(
|
|
101
|
+
{
|
|
102
|
+
event: T.nilable(String),
|
|
103
|
+
field: String,
|
|
104
|
+
payload: T.nilable(Sentdm::CallEventPayload),
|
|
105
|
+
request_id: T.nilable(String),
|
|
106
|
+
timestamp: String
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
def to_hash
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class CallEventPayload < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Sentdm::CallEventPayload, Sentdm::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Sent's call id, the same one the customer saw on the first question.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :call_id
|
|
14
|
+
|
|
15
|
+
# The account the call belongs to: the key's own customer, or the sender profile
|
|
16
|
+
# it acted as.
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :account_id
|
|
19
|
+
|
|
20
|
+
sig { params(account_id: String).void }
|
|
21
|
+
attr_writer :account_id
|
|
22
|
+
|
|
23
|
+
# Always voice.
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_reader :channel
|
|
26
|
+
|
|
27
|
+
sig { params(channel: String).void }
|
|
28
|
+
attr_writer :channel
|
|
29
|
+
|
|
30
|
+
# How long the call lasted. Only on call.completed.
|
|
31
|
+
sig { returns(T.nilable(Integer)) }
|
|
32
|
+
attr_accessor :duration_seconds
|
|
33
|
+
|
|
34
|
+
# The customer number that owns the call, in E.164 format.
|
|
35
|
+
sig { returns(T.nilable(String)) }
|
|
36
|
+
attr_reader :number
|
|
37
|
+
|
|
38
|
+
sig { params(number: String).void }
|
|
39
|
+
attr_writer :number
|
|
40
|
+
|
|
41
|
+
# What the call was charged. Only on call.completed, and omitted there until
|
|
42
|
+
# billing has recorded the charge.
|
|
43
|
+
sig { returns(T.nilable(Float)) }
|
|
44
|
+
attr_accessor :price
|
|
45
|
+
|
|
46
|
+
# The machine-readable reason the call did not complete. Only on call.failed, and
|
|
47
|
+
# omitted when no reason was recorded.
|
|
48
|
+
sig { returns(T.nilable(String)) }
|
|
49
|
+
attr_accessor :reason
|
|
50
|
+
|
|
51
|
+
# The recording that became available, the same id GET /v3/calls/{id}/recordings
|
|
52
|
+
# lists it under. Only on call.recording_ready, which is sent once per recording.
|
|
53
|
+
sig { returns(T.nilable(String)) }
|
|
54
|
+
attr_accessor :recording_id
|
|
55
|
+
|
|
56
|
+
# When the change happened on the call, as opposed to when the event was emitted.
|
|
57
|
+
sig { returns(T.nilable(String)) }
|
|
58
|
+
attr_reader :updated_at
|
|
59
|
+
|
|
60
|
+
sig { params(updated_at: String).void }
|
|
61
|
+
attr_writer :updated_at
|
|
62
|
+
|
|
63
|
+
# Body of a call.initiated, call.answered, call.completed, call.failed or
|
|
64
|
+
# call.recording_ready event. Which of them occurred is the envelope's event.
|
|
65
|
+
#
|
|
66
|
+
# Shaped like the message, inbound, template and channel payloads: account_id
|
|
67
|
+
# names the account the event is about, channel names the channel, and updated_at
|
|
68
|
+
# is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
|
|
69
|
+
# duration_seconds and price are added on call.completed, reason on call.failed
|
|
70
|
+
# and recording_id on call.recording_ready; each is omitted rather than sent as
|
|
71
|
+
# null when it does not apply.
|
|
72
|
+
#
|
|
73
|
+
# Casing is snake_case because these ride the same webhook stream customers
|
|
74
|
+
# already parse message_id from; the question/answer contract is a separate
|
|
75
|
+
# surface and stays camelCase. Nothing here is provider-shaped: no provider call
|
|
76
|
+
# id, no namespaced identity.
|
|
77
|
+
sig do
|
|
78
|
+
params(
|
|
79
|
+
call_id: String,
|
|
80
|
+
account_id: String,
|
|
81
|
+
channel: String,
|
|
82
|
+
duration_seconds: T.nilable(Integer),
|
|
83
|
+
number: String,
|
|
84
|
+
price: T.nilable(Float),
|
|
85
|
+
reason: T.nilable(String),
|
|
86
|
+
recording_id: T.nilable(String),
|
|
87
|
+
updated_at: String
|
|
88
|
+
).returns(T.attached_class)
|
|
89
|
+
end
|
|
90
|
+
def self.new(
|
|
91
|
+
# Sent's call id, the same one the customer saw on the first question.
|
|
92
|
+
call_id:,
|
|
93
|
+
# The account the call belongs to: the key's own customer, or the sender profile
|
|
94
|
+
# it acted as.
|
|
95
|
+
account_id: nil,
|
|
96
|
+
# Always voice.
|
|
97
|
+
channel: nil,
|
|
98
|
+
# How long the call lasted. Only on call.completed.
|
|
99
|
+
duration_seconds: nil,
|
|
100
|
+
# The customer number that owns the call, in E.164 format.
|
|
101
|
+
number: nil,
|
|
102
|
+
# What the call was charged. Only on call.completed, and omitted there until
|
|
103
|
+
# billing has recorded the charge.
|
|
104
|
+
price: nil,
|
|
105
|
+
# The machine-readable reason the call did not complete. Only on call.failed, and
|
|
106
|
+
# omitted when no reason was recorded.
|
|
107
|
+
reason: nil,
|
|
108
|
+
# The recording that became available, the same id GET /v3/calls/{id}/recordings
|
|
109
|
+
# lists it under. Only on call.recording_ready, which is sent once per recording.
|
|
110
|
+
recording_id: nil,
|
|
111
|
+
# When the change happened on the call, as opposed to when the event was emitted.
|
|
112
|
+
updated_at: nil
|
|
113
|
+
)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
sig do
|
|
117
|
+
override.returns(
|
|
118
|
+
{
|
|
119
|
+
call_id: String,
|
|
120
|
+
account_id: String,
|
|
121
|
+
channel: String,
|
|
122
|
+
duration_seconds: T.nilable(Integer),
|
|
123
|
+
number: String,
|
|
124
|
+
price: T.nilable(Float),
|
|
125
|
+
reason: T.nilable(String),
|
|
126
|
+
recording_id: T.nilable(String),
|
|
127
|
+
updated_at: String
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
end
|
|
131
|
+
def to_hash
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class CallHangupParams < Sentdm::Models::MutationRequest
|
|
6
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Sentdm::CallHangupParams, Sentdm::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :idempotency_key
|
|
19
|
+
|
|
20
|
+
sig { params(idempotency_key: String).void }
|
|
21
|
+
attr_writer :idempotency_key
|
|
22
|
+
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_reader :x_profile_id
|
|
25
|
+
|
|
26
|
+
sig { params(x_profile_id: String).void }
|
|
27
|
+
attr_writer :x_profile_id
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
params(
|
|
31
|
+
id: String,
|
|
32
|
+
idempotency_key: String,
|
|
33
|
+
x_profile_id: String,
|
|
34
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
35
|
+
).returns(T.attached_class)
|
|
36
|
+
end
|
|
37
|
+
def self.new(
|
|
38
|
+
id:,
|
|
39
|
+
idempotency_key: nil,
|
|
40
|
+
x_profile_id: nil,
|
|
41
|
+
request_options: {}
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
sig do
|
|
46
|
+
override.returns(
|
|
47
|
+
{
|
|
48
|
+
id: String,
|
|
49
|
+
idempotency_key: String,
|
|
50
|
+
x_profile_id: String,
|
|
51
|
+
request_options: Sentdm::RequestOptions
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
def to_hash
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class CallListParams < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Sentdm::CallListParams, Sentdm::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Optional direction filter: outbound for calls placed from your app, inbound for
|
|
15
|
+
# calls to one of your numbers
|
|
16
|
+
sig { returns(T.nilable(String)) }
|
|
17
|
+
attr_accessor :direction
|
|
18
|
+
|
|
19
|
+
# Only calls started at or after this time (ISO 8601)
|
|
20
|
+
sig { returns(T.nilable(Time)) }
|
|
21
|
+
attr_accessor :from
|
|
22
|
+
|
|
23
|
+
# Optional filter on the number that owns the call, one of your voice-enabled
|
|
24
|
+
# numbers in E.164 format
|
|
25
|
+
sig { returns(T.nilable(String)) }
|
|
26
|
+
attr_accessor :number
|
|
27
|
+
|
|
28
|
+
# Page number (1-indexed)
|
|
29
|
+
sig { returns(T.nilable(Integer)) }
|
|
30
|
+
attr_reader :page
|
|
31
|
+
|
|
32
|
+
sig { params(page: Integer).void }
|
|
33
|
+
attr_writer :page
|
|
34
|
+
|
|
35
|
+
# Number of items per page
|
|
36
|
+
sig { returns(T.nilable(Integer)) }
|
|
37
|
+
attr_reader :page_size
|
|
38
|
+
|
|
39
|
+
sig { params(page_size: Integer).void }
|
|
40
|
+
attr_writer :page_size
|
|
41
|
+
|
|
42
|
+
# Optional status filter: initiated, ringing, answered, completed, failed,
|
|
43
|
+
# no_answer or rejected
|
|
44
|
+
sig { returns(T.nilable(String)) }
|
|
45
|
+
attr_accessor :status
|
|
46
|
+
|
|
47
|
+
# Only calls started at or before this time (ISO 8601)
|
|
48
|
+
sig { returns(T.nilable(Time)) }
|
|
49
|
+
attr_accessor :to
|
|
50
|
+
|
|
51
|
+
sig { returns(T.nilable(String)) }
|
|
52
|
+
attr_reader :x_profile_id
|
|
53
|
+
|
|
54
|
+
sig { params(x_profile_id: String).void }
|
|
55
|
+
attr_writer :x_profile_id
|
|
56
|
+
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
direction: T.nilable(String),
|
|
60
|
+
from: T.nilable(Time),
|
|
61
|
+
number: T.nilable(String),
|
|
62
|
+
page: Integer,
|
|
63
|
+
page_size: Integer,
|
|
64
|
+
status: T.nilable(String),
|
|
65
|
+
to: T.nilable(Time),
|
|
66
|
+
x_profile_id: String,
|
|
67
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
68
|
+
).returns(T.attached_class)
|
|
69
|
+
end
|
|
70
|
+
def self.new(
|
|
71
|
+
# Optional direction filter: outbound for calls placed from your app, inbound for
|
|
72
|
+
# calls to one of your numbers
|
|
73
|
+
direction: nil,
|
|
74
|
+
# Only calls started at or after this time (ISO 8601)
|
|
75
|
+
from: nil,
|
|
76
|
+
# Optional filter on the number that owns the call, one of your voice-enabled
|
|
77
|
+
# numbers in E.164 format
|
|
78
|
+
number: nil,
|
|
79
|
+
# Page number (1-indexed)
|
|
80
|
+
page: nil,
|
|
81
|
+
# Number of items per page
|
|
82
|
+
page_size: nil,
|
|
83
|
+
# Optional status filter: initiated, ringing, answered, completed, failed,
|
|
84
|
+
# no_answer or rejected
|
|
85
|
+
status: nil,
|
|
86
|
+
# Only calls started at or before this time (ISO 8601)
|
|
87
|
+
to: nil,
|
|
88
|
+
x_profile_id: nil,
|
|
89
|
+
request_options: {}
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
sig do
|
|
94
|
+
override.returns(
|
|
95
|
+
{
|
|
96
|
+
direction: T.nilable(String),
|
|
97
|
+
from: T.nilable(Time),
|
|
98
|
+
number: T.nilable(String),
|
|
99
|
+
page: Integer,
|
|
100
|
+
page_size: Integer,
|
|
101
|
+
status: T.nilable(String),
|
|
102
|
+
to: T.nilable(Time),
|
|
103
|
+
x_profile_id: String,
|
|
104
|
+
request_options: Sentdm::RequestOptions
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
end
|
|
108
|
+
def to_hash
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class CallListRecordingsParams < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Sentdm::CallListRecordingsParams, Sentdm::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :x_profile_id
|
|
19
|
+
|
|
20
|
+
sig { params(x_profile_id: String).void }
|
|
21
|
+
attr_writer :x_profile_id
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
id: String,
|
|
26
|
+
x_profile_id: String,
|
|
27
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
28
|
+
).returns(T.attached_class)
|
|
29
|
+
end
|
|
30
|
+
def self.new(id:, x_profile_id: nil, request_options: {})
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
override.returns(
|
|
35
|
+
{
|
|
36
|
+
id: String,
|
|
37
|
+
x_profile_id: String,
|
|
38
|
+
request_options: Sentdm::RequestOptions
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class CallParty < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Sentdm::CallParty, Sentdm::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# user for one of your app users, number for a phone number, conference for a
|
|
10
|
+
# room, anonymous for a caller who withheld their number
|
|
11
|
+
sig { returns(T.nilable(String)) }
|
|
12
|
+
attr_reader :kind
|
|
13
|
+
|
|
14
|
+
sig { params(kind: String).void }
|
|
15
|
+
attr_writer :kind
|
|
16
|
+
|
|
17
|
+
# The app user's identity, the phone number in E.164 format, or the room name.
|
|
18
|
+
# Null when the kind is anonymous
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_accessor :value
|
|
21
|
+
|
|
22
|
+
# One end of a call
|
|
23
|
+
sig do
|
|
24
|
+
params(kind: String, value: T.nilable(String)).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(
|
|
27
|
+
# user for one of your app users, number for a phone number, conference for a
|
|
28
|
+
# room, anonymous for a caller who withheld their number
|
|
29
|
+
kind: nil,
|
|
30
|
+
# The app user's identity, the phone number in E.164 format, or the room name.
|
|
31
|
+
# Null when the kind is anonymous
|
|
32
|
+
value: nil
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
sig { override.returns({ kind: String, value: T.nilable(String) }) }
|
|
37
|
+
def to_hash
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class CallRecordParams < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Sentdm::CallRecordParams, Sentdm::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
# start to begin recording, stop to end it
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
attr_reader :action
|
|
20
|
+
|
|
21
|
+
sig { params(action: String).void }
|
|
22
|
+
attr_writer :action
|
|
23
|
+
|
|
24
|
+
# Sandbox flag - when true, the operation is simulated without side effects Useful
|
|
25
|
+
# for testing integrations without actual execution
|
|
26
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
27
|
+
attr_reader :sandbox
|
|
28
|
+
|
|
29
|
+
sig { params(sandbox: T::Boolean).void }
|
|
30
|
+
attr_writer :sandbox
|
|
31
|
+
|
|
32
|
+
sig { returns(T.nilable(String)) }
|
|
33
|
+
attr_reader :idempotency_key
|
|
34
|
+
|
|
35
|
+
sig { params(idempotency_key: String).void }
|
|
36
|
+
attr_writer :idempotency_key
|
|
37
|
+
|
|
38
|
+
sig { returns(T.nilable(String)) }
|
|
39
|
+
attr_reader :x_profile_id
|
|
40
|
+
|
|
41
|
+
sig { params(x_profile_id: String).void }
|
|
42
|
+
attr_writer :x_profile_id
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
id: String,
|
|
47
|
+
action: String,
|
|
48
|
+
sandbox: T::Boolean,
|
|
49
|
+
idempotency_key: String,
|
|
50
|
+
x_profile_id: String,
|
|
51
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
52
|
+
).returns(T.attached_class)
|
|
53
|
+
end
|
|
54
|
+
def self.new(
|
|
55
|
+
id:,
|
|
56
|
+
# start to begin recording, stop to end it
|
|
57
|
+
action: nil,
|
|
58
|
+
# Sandbox flag - when true, the operation is simulated without side effects Useful
|
|
59
|
+
# for testing integrations without actual execution
|
|
60
|
+
sandbox: nil,
|
|
61
|
+
idempotency_key: nil,
|
|
62
|
+
x_profile_id: nil,
|
|
63
|
+
request_options: {}
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
override.returns(
|
|
69
|
+
{
|
|
70
|
+
id: String,
|
|
71
|
+
action: String,
|
|
72
|
+
sandbox: T::Boolean,
|
|
73
|
+
idempotency_key: String,
|
|
74
|
+
x_profile_id: String,
|
|
75
|
+
request_options: Sentdm::RequestOptions
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
def to_hash
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class CallRecording < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Sentdm::CallRecording, Sentdm::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
# A pre-signed link that downloads the recording as an MP3 file. Anyone holding it
|
|
10
|
+
# can download the recording until it expires
|
|
11
|
+
sig { returns(T.nilable(String)) }
|
|
12
|
+
attr_reader :download_url
|
|
13
|
+
|
|
14
|
+
sig { params(download_url: String).void }
|
|
15
|
+
attr_writer :download_url
|
|
16
|
+
|
|
17
|
+
# The recording's id, the one the call.recording_ready webhook announced it under
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
attr_reader :recording_id
|
|
20
|
+
|
|
21
|
+
sig { params(recording_id: String).void }
|
|
22
|
+
attr_writer :recording_id
|
|
23
|
+
|
|
24
|
+
# When the link stops working (UTC). Request the recordings again for a fresh link
|
|
25
|
+
sig { returns(T.nilable(Time)) }
|
|
26
|
+
attr_reader :url_expires_at
|
|
27
|
+
|
|
28
|
+
sig { params(url_expires_at: Time).void }
|
|
29
|
+
attr_writer :url_expires_at
|
|
30
|
+
|
|
31
|
+
# A short-lived link to a call recording
|
|
32
|
+
sig do
|
|
33
|
+
params(
|
|
34
|
+
download_url: String,
|
|
35
|
+
recording_id: String,
|
|
36
|
+
url_expires_at: Time
|
|
37
|
+
).returns(T.attached_class)
|
|
38
|
+
end
|
|
39
|
+
def self.new(
|
|
40
|
+
# A pre-signed link that downloads the recording as an MP3 file. Anyone holding it
|
|
41
|
+
# can download the recording until it expires
|
|
42
|
+
download_url: nil,
|
|
43
|
+
# The recording's id, the one the call.recording_ready webhook announced it under
|
|
44
|
+
recording_id: nil,
|
|
45
|
+
# When the link stops working (UTC). Request the recordings again for a fresh link
|
|
46
|
+
url_expires_at: nil
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
sig do
|
|
51
|
+
override.returns(
|
|
52
|
+
{ download_url: String, recording_id: String, url_expires_at: Time }
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
def to_hash
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class CallRecordings < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Sentdm::CallRecordings, Sentdm::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Every recording of the call, oldest first. Empty until the first
|
|
12
|
+
# call.recording_ready webhook has been sent, and for a call that was never
|
|
13
|
+
# recorded
|
|
14
|
+
sig { returns(T.nilable(T::Array[Sentdm::CallRecording])) }
|
|
15
|
+
attr_reader :recordings
|
|
16
|
+
|
|
17
|
+
sig { params(recordings: T::Array[Sentdm::CallRecording::OrHash]).void }
|
|
18
|
+
attr_writer :recordings
|
|
19
|
+
|
|
20
|
+
# The recordings of a call, each as a short-lived download link
|
|
21
|
+
sig do
|
|
22
|
+
params(recordings: T::Array[Sentdm::CallRecording::OrHash]).returns(
|
|
23
|
+
T.attached_class
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
def self.new(
|
|
27
|
+
# Every recording of the call, oldest first. Empty until the first
|
|
28
|
+
# call.recording_ready webhook has been sent, and for a call that was never
|
|
29
|
+
# recorded
|
|
30
|
+
recordings: nil
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig { override.returns({ recordings: T::Array[Sentdm::CallRecording] }) }
|
|
35
|
+
def to_hash
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|