sentdm 0.38.1 → 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.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/client.rb +3 -20
  5. data/lib/sentdm/models/call_event_payload.rb +4 -3
  6. data/lib/sentdm/models/message_send_params.rb +8 -1
  7. data/lib/sentdm/models/template.rb +6 -5
  8. data/lib/sentdm/models/template_body.rb +8 -8
  9. data/lib/sentdm/models/{calls/api_response_of_list_of_call_participant.rb → voice/api_response_of_call.rb} +7 -7
  10. data/lib/sentdm/models/voice/api_response_of_call_recordings.rb +45 -0
  11. data/lib/sentdm/models/voice/api_response_of_calls_list.rb +44 -0
  12. data/lib/sentdm/models/{channels → voice}/api_response_of_voice_token.rb +5 -5
  13. data/lib/sentdm/models/voice/call.rb +149 -0
  14. data/lib/sentdm/models/{calls/participant_remove_params.rb → voice/call_hangup_params.rb} +8 -8
  15. data/lib/sentdm/models/voice/call_list_params.rb +85 -0
  16. data/lib/sentdm/models/{calls/participant_remove_all_params.rb → voice/call_list_recordings_params.rb} +3 -3
  17. data/lib/sentdm/models/voice/call_party.rb +33 -0
  18. data/lib/sentdm/models/{calls/participant_update_params.rb → voice/call_record_params.rb} +10 -17
  19. data/lib/sentdm/models/voice/call_recording.rb +40 -0
  20. data/lib/sentdm/models/voice/call_recordings.rb +26 -0
  21. data/lib/sentdm/models/{calls/participant_list_params.rb → voice/call_retrieve_params.rb} +3 -3
  22. data/lib/sentdm/models/voice/call_timeline_entry.rb +28 -0
  23. data/lib/sentdm/models/voice/calls/api_response_of_list_of_call_participant.rb +51 -0
  24. data/lib/sentdm/models/voice/calls/call_participant.rb +62 -0
  25. data/lib/sentdm/models/voice/calls/call_participant_target.rb +32 -0
  26. data/lib/sentdm/models/voice/calls/participant_add_params.rb +68 -0
  27. data/lib/sentdm/models/voice/calls/participant_list_params.rb +30 -0
  28. data/lib/sentdm/models/voice/calls/participant_remove_all_params.rb +30 -0
  29. data/lib/sentdm/models/voice/calls/participant_remove_params.rb +36 -0
  30. data/lib/sentdm/models/voice/calls/participant_update_params.rb +66 -0
  31. data/lib/sentdm/models/voice/calls_list.rb +28 -0
  32. data/lib/sentdm/models/{channels/voice_create_token_params.rb → voice/token_create_params.rb} +4 -4
  33. data/lib/sentdm/models/{channels → voice}/voice_token.rb +9 -3
  34. data/lib/sentdm/models.rb +2 -30
  35. data/lib/sentdm/resources/channels/voice.rb +13 -56
  36. data/lib/sentdm/resources/channels.rb +2 -2
  37. data/lib/sentdm/resources/voice/calls/participants.rb +233 -0
  38. data/lib/sentdm/resources/voice/calls.rb +238 -0
  39. data/lib/sentdm/resources/voice/tokens.rb +75 -0
  40. data/lib/sentdm/resources/voice.rb +56 -0
  41. data/lib/sentdm/version.rb +1 -1
  42. data/lib/sentdm.rb +30 -28
  43. data/rbi/sentdm/client.rbi +2 -19
  44. data/rbi/sentdm/models/call_event_payload.rbi +6 -4
  45. data/rbi/sentdm/models/message_send_params.rbi +16 -2
  46. data/rbi/sentdm/models/template.rbi +12 -10
  47. data/rbi/sentdm/models/template_body.rbi +12 -12
  48. data/rbi/sentdm/models/voice/api_response_of_call.rbi +76 -0
  49. data/rbi/sentdm/models/voice/api_response_of_call_recordings.rbi +81 -0
  50. data/rbi/sentdm/models/{calls/api_response_of_list_of_call_participant.rbi → voice/api_response_of_calls_list.rbi} +12 -9
  51. data/rbi/sentdm/models/{channels → voice}/api_response_of_voice_token.rbi +6 -8
  52. data/rbi/sentdm/models/voice/call.rbi +196 -0
  53. data/rbi/sentdm/models/{calls/participant_remove_params.rbi → voice/call_hangup_params.rbi} +11 -11
  54. data/rbi/sentdm/models/voice/call_list_params.rbi +114 -0
  55. data/rbi/sentdm/models/{calls/participant_list_params.rbi → voice/call_list_recordings_params.rbi} +3 -3
  56. data/rbi/sentdm/models/voice/call_party.rbi +47 -0
  57. data/rbi/sentdm/models/{calls/participant_update_params.rbi → voice/call_record_params.rbi} +12 -21
  58. data/rbi/sentdm/models/voice/call_recording.rbi +63 -0
  59. data/rbi/sentdm/models/voice/call_recordings.rbi +49 -0
  60. data/rbi/sentdm/models/{calls/participant_remove_all_params.rbi → voice/call_retrieve_params.rbi} +3 -6
  61. data/rbi/sentdm/models/voice/call_timeline_entry.rbi +44 -0
  62. data/rbi/sentdm/models/voice/calls/api_response_of_list_of_call_participant.rbi +84 -0
  63. data/rbi/sentdm/models/voice/calls/call_participant.rbi +97 -0
  64. data/rbi/sentdm/models/voice/calls/call_participant_target.rbi +49 -0
  65. data/rbi/sentdm/models/voice/calls/participant_add_params.rbi +104 -0
  66. data/rbi/sentdm/models/voice/calls/participant_list_params.rbi +53 -0
  67. data/rbi/sentdm/models/voice/calls/participant_remove_all_params.rbi +53 -0
  68. data/rbi/sentdm/models/voice/calls/participant_remove_params.rbi +63 -0
  69. data/rbi/sentdm/models/voice/calls/participant_update_params.rbi +96 -0
  70. data/rbi/sentdm/models/voice/calls_list.rbi +54 -0
  71. data/rbi/sentdm/models/{channels/voice_create_token_params.rbi → voice/token_create_params.rbi} +3 -6
  72. data/rbi/sentdm/models/{channels → voice}/voice_token.rbi +8 -4
  73. data/rbi/sentdm/models.rbi +2 -30
  74. data/rbi/sentdm/resources/channels/voice.rbi +13 -56
  75. data/rbi/sentdm/resources/channels.rbi +2 -2
  76. data/rbi/sentdm/resources/messages.rbi +8 -1
  77. data/rbi/sentdm/resources/voice/calls/participants.rbi +201 -0
  78. data/rbi/sentdm/resources/voice/calls.rbi +209 -0
  79. data/rbi/sentdm/resources/voice/tokens.rbi +73 -0
  80. data/rbi/sentdm/resources/voice.rbi +52 -0
  81. data/sig/sentdm/client.rbs +1 -1
  82. data/sig/sentdm/models/{calls/api_response_of_list_of_call_participant.rbs → voice/api_response_of_call.rbs} +7 -7
  83. data/sig/sentdm/models/voice/api_response_of_call_recordings.rbs +41 -0
  84. data/sig/sentdm/models/voice/api_response_of_calls_list.rbs +41 -0
  85. data/sig/sentdm/models/{channels → voice}/api_response_of_voice_token.rbs +5 -5
  86. data/sig/sentdm/models/voice/call.rbs +110 -0
  87. data/sig/sentdm/models/{calls/participant_remove_params.rbs → voice/call_hangup_params.rbs} +8 -8
  88. data/sig/sentdm/models/voice/call_list_params.rbs +69 -0
  89. data/sig/sentdm/models/{calls/participant_remove_all_params.rbs → voice/call_list_recordings_params.rbs} +6 -8
  90. data/sig/sentdm/models/voice/call_party.rbs +19 -0
  91. data/sig/sentdm/models/{calls/participant_update_params.rbs → voice/call_record_params.rbs} +8 -13
  92. data/sig/sentdm/models/voice/call_recording.rbs +34 -0
  93. data/sig/sentdm/models/voice/call_recordings.rbs +22 -0
  94. data/sig/sentdm/models/{calls/participant_list_params.rbs → voice/call_retrieve_params.rbs} +3 -3
  95. data/sig/sentdm/models/voice/call_timeline_entry.rbs +21 -0
  96. data/sig/sentdm/models/voice/calls/api_response_of_list_of_call_participant.rbs +43 -0
  97. data/sig/sentdm/models/voice/calls/call_participant.rbs +54 -0
  98. data/sig/sentdm/models/voice/calls/call_participant_target.rbs +25 -0
  99. data/sig/sentdm/models/voice/calls/participant_add_params.rbs +65 -0
  100. data/sig/sentdm/models/voice/calls/participant_list_params.rbs +34 -0
  101. data/sig/sentdm/models/voice/calls/participant_remove_all_params.rbs +36 -0
  102. data/sig/sentdm/models/voice/calls/participant_remove_params.rbs +42 -0
  103. data/sig/sentdm/models/voice/calls/participant_update_params.rbs +63 -0
  104. data/sig/sentdm/models/voice/calls_list.rbs +33 -0
  105. data/sig/sentdm/models/{channels/voice_create_token_params.rbs → voice/token_create_params.rbs} +3 -3
  106. data/sig/sentdm/models/{channels → voice}/voice_token.rbs +3 -1
  107. data/sig/sentdm/models.rbs +2 -30
  108. data/sig/sentdm/resources/channels/voice.rbs +0 -10
  109. data/sig/sentdm/resources/voice/calls/participants.rbs +52 -0
  110. data/sig/sentdm/resources/{calls/participants.rbs → voice/calls.rbs} +23 -21
  111. data/sig/sentdm/resources/voice/tokens.rbs +19 -0
  112. data/sig/sentdm/resources/voice.rbs +11 -0
  113. metadata +89 -83
  114. data/lib/sentdm/models/api_response_of_call.rb +0 -43
  115. data/lib/sentdm/models/api_response_of_call_recordings.rb +0 -43
  116. data/lib/sentdm/models/api_response_of_calls_list.rb +0 -42
  117. data/lib/sentdm/models/call.rb +0 -134
  118. data/lib/sentdm/models/call_hangup_params.rb +0 -32
  119. data/lib/sentdm/models/call_list_params.rb +0 -83
  120. data/lib/sentdm/models/call_list_recordings_params.rb +0 -26
  121. data/lib/sentdm/models/call_party.rb +0 -31
  122. data/lib/sentdm/models/call_record_params.rb +0 -55
  123. data/lib/sentdm/models/call_recording.rb +0 -38
  124. data/lib/sentdm/models/call_recordings.rb +0 -24
  125. data/lib/sentdm/models/call_retrieve_params.rb +0 -26
  126. data/lib/sentdm/models/call_timeline_entry.rb +0 -26
  127. data/lib/sentdm/models/calls/call_participant.rb +0 -60
  128. data/lib/sentdm/models/calls/call_participant_target.rb +0 -30
  129. data/lib/sentdm/models/calls/participant_add_params.rb +0 -66
  130. data/lib/sentdm/models/calls_list.rb +0 -26
  131. data/lib/sentdm/resources/calls/participants.rb +0 -231
  132. data/lib/sentdm/resources/calls.rb +0 -236
  133. data/rbi/sentdm/models/api_response_of_call.rbi +0 -74
  134. data/rbi/sentdm/models/api_response_of_call_recordings.rbi +0 -74
  135. data/rbi/sentdm/models/api_response_of_calls_list.rbi +0 -74
  136. data/rbi/sentdm/models/call.rbi +0 -179
  137. data/rbi/sentdm/models/call_hangup_params.rbi +0 -59
  138. data/rbi/sentdm/models/call_list_params.rbi +0 -112
  139. data/rbi/sentdm/models/call_list_recordings_params.rbi +0 -46
  140. data/rbi/sentdm/models/call_party.rbi +0 -41
  141. data/rbi/sentdm/models/call_record_params.rbi +0 -83
  142. data/rbi/sentdm/models/call_recording.rbi +0 -59
  143. data/rbi/sentdm/models/call_recordings.rbi +0 -39
  144. data/rbi/sentdm/models/call_retrieve_params.rbi +0 -46
  145. data/rbi/sentdm/models/call_timeline_entry.rbi +0 -40
  146. data/rbi/sentdm/models/calls/call_participant.rbi +0 -92
  147. data/rbi/sentdm/models/calls/call_participant_target.rbi +0 -47
  148. data/rbi/sentdm/models/calls/participant_add_params.rbi +0 -98
  149. data/rbi/sentdm/models/calls_list.rbi +0 -47
  150. data/rbi/sentdm/resources/calls/participants.rbi +0 -199
  151. data/rbi/sentdm/resources/calls.rbi +0 -207
  152. data/sig/sentdm/models/api_response_of_call.rbs +0 -39
  153. data/sig/sentdm/models/api_response_of_call_recordings.rbs +0 -39
  154. data/sig/sentdm/models/api_response_of_calls_list.rbs +0 -39
  155. data/sig/sentdm/models/call.rbs +0 -101
  156. data/sig/sentdm/models/call_hangup_params.rbs +0 -38
  157. data/sig/sentdm/models/call_list_params.rbs +0 -67
  158. data/sig/sentdm/models/call_list_recordings_params.rbs +0 -30
  159. data/sig/sentdm/models/call_party.rbs +0 -17
  160. data/sig/sentdm/models/call_record_params.rbs +0 -54
  161. data/sig/sentdm/models/call_recording.rbs +0 -32
  162. data/sig/sentdm/models/call_recordings.rbs +0 -17
  163. data/sig/sentdm/models/call_retrieve_params.rbs +0 -30
  164. data/sig/sentdm/models/call_timeline_entry.rbs +0 -19
  165. data/sig/sentdm/models/calls/call_participant.rbs +0 -52
  166. data/sig/sentdm/models/calls/call_participant_target.rbs +0 -23
  167. data/sig/sentdm/models/calls/participant_add_params.rbs +0 -63
  168. data/sig/sentdm/models/calls_list.rbs +0 -26
  169. data/sig/sentdm/resources/calls.rbs +0 -50
@@ -0,0 +1,96 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Voice
6
+ module Calls
7
+ class ParticipantUpdateParams < Sentdm::Internal::Type::BaseModel
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ OrHash =
12
+ T.type_alias do
13
+ T.any(
14
+ Sentdm::Voice::Calls::ParticipantUpdateParams,
15
+ Sentdm::Internal::AnyHash
16
+ )
17
+ end
18
+
19
+ sig { returns(String) }
20
+ attr_accessor :id
21
+
22
+ sig { returns(String) }
23
+ attr_accessor :participant_id
24
+
25
+ # true to mute the participant, false to unmute them
26
+ sig { returns(T.nilable(T::Boolean)) }
27
+ attr_reader :muted
28
+
29
+ sig { params(muted: T::Boolean).void }
30
+ attr_writer :muted
31
+
32
+ # Sandbox flag - when true, the operation is simulated without side effects Useful
33
+ # for testing integrations without actual execution
34
+ sig { returns(T.nilable(T::Boolean)) }
35
+ attr_reader :sandbox
36
+
37
+ sig { params(sandbox: T::Boolean).void }
38
+ attr_writer :sandbox
39
+
40
+ sig { returns(T.nilable(String)) }
41
+ attr_reader :idempotency_key
42
+
43
+ sig { params(idempotency_key: String).void }
44
+ attr_writer :idempotency_key
45
+
46
+ sig { returns(T.nilable(String)) }
47
+ attr_reader :x_profile_id
48
+
49
+ sig { params(x_profile_id: String).void }
50
+ attr_writer :x_profile_id
51
+
52
+ sig do
53
+ params(
54
+ id: String,
55
+ participant_id: String,
56
+ muted: T::Boolean,
57
+ sandbox: T::Boolean,
58
+ idempotency_key: String,
59
+ x_profile_id: String,
60
+ request_options: Sentdm::RequestOptions::OrHash
61
+ ).returns(T.attached_class)
62
+ end
63
+ def self.new(
64
+ id:,
65
+ participant_id:,
66
+ # true to mute the participant, false to unmute them
67
+ muted: nil,
68
+ # Sandbox flag - when true, the operation is simulated without side effects Useful
69
+ # for testing integrations without actual execution
70
+ sandbox: nil,
71
+ idempotency_key: nil,
72
+ x_profile_id: nil,
73
+ request_options: {}
74
+ )
75
+ end
76
+
77
+ sig do
78
+ override.returns(
79
+ {
80
+ id: String,
81
+ participant_id: String,
82
+ muted: T::Boolean,
83
+ sandbox: T::Boolean,
84
+ idempotency_key: String,
85
+ x_profile_id: String,
86
+ request_options: Sentdm::RequestOptions
87
+ }
88
+ )
89
+ end
90
+ def to_hash
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Voice
6
+ class CallsList < Sentdm::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(Sentdm::Voice::CallsList, Sentdm::Internal::AnyHash)
10
+ end
11
+
12
+ # The calls on this page, most recent first
13
+ sig { returns(T.nilable(T::Array[Sentdm::Voice::Call])) }
14
+ attr_reader :calls
15
+
16
+ sig { params(calls: T::Array[Sentdm::Voice::Call::OrHash]).void }
17
+ attr_writer :calls
18
+
19
+ # Pagination metadata for list responses
20
+ sig { returns(T.nilable(Sentdm::PaginationMeta)) }
21
+ attr_reader :pagination
22
+
23
+ sig { params(pagination: Sentdm::PaginationMeta::OrHash).void }
24
+ attr_writer :pagination
25
+
26
+ # Paginated list of calls
27
+ sig do
28
+ params(
29
+ calls: T::Array[Sentdm::Voice::Call::OrHash],
30
+ pagination: Sentdm::PaginationMeta::OrHash
31
+ ).returns(T.attached_class)
32
+ end
33
+ def self.new(
34
+ # The calls on this page, most recent first
35
+ calls: nil,
36
+ # Pagination metadata for list responses
37
+ pagination: nil
38
+ )
39
+ end
40
+
41
+ sig do
42
+ override.returns(
43
+ {
44
+ calls: T::Array[Sentdm::Voice::Call],
45
+ pagination: Sentdm::PaginationMeta
46
+ }
47
+ )
48
+ end
49
+ def to_hash
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -2,17 +2,14 @@
2
2
 
3
3
  module Sentdm
4
4
  module Models
5
- module Channels
6
- class VoiceCreateTokenParams < Sentdm::Internal::Type::BaseModel
5
+ module Voice
6
+ class TokenCreateParams < Sentdm::Internal::Type::BaseModel
7
7
  extend Sentdm::Internal::Type::RequestParameters::Converter
8
8
  include Sentdm::Internal::Type::RequestParameters
9
9
 
10
10
  OrHash =
11
11
  T.type_alias do
12
- T.any(
13
- Sentdm::Channels::VoiceCreateTokenParams,
14
- Sentdm::Internal::AnyHash
15
- )
12
+ T.any(Sentdm::Voice::TokenCreateParams, Sentdm::Internal::AnyHash)
16
13
  end
17
14
 
18
15
  # Your identifier for the app user, such as an agent or account id. Letters,
@@ -2,14 +2,17 @@
2
2
 
3
3
  module Sentdm
4
4
  module Models
5
- module Channels
5
+ VoiceToken = Voice::VoiceToken
6
+
7
+ module Voice
6
8
  class VoiceToken < Sentdm::Internal::Type::BaseModel
7
9
  OrHash =
8
10
  T.type_alias do
9
- T.any(Sentdm::Channels::VoiceToken, Sentdm::Internal::AnyHash)
11
+ T.any(Sentdm::Voice::VoiceToken, Sentdm::Internal::AnyHash)
10
12
  end
11
13
 
12
- # The signed token. Hand it to the client SDK unchanged.
14
+ # The signed token. Hand it to the client SDK unchanged. Treat it as opaque: read
15
+ # the identity, number, and expiry from this response, not from the token.
13
16
  sig { returns(T.nilable(String)) }
14
17
  attr_reader :token
15
18
 
@@ -47,7 +50,8 @@ module Sentdm
47
50
  ).returns(T.attached_class)
48
51
  end
49
52
  def self.new(
50
- # The signed token. Hand it to the client SDK unchanged.
53
+ # The signed token. Hand it to the client SDK unchanged. Treat it as opaque: read
54
+ # the identity, number, and expiry from this response, not from the token.
51
55
  token: nil,
52
56
  # When the token expires (UTC)
53
57
  expires_at: nil,
@@ -3,12 +3,6 @@
3
3
  module Sentdm
4
4
  APIMeta = Sentdm::Models::APIMeta
5
5
 
6
- APIResponseOfCall = Sentdm::Models::APIResponseOfCall
7
-
8
- APIResponseOfCallRecordings = Sentdm::Models::APIResponseOfCallRecordings
9
-
10
- APIResponseOfCallsList = Sentdm::Models::APIResponseOfCallsList
11
-
12
6
  APIResponseOfContact = Sentdm::Models::APIResponseOfContact
13
7
 
14
8
  APIResponseOfContactMessageSummary =
@@ -37,34 +31,10 @@ module Sentdm
37
31
 
38
32
  BrandsBrandData = Sentdm::Models::BrandsBrandData
39
33
 
40
- Call = Sentdm::Models::Call
41
-
42
34
  CallEvent = Sentdm::Models::CallEvent
43
35
 
44
36
  CallEventPayload = Sentdm::Models::CallEventPayload
45
37
 
46
- CallHangupParams = Sentdm::Models::CallHangupParams
47
-
48
- CallListParams = Sentdm::Models::CallListParams
49
-
50
- CallListRecordingsParams = Sentdm::Models::CallListRecordingsParams
51
-
52
- CallParty = Sentdm::Models::CallParty
53
-
54
- CallRecording = Sentdm::Models::CallRecording
55
-
56
- CallRecordings = Sentdm::Models::CallRecordings
57
-
58
- CallRecordParams = Sentdm::Models::CallRecordParams
59
-
60
- CallRetrieveParams = Sentdm::Models::CallRetrieveParams
61
-
62
- Calls = Sentdm::Models::Calls
63
-
64
- CallsList = Sentdm::Models::CallsList
65
-
66
- CallTimelineEntry = Sentdm::Models::CallTimelineEntry
67
-
68
38
  ChannelEvent = Sentdm::Models::ChannelEvent
69
39
 
70
40
  ChannelEventPayload = Sentdm::Models::ChannelEventPayload
@@ -194,6 +164,8 @@ module Sentdm
194
164
 
195
165
  UserUpdateRoleParams = Sentdm::Models::UserUpdateRoleParams
196
166
 
167
+ Voice = Sentdm::Models::Voice
168
+
197
169
  WebhookCreateParams = Sentdm::Models::WebhookCreateParams
198
170
 
199
171
  WebhookDeleteParams = Sentdm::Models::WebhookDeleteParams
@@ -12,8 +12,8 @@ module Sentdm
12
12
  # number**: each number you hold can carry phone calls on its own
13
13
  # (`POST /v3/channels/voice`), each with the callback URL Sent asks what to do
14
14
  # with its calls, one of them is the default line for calls placed from your app,
15
- # and voice tokens are minted under `POST /v3/channels/voice/tokens`. Read your
16
- # voice numbers with `GET /v3/channels/voice` and change one with
15
+ # and voice tokens are minted with `POST /v3/voice/tokens`. Read your voice
16
+ # numbers with `GET /v3/channels/voice` and change one with
17
17
  # `PATCH /v3/channels/voice/{number}`.
18
18
  #
19
19
  # ## Compliance lives on the market
@@ -134,19 +134,23 @@ module Sentdm
134
134
  #
135
135
  # ## What it changes
136
136
  #
137
- # | Body | Effect |
138
- # | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
139
- # | `"status": "ACTIVE"` | turns calls on again for a number you turned off; the callback URL and the secret it had are kept |
140
- # | `"status": "INACTIVE"` | turns calls off; the callback URL and the secret stay on the number |
141
- # | `"default_for_app_calls": true` | makes this the line app-originated calls are placed from when a voice token names no number |
142
- # | `"callback_url": "https://example.com/voice"` | replaces where Sent asks what to do with each call on the number; the signing secret is kept, and a number that was waiting for its first URL is turned on |
143
- # | key omitted | left exactly as it is |
137
+ # | Body | Effect |
138
+ # | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
139
+ # | `"status": "ACTIVE"` | turns calls on again for a number you turned off; the callback URL and the secret it had are kept |
140
+ # | `"status": "INACTIVE"` | turns calls off; the callback URL and the secret stay on the number |
141
+ # | `"default_for_app_calls": true` | makes this the line app-originated calls are placed from when a voice token names no number |
142
+ # | `"callback_url": "https://example.com/voice"` | replaces where Sent asks what to do with each call on the number; the signing secret and the status are kept |
143
+ # | key omitted | left exactly as it is |
144
144
  #
145
145
  # `status` is matched ignoring case. Any combination is accepted:
146
146
  # `status: "ACTIVE"` with `default_for_app_calls: true` turns a number on as the
147
147
  # new default, and a `callback_url` sent with either status is written too. A body
148
148
  # that names none of the three is refused.
149
149
  #
150
+ # A number can be on without a callback URL: calls placed from your app then
151
+ # connect straight to the number or user they dial, and calls to the number are
152
+ # declined.
153
+ #
150
154
  # ## What it will refuse
151
155
  #
152
156
  # **`default_for_app_calls: false` is `400`.** An account with active voice
@@ -160,11 +164,6 @@ module Sentdm
160
164
  # **Making an inactive number the default is `400`.** Send `status: "ACTIVE"` in
161
165
  # the same call.
162
166
  #
163
- # A number added without a `callback_url` is `INACTIVE` for that one reason, so
164
- # sending it a `callback_url` turns it on by itself, and it becomes your default
165
- # line if you have no other active voice number. A number you turned off while it
166
- # had a URL stays off.
167
- #
168
167
  # **A number you never turned voice on for is `404`.** Add it with
169
168
  # `POST /v3/channels/voice`.
170
169
  #
@@ -242,48 +241,6 @@ module Sentdm
242
241
  )
243
242
  end
244
243
 
245
- # Mints a short-lived token for one of your app users. Call this from your backend
246
- # and return the token to your app, which passes it to the voice client SDK to
247
- # register. The identity is bound to the given number, or to your default app-call
248
- # number when omitted, and calls placed by that identity are routed through the
249
- # bound number. Minting again re-binds the identity, so an identity can move
250
- # between numbers.
251
- sig do
252
- params(
253
- identity: String,
254
- number: T.nilable(String),
255
- sandbox: T::Boolean,
256
- ttl: T.nilable(Integer),
257
- idempotency_key: String,
258
- x_profile_id: String,
259
- request_options: Sentdm::RequestOptions::OrHash
260
- ).returns(Sentdm::Channels::APIResponseOfVoiceToken)
261
- end
262
- def create_token(
263
- # Body param: Your identifier for the app user, such as an agent or account id.
264
- # Letters, digits, hyphens and underscores only, up to 200 characters.
265
- identity: nil,
266
- # Body param: One of your voice-enabled phone numbers in E.164 format. Calls
267
- # placed by this identity are routed through that number. Omit to use your default
268
- # app-call number.
269
- number: nil,
270
- # Body param: Sandbox flag - when true, the operation is simulated without side
271
- # effects Useful for testing integrations without actual execution
272
- sandbox: nil,
273
- # Body param: Token lifetime in seconds. Defaults to 600 and cannot exceed 3600.
274
- ttl: nil,
275
- # Header param: Unique key to ensure idempotent request processing. Must be 1-255
276
- # alphanumeric characters, hyphens, or underscores. Responses are cached for 24
277
- # hours per key per customer.
278
- idempotency_key: nil,
279
- # Header param: Profile UUID to scope the request to a child profile. Only
280
- # organization API keys can use this header. The profile must belong to the
281
- # calling organization.
282
- x_profile_id: nil,
283
- request_options: {}
284
- )
285
- end
286
-
287
244
  # Generates a new signing secret for the questions Sent sends to this number's
288
245
  # callback URL and returns it. The previous secret stops signing immediately, so
289
246
  # update your backend before the next call reaches it. The number is the E.164
@@ -12,8 +12,8 @@ module Sentdm
12
12
  # number**: each number you hold can carry phone calls on its own
13
13
  # (`POST /v3/channels/voice`), each with the callback URL Sent asks what to do
14
14
  # with its calls, one of them is the default line for calls placed from your app,
15
- # and voice tokens are minted under `POST /v3/channels/voice/tokens`. Read your
16
- # voice numbers with `GET /v3/channels/voice` and change one with
15
+ # and voice tokens are minted with `POST /v3/voice/tokens`. Read your voice
16
+ # numbers with `GET /v3/channels/voice` and change one with
17
17
  # `PATCH /v3/channels/voice/{number}`.
18
18
  #
19
19
  # ## Compliance lives on the market
@@ -145,6 +145,11 @@ module Sentdm
145
145
  # itself is unchanged: the same rules are scored and ranked the same way, with
146
146
  # routes pinned to numbers you did not list removed from the running.
147
147
  #
148
+ # Each channel's list is independent: an sms list does not restrict MMS. To choose
149
+ # the numbers a message may go out from as MMS, name them under mms. MMS sends
150
+ # from your SMS numbers, so an mms list may name any of your active SMS numbers
151
+ # whose market carries MMS — the ones listed under mms in your channels.
152
+ #
148
153
  # Every number must be an active sender on your account. The request itself is
149
154
  # still accepted (202) if one is not — like every other send-time rule, that is
150
155
  # decided per message, so each affected message is recorded BLOCKED with error
@@ -159,7 +164,9 @@ module Sentdm
159
164
  #
160
165
  # Their presence is also what makes a message eligible for MMS on an auto-detect
161
166
  # send: a message with nothing attached is delivered as SMS, because an MMS with
162
- # no media is a more expensive text message.
167
+ # no media is a more expensive text message. For the same reason a send that names
168
+ # mms in channel with nothing attached, here or on the template, is refused with
169
+ # a 400.
163
170
  #
164
171
  # The recipient's carrier fetches each URL after the send is accepted, so it must
165
172
  # stay publicly reachable — a link that expires, or one behind auth, arrives as a
@@ -0,0 +1,201 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Resources
5
+ class Voice
6
+ class Calls
7
+ # Phone calls from the numbers you hold, driven by your own callback URL.
8
+ #
9
+ # `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
10
+ # asks what to do with each call on it, and `POST /v3/voice/tokens` mints a
11
+ # short-lived token that lets a user of your app place and receive calls as that
12
+ # number. When a call arrives or a caller presses a key, a signed question is
13
+ # POSTed to the callback URL and the answer decides the call;
14
+ # `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
15
+ # before a real call reaches it, and
16
+ # `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
17
+ # The call events themselves (`call.completed` and the rest) arrive through your
18
+ # webhooks.
19
+ #
20
+ # Every call is a record under `/v3/voice/calls`: read it, list its recordings
21
+ # once one is ready, hang it up, start or stop recording, and add, mute or remove
22
+ # conference participants while it is live. A leg to a phone number runs for at
23
+ # most what your balance affords at the destination's rate.
24
+ class Participants
25
+ # Mutes or unmutes one participant of the conference room a live call is in, named
26
+ # by the participant's own call id from the participants list: send muted true to
27
+ # silence them, muted false to let them be heard again. Muting a participant who
28
+ # is already muted succeeds, as does unmuting one who is not. A participant who is
29
+ # not in this call's room answers 404. A call that has ended answers 409, as does
30
+ # a call that is not in a conference.
31
+ sig do
32
+ params(
33
+ participant_id: String,
34
+ id: String,
35
+ muted: T::Boolean,
36
+ sandbox: T::Boolean,
37
+ idempotency_key: String,
38
+ x_profile_id: String,
39
+ request_options: Sentdm::RequestOptions::OrHash
40
+ ).void
41
+ end
42
+ def update(
43
+ # Path param: The participant's own call id from the route, as listed by the
44
+ # participants endpoint, for example call_9f2ab000-0000-4000-8000-000000000002
45
+ participant_id,
46
+ # Path param: The call id from the route, as carried by call webhooks and the
47
+ # calls list, for example call_9f2ab000-0000-4000-8000-000000000001
48
+ id:,
49
+ # Body param: true to mute the participant, false to unmute them
50
+ muted: nil,
51
+ # Body param: Sandbox flag - when true, the operation is simulated without side
52
+ # effects Useful for testing integrations without actual execution
53
+ sandbox: 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
+ # Lists who is in the conference room one of your live calls is in: each
67
+ # participant's own call id, who they are, whether the room mutes them, and how
68
+ # long they have been connected. The call itself is one of the participants. Use a
69
+ # participant's id to mute or remove them; it is also a call id, so GET
70
+ # /v3/voice/calls/{id} accepts it. A call that has ended answers 409, as does a
71
+ # call that is not in a conference.
72
+ sig do
73
+ params(
74
+ id: String,
75
+ x_profile_id: String,
76
+ request_options: Sentdm::RequestOptions::OrHash
77
+ ).returns(Sentdm::Voice::Calls::APIResponseOfListOfCallParticipant)
78
+ end
79
+ def list(
80
+ # The call id from the route, as carried by call webhooks and the calls list, for
81
+ # example call_9f2ab000-0000-4000-8000-000000000001
82
+ id,
83
+ # Profile UUID to scope the request to a child profile. Only organization API keys
84
+ # can use this header. The profile must belong to the calling organization.
85
+ x_profile_id: nil,
86
+ request_options: {}
87
+ )
88
+ end
89
+
90
+ # Dials one of your app users or a phone number into a call that is in a
91
+ # conference room, and answers with the participant's own call record. The
92
+ # participant is a call of their own: it has its own id, can be looked up and hung
93
+ # up, and is billed and reported through call.completed and call.failed like any
94
+ # other call. Every participant needs a positive balance. A phone participant is
95
+ # called from caller_id, which must be one of your numbers, or from the call's
96
+ # owning number when omitted, and needs a destination you may call. Only a call
97
+ # your answer connected to a conference can take participants: a call connected to
98
+ # a user or a number answers 409.
99
+ sig do
100
+ params(
101
+ id: String,
102
+ caller_id: T.nilable(String),
103
+ sandbox: T::Boolean,
104
+ to: Sentdm::Voice::Calls::CallParticipantTarget::OrHash,
105
+ idempotency_key: String,
106
+ x_profile_id: String,
107
+ request_options: Sentdm::RequestOptions::OrHash
108
+ ).returns(Sentdm::Voice::APIResponseOfCall)
109
+ end
110
+ def add(
111
+ # Path param: The call id from the route, as carried by call webhooks and the
112
+ # calls list, for example call_9f2ab000-0000-4000-8000-000000000001
113
+ id,
114
+ # Body param: The number shown to a phone participant as the caller, in E.164
115
+ # format. Must be one of your numbers. The call's owning number when omitted
116
+ caller_id: nil,
117
+ # Body param: Sandbox flag - when true, the operation is simulated without side
118
+ # effects Useful for testing integrations without actual execution
119
+ sandbox: nil,
120
+ # Body param: A participant to add to a call
121
+ to: nil,
122
+ # Header param: Unique key to ensure idempotent request processing. Must be 1-255
123
+ # alphanumeric characters, hyphens, or underscores. Responses are cached for 24
124
+ # hours per key per customer.
125
+ idempotency_key: nil,
126
+ # Header param: Profile UUID to scope the request to a child profile. Only
127
+ # organization API keys can use this header. The profile must belong to the
128
+ # calling organization.
129
+ x_profile_id: nil,
130
+ request_options: {}
131
+ )
132
+ end
133
+
134
+ # Removes one participant from the conference room a live call is in, named by the
135
+ # participant's own call id from the participants list. Their leg ends and is
136
+ # reported through call.completed like any other call; everyone else stays
137
+ # connected. A participant who is not in this call's room answers 404. A call that
138
+ # has ended answers 409, as does a call that is not in a conference.
139
+ sig do
140
+ params(
141
+ participant_id: String,
142
+ id: String,
143
+ sandbox: T::Boolean,
144
+ x_profile_id: String,
145
+ request_options: Sentdm::RequestOptions::OrHash
146
+ ).void
147
+ end
148
+ def remove(
149
+ # Path param: The participant's own call id from the route, as listed by the
150
+ # participants endpoint, for example call_9f2ab000-0000-4000-8000-000000000002
151
+ participant_id,
152
+ # Path param: The call id from the route, as carried by call webhooks and the
153
+ # calls list, for example call_9f2ab000-0000-4000-8000-000000000001
154
+ id:,
155
+ # Body param: Sandbox flag - when true, the operation is simulated without side
156
+ # effects Useful for testing integrations without actual execution
157
+ sandbox: nil,
158
+ # Header param: Profile UUID to scope the request to a child profile. Only
159
+ # organization API keys can use this header. The profile must belong to the
160
+ # calling organization.
161
+ x_profile_id: nil,
162
+ request_options: {}
163
+ )
164
+ end
165
+
166
+ # Removes every participant from the conference room a live call is in, the call
167
+ # itself included. Every leg ends and is reported through call.completed like any
168
+ # other call. A room that is already empty answers 204 as well. A call that has
169
+ # ended answers 409, as does a call that is not in a conference.
170
+ sig do
171
+ params(
172
+ id: String,
173
+ sandbox: T::Boolean,
174
+ x_profile_id: String,
175
+ request_options: Sentdm::RequestOptions::OrHash
176
+ ).void
177
+ end
178
+ def remove_all(
179
+ # Path param: The call id from the route, as carried by call webhooks and the
180
+ # calls list, for example call_9f2ab000-0000-4000-8000-000000000001
181
+ id,
182
+ # Body param: Sandbox flag - when true, the operation is simulated without side
183
+ # effects Useful for testing integrations without actual execution
184
+ sandbox: nil,
185
+ # Header param: Profile UUID to scope the request to a child profile. Only
186
+ # organization API keys can use this header. The profile must belong to the
187
+ # calling organization.
188
+ x_profile_id: nil,
189
+ request_options: {}
190
+ )
191
+ end
192
+
193
+ # @api private
194
+ sig { params(client: Sentdm::Client).returns(T.attached_class) }
195
+ def self.new(client:)
196
+ end
197
+ end
198
+ end
199
+ end
200
+ end
201
+ end