sentdm 0.33.0 → 0.35.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 (203) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +11 -9
  4. data/lib/sentdm/client.rb +25 -0
  5. data/lib/sentdm/internal/calls_page.rb +115 -0
  6. data/lib/sentdm/models/api_response_of_call.rb +43 -0
  7. data/lib/sentdm/models/api_response_of_call_recordings.rb +43 -0
  8. data/lib/sentdm/models/api_response_of_calls_list.rb +42 -0
  9. data/lib/sentdm/models/call.rb +133 -0
  10. data/lib/sentdm/models/call_event.rb +72 -0
  11. data/lib/sentdm/models/call_event_payload.rb +102 -0
  12. data/lib/sentdm/models/call_hangup_params.rb +32 -0
  13. data/lib/sentdm/models/call_list_params.rb +83 -0
  14. data/lib/sentdm/models/call_list_recordings_params.rb +26 -0
  15. data/lib/sentdm/models/call_party.rb +31 -0
  16. data/lib/sentdm/models/call_record_params.rb +55 -0
  17. data/lib/sentdm/models/call_recording.rb +38 -0
  18. data/lib/sentdm/models/call_recordings.rb +24 -0
  19. data/lib/sentdm/models/call_retrieve_params.rb +26 -0
  20. data/lib/sentdm/models/call_timeline_entry.rb +26 -0
  21. data/lib/sentdm/models/calls/api_response_of_list_of_call_participant.rb +45 -0
  22. data/lib/sentdm/models/calls/call_participant.rb +60 -0
  23. data/lib/sentdm/models/calls/call_participant_target.rb +30 -0
  24. data/lib/sentdm/models/calls/participant_add_params.rb +66 -0
  25. data/lib/sentdm/models/calls/participant_list_params.rb +28 -0
  26. data/lib/sentdm/models/calls/participant_remove_all_params.rb +28 -0
  27. data/lib/sentdm/models/calls/participant_remove_params.rb +34 -0
  28. data/lib/sentdm/models/calls/participant_update_params.rb +64 -0
  29. data/lib/sentdm/models/calls_list.rb +26 -0
  30. data/lib/sentdm/models/channel_event_payload.rb +16 -6
  31. data/lib/sentdm/models/channels/api_response_of_list_of_voice_number.rb +45 -0
  32. data/lib/sentdm/models/channels/api_response_of_voice_callback_test.rb +45 -0
  33. data/lib/sentdm/models/channels/api_response_of_voice_number.rb +45 -0
  34. data/lib/sentdm/models/channels/api_response_of_voice_number_created.rb +45 -0
  35. data/lib/sentdm/models/channels/api_response_of_voice_secret.rb +45 -0
  36. data/lib/sentdm/models/channels/api_response_of_voice_token.rb +45 -0
  37. data/lib/sentdm/models/channels/voice_callback_test.rb +65 -0
  38. data/lib/sentdm/models/channels/voice_callback_test_error_info.rb +41 -0
  39. data/lib/sentdm/models/channels/voice_callback_test_request_info.rb +40 -0
  40. data/lib/sentdm/models/channels/voice_callback_test_response_info.rb +28 -0
  41. data/lib/sentdm/models/channels/voice_create_params.rb +86 -0
  42. data/lib/sentdm/models/channels/voice_create_token_params.rb +69 -0
  43. data/lib/sentdm/models/channels/voice_list_params.rb +22 -0
  44. data/lib/sentdm/models/channels/voice_number.rb +68 -0
  45. data/lib/sentdm/models/channels/voice_number_created.rb +26 -0
  46. data/lib/sentdm/models/channels/voice_retrieve_params.rb +28 -0
  47. data/lib/sentdm/models/channels/voice_rotate_secret_params.rb +34 -0
  48. data/lib/sentdm/models/channels/voice_secret.rb +25 -0
  49. data/lib/sentdm/models/channels/voice_test_params.rb +34 -0
  50. data/lib/sentdm/models/channels/voice_token.rb +44 -0
  51. data/lib/sentdm/models/channels/voice_update_params.rb +95 -0
  52. data/lib/sentdm/models/conversation_messages_list.rb +100 -13
  53. data/lib/sentdm/models/inbound_message_event_payload.rb +70 -3
  54. data/lib/sentdm/models/me_retrieve_response.rb +21 -1
  55. data/lib/sentdm/models/message_event_payload.rb +23 -1
  56. data/lib/sentdm/models/message_retrieve_activities_response.rb +23 -1
  57. data/lib/sentdm/models/message_retrieve_status_response.rb +100 -13
  58. data/lib/sentdm/models/template_create_params.rb +11 -1
  59. data/lib/sentdm/models/webhook_create_params.rb +31 -1
  60. data/lib/sentdm/models/webhook_list_events_response.rb +7 -3
  61. data/lib/sentdm/models/webhook_update_params.rb +31 -1
  62. data/lib/sentdm/models.rb +36 -0
  63. data/lib/sentdm/resources/calls/participants.rb +231 -0
  64. data/lib/sentdm/resources/calls.rb +235 -0
  65. data/lib/sentdm/resources/channels/voice.rb +381 -0
  66. data/lib/sentdm/resources/channels.rb +45 -0
  67. data/lib/sentdm/resources/me.rb +5 -0
  68. data/lib/sentdm/resources/templates.rb +3 -1
  69. data/lib/sentdm/resources/webhooks.rb +9 -3
  70. data/lib/sentdm/version.rb +1 -1
  71. data/lib/sentdm.rb +50 -0
  72. data/rbi/sentdm/client.rbi +23 -0
  73. data/rbi/sentdm/internal/calls_page.rbi +71 -0
  74. data/rbi/sentdm/models/api_response_of_call.rbi +74 -0
  75. data/rbi/sentdm/models/api_response_of_call_recordings.rbi +74 -0
  76. data/rbi/sentdm/models/api_response_of_calls_list.rbi +74 -0
  77. data/rbi/sentdm/models/call.rbi +177 -0
  78. data/rbi/sentdm/models/call_event.rbi +114 -0
  79. data/rbi/sentdm/models/call_event_payload.rbi +135 -0
  80. data/rbi/sentdm/models/call_hangup_params.rbi +59 -0
  81. data/rbi/sentdm/models/call_list_params.rbi +112 -0
  82. data/rbi/sentdm/models/call_list_recordings_params.rbi +46 -0
  83. data/rbi/sentdm/models/call_party.rbi +41 -0
  84. data/rbi/sentdm/models/call_record_params.rbi +83 -0
  85. data/rbi/sentdm/models/call_recording.rbi +59 -0
  86. data/rbi/sentdm/models/call_recordings.rbi +39 -0
  87. data/rbi/sentdm/models/call_retrieve_params.rbi +46 -0
  88. data/rbi/sentdm/models/call_timeline_entry.rbi +40 -0
  89. data/rbi/sentdm/models/calls/api_response_of_list_of_call_participant.rbi +76 -0
  90. data/rbi/sentdm/models/calls/call_participant.rbi +92 -0
  91. data/rbi/sentdm/models/calls/call_participant_target.rbi +47 -0
  92. data/rbi/sentdm/models/calls/participant_add_params.rbi +98 -0
  93. data/rbi/sentdm/models/calls/participant_list_params.rbi +51 -0
  94. data/rbi/sentdm/models/calls/participant_remove_all_params.rbi +51 -0
  95. data/rbi/sentdm/models/calls/participant_remove_params.rbi +61 -0
  96. data/rbi/sentdm/models/calls/participant_update_params.rbi +94 -0
  97. data/rbi/sentdm/models/calls_list.rbi +47 -0
  98. data/rbi/sentdm/models/channel_event_payload.rbi +20 -8
  99. data/rbi/sentdm/models/channels/api_response_of_list_of_voice_number.rbi +76 -0
  100. data/rbi/sentdm/models/channels/api_response_of_voice_callback_test.rbi +83 -0
  101. data/rbi/sentdm/models/channels/api_response_of_voice_number.rbi +81 -0
  102. data/rbi/sentdm/models/channels/api_response_of_voice_number_created.rbi +83 -0
  103. data/rbi/sentdm/models/channels/api_response_of_voice_secret.rbi +81 -0
  104. data/rbi/sentdm/models/channels/api_response_of_voice_token.rbi +81 -0
  105. data/rbi/sentdm/models/channels/voice_callback_test.rbi +126 -0
  106. data/rbi/sentdm/models/channels/voice_callback_test_error_info.rbi +65 -0
  107. data/rbi/sentdm/models/channels/voice_callback_test_request_info.rbi +66 -0
  108. data/rbi/sentdm/models/channels/voice_callback_test_response_info.rbi +48 -0
  109. data/rbi/sentdm/models/channels/voice_create_params.rbi +127 -0
  110. data/rbi/sentdm/models/channels/voice_create_token_params.rbi +104 -0
  111. data/rbi/sentdm/models/channels/voice_list_params.rbi +40 -0
  112. data/rbi/sentdm/models/channels/voice_number.rbi +105 -0
  113. data/rbi/sentdm/models/channels/voice_number_created.rbi +42 -0
  114. data/rbi/sentdm/models/channels/voice_retrieve_params.rbi +51 -0
  115. data/rbi/sentdm/models/channels/voice_rotate_secret_params.rbi +64 -0
  116. data/rbi/sentdm/models/channels/voice_secret.rbi +35 -0
  117. data/rbi/sentdm/models/channels/voice_test_params.rbi +61 -0
  118. data/rbi/sentdm/models/channels/voice_token.rbi +76 -0
  119. data/rbi/sentdm/models/channels/voice_update_params.rbi +158 -0
  120. data/rbi/sentdm/models/conversation_messages_list.rbi +122 -19
  121. data/rbi/sentdm/models/inbound_message_event_payload.rbi +110 -2
  122. data/rbi/sentdm/models/me_retrieve_response.rbi +35 -0
  123. data/rbi/sentdm/models/message_event_payload.rbi +28 -0
  124. data/rbi/sentdm/models/message_retrieve_activities_response.rbi +26 -0
  125. data/rbi/sentdm/models/message_retrieve_status_response.rbi +122 -19
  126. data/rbi/sentdm/models/template_create_params.rbi +15 -0
  127. data/rbi/sentdm/models/webhook_create_params.rbi +61 -0
  128. data/rbi/sentdm/models/webhook_list_events_response.rbi +6 -3
  129. data/rbi/sentdm/models/webhook_update_params.rbi +61 -0
  130. data/rbi/sentdm/models.rbi +36 -0
  131. data/rbi/sentdm/resources/calls/participants.rbi +199 -0
  132. data/rbi/sentdm/resources/calls.rbi +206 -0
  133. data/rbi/sentdm/resources/channels/voice.rbi +371 -0
  134. data/rbi/sentdm/resources/channels.rbi +42 -0
  135. data/rbi/sentdm/resources/me.rbi +5 -0
  136. data/rbi/sentdm/resources/templates.rbi +6 -0
  137. data/rbi/sentdm/resources/webhooks.rbi +15 -1
  138. data/sig/sentdm/client.rbs +4 -0
  139. data/sig/sentdm/internal/calls_page.rbs +41 -0
  140. data/sig/sentdm/models/api_response_of_call.rbs +39 -0
  141. data/sig/sentdm/models/api_response_of_call_recordings.rbs +39 -0
  142. data/sig/sentdm/models/api_response_of_calls_list.rbs +39 -0
  143. data/sig/sentdm/models/call.rbs +101 -0
  144. data/sig/sentdm/models/call_event.rbs +44 -0
  145. data/sig/sentdm/models/call_event_payload.rbs +68 -0
  146. data/sig/sentdm/models/call_hangup_params.rbs +38 -0
  147. data/sig/sentdm/models/call_list_params.rbs +67 -0
  148. data/sig/sentdm/models/call_list_recordings_params.rbs +30 -0
  149. data/sig/sentdm/models/call_party.rbs +17 -0
  150. data/sig/sentdm/models/call_record_params.rbs +54 -0
  151. data/sig/sentdm/models/call_recording.rbs +32 -0
  152. data/sig/sentdm/models/call_recordings.rbs +17 -0
  153. data/sig/sentdm/models/call_retrieve_params.rbs +30 -0
  154. data/sig/sentdm/models/call_timeline_entry.rbs +19 -0
  155. data/sig/sentdm/models/calls/api_response_of_list_of_call_participant.rbs +41 -0
  156. data/sig/sentdm/models/calls/call_participant.rbs +52 -0
  157. data/sig/sentdm/models/calls/call_participant_target.rbs +23 -0
  158. data/sig/sentdm/models/calls/participant_add_params.rbs +63 -0
  159. data/sig/sentdm/models/calls/participant_list_params.rbs +32 -0
  160. data/sig/sentdm/models/calls/participant_remove_all_params.rbs +34 -0
  161. data/sig/sentdm/models/calls/participant_remove_params.rbs +40 -0
  162. data/sig/sentdm/models/calls/participant_update_params.rbs +61 -0
  163. data/sig/sentdm/models/calls_list.rbs +26 -0
  164. data/sig/sentdm/models/channel_event_payload.rbs +5 -0
  165. data/sig/sentdm/models/channels/api_response_of_list_of_voice_number.rbs +41 -0
  166. data/sig/sentdm/models/channels/api_response_of_voice_callback_test.rbs +41 -0
  167. data/sig/sentdm/models/channels/api_response_of_voice_number.rbs +41 -0
  168. data/sig/sentdm/models/channels/api_response_of_voice_number_created.rbs +41 -0
  169. data/sig/sentdm/models/channels/api_response_of_voice_secret.rbs +41 -0
  170. data/sig/sentdm/models/channels/api_response_of_voice_token.rbs +41 -0
  171. data/sig/sentdm/models/channels/voice_callback_test.rbs +51 -0
  172. data/sig/sentdm/models/channels/voice_callback_test_error_info.rbs +28 -0
  173. data/sig/sentdm/models/channels/voice_callback_test_request_info.rbs +34 -0
  174. data/sig/sentdm/models/channels/voice_callback_test_response_info.rbs +20 -0
  175. data/sig/sentdm/models/channels/voice_create_params.rbs +64 -0
  176. data/sig/sentdm/models/channels/voice_create_token_params.rbs +61 -0
  177. data/sig/sentdm/models/channels/voice_list_params.rbs +27 -0
  178. data/sig/sentdm/models/channels/voice_number.rbs +57 -0
  179. data/sig/sentdm/models/channels/voice_number_created.rbs +17 -0
  180. data/sig/sentdm/models/channels/voice_retrieve_params.rbs +32 -0
  181. data/sig/sentdm/models/channels/voice_rotate_secret_params.rbs +40 -0
  182. data/sig/sentdm/models/channels/voice_secret.rbs +17 -0
  183. data/sig/sentdm/models/channels/voice_test_params.rbs +40 -0
  184. data/sig/sentdm/models/channels/voice_token.rbs +40 -0
  185. data/sig/sentdm/models/channels/voice_update_params.rbs +78 -0
  186. data/sig/sentdm/models/conversation_messages_list.rbs +56 -8
  187. data/sig/sentdm/models/inbound_message_event_payload.rbs +37 -0
  188. data/sig/sentdm/models/me_retrieve_response.rbs +7 -0
  189. data/sig/sentdm/models/message_event_payload.rbs +10 -0
  190. data/sig/sentdm/models/message_retrieve_activities_response.rbs +10 -0
  191. data/sig/sentdm/models/message_retrieve_status_response.rbs +56 -8
  192. data/sig/sentdm/models/template_create_params.rbs +7 -0
  193. data/sig/sentdm/models/webhook_create_params.rbs +29 -0
  194. data/sig/sentdm/models/webhook_list_events_response.rbs +1 -0
  195. data/sig/sentdm/models/webhook_update_params.rbs +29 -0
  196. data/sig/sentdm/models.rbs +36 -0
  197. data/sig/sentdm/resources/calls/participants.rbs +50 -0
  198. data/sig/sentdm/resources/calls.rbs +50 -0
  199. data/sig/sentdm/resources/channels/voice.rbs +68 -0
  200. data/sig/sentdm/resources/channels.rbs +9 -0
  201. data/sig/sentdm/resources/templates.rbs +1 -0
  202. data/sig/sentdm/resources/webhooks.rbs +2 -0
  203. metadata +152 -2
@@ -0,0 +1,71 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Internal
5
+ class CallsPage
6
+ include Sentdm::Internal::Type::BasePage
7
+
8
+ Elem = type_member
9
+
10
+ sig { returns(Data) }
11
+ attr_accessor :data
12
+
13
+ # @api private
14
+ sig { returns(String) }
15
+ def inspect
16
+ end
17
+
18
+ class Data < Sentdm::Internal::Type::BaseModel
19
+ OrHash = T.type_alias { T.any(Data, Sentdm::Internal::AnyHash) }
20
+
21
+ sig { returns(T.nilable(T::Array[T.anything])) }
22
+ attr_reader :calls
23
+
24
+ sig { params(calls: T::Array[T.anything]).void }
25
+ attr_writer :calls
26
+
27
+ sig { returns(T.nilable(Data::Pagination)) }
28
+ attr_reader :pagination
29
+
30
+ sig { params(pagination: Data::Pagination::OrHash).void }
31
+ attr_writer :pagination
32
+
33
+ sig do
34
+ params(
35
+ calls: T::Array[T.anything],
36
+ pagination: Data::Pagination::OrHash
37
+ ).returns(T.attached_class)
38
+ end
39
+ def self.new(calls: nil, pagination: nil)
40
+ end
41
+
42
+ sig do
43
+ override.returns(
44
+ { calls: T::Array[T.anything], pagination: Data::Pagination }
45
+ )
46
+ end
47
+ def to_hash
48
+ end
49
+
50
+ class Pagination < Sentdm::Internal::Type::BaseModel
51
+ OrHash =
52
+ T.type_alias { T.any(Data::Pagination, Sentdm::Internal::AnyHash) }
53
+
54
+ sig { returns(T.nilable(T::Boolean)) }
55
+ attr_reader :has_more
56
+
57
+ sig { params(has_more: T::Boolean).void }
58
+ attr_writer :has_more
59
+
60
+ sig { params(has_more: T::Boolean).returns(T.attached_class) }
61
+ def self.new(has_more: nil)
62
+ end
63
+
64
+ sig { override.returns({ has_more: T::Boolean }) }
65
+ def to_hash
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIResponseOfCall < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Sentdm::APIResponseOfCall, Sentdm::Internal::AnyHash)
9
+ end
10
+
11
+ # A call record
12
+ sig { returns(T.nilable(Sentdm::Call)) }
13
+ attr_reader :data
14
+
15
+ sig { params(data: T.nilable(Sentdm::Call::OrHash)).void }
16
+ attr_writer :data
17
+
18
+ # Error information
19
+ sig { returns(T.nilable(Sentdm::ErrorDetail)) }
20
+ attr_reader :error
21
+
22
+ sig { params(error: T.nilable(Sentdm::ErrorDetail::OrHash)).void }
23
+ attr_writer :error
24
+
25
+ # Request and response metadata
26
+ sig { returns(T.nilable(Sentdm::APIMeta)) }
27
+ attr_reader :meta
28
+
29
+ sig { params(meta: Sentdm::APIMeta::OrHash).void }
30
+ attr_writer :meta
31
+
32
+ # Indicates whether the request was successful
33
+ sig { returns(T.nilable(T::Boolean)) }
34
+ attr_reader :success
35
+
36
+ sig { params(success: T::Boolean).void }
37
+ attr_writer :success
38
+
39
+ # Standard API response envelope for all v3 endpoints
40
+ sig do
41
+ params(
42
+ data: T.nilable(Sentdm::Call::OrHash),
43
+ error: T.nilable(Sentdm::ErrorDetail::OrHash),
44
+ meta: Sentdm::APIMeta::OrHash,
45
+ success: T::Boolean
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # A call record
50
+ data: nil,
51
+ # Error information
52
+ error: nil,
53
+ # Request and response metadata
54
+ meta: nil,
55
+ # Indicates whether the request was successful
56
+ success: nil
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ data: T.nilable(Sentdm::Call),
64
+ error: T.nilable(Sentdm::ErrorDetail),
65
+ meta: Sentdm::APIMeta,
66
+ success: T::Boolean
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIResponseOfCallRecordings < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Sentdm::APIResponseOfCallRecordings, Sentdm::Internal::AnyHash)
9
+ end
10
+
11
+ # The recordings of a call, each as a short-lived download link
12
+ sig { returns(T.nilable(Sentdm::CallRecordings)) }
13
+ attr_reader :data
14
+
15
+ sig { params(data: T.nilable(Sentdm::CallRecordings::OrHash)).void }
16
+ attr_writer :data
17
+
18
+ # Error information
19
+ sig { returns(T.nilable(Sentdm::ErrorDetail)) }
20
+ attr_reader :error
21
+
22
+ sig { params(error: T.nilable(Sentdm::ErrorDetail::OrHash)).void }
23
+ attr_writer :error
24
+
25
+ # Request and response metadata
26
+ sig { returns(T.nilable(Sentdm::APIMeta)) }
27
+ attr_reader :meta
28
+
29
+ sig { params(meta: Sentdm::APIMeta::OrHash).void }
30
+ attr_writer :meta
31
+
32
+ # Indicates whether the request was successful
33
+ sig { returns(T.nilable(T::Boolean)) }
34
+ attr_reader :success
35
+
36
+ sig { params(success: T::Boolean).void }
37
+ attr_writer :success
38
+
39
+ # Standard API response envelope for all v3 endpoints
40
+ sig do
41
+ params(
42
+ data: T.nilable(Sentdm::CallRecordings::OrHash),
43
+ error: T.nilable(Sentdm::ErrorDetail::OrHash),
44
+ meta: Sentdm::APIMeta::OrHash,
45
+ success: T::Boolean
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # The recordings of a call, each as a short-lived download link
50
+ data: nil,
51
+ # Error information
52
+ error: nil,
53
+ # Request and response metadata
54
+ meta: nil,
55
+ # Indicates whether the request was successful
56
+ success: nil
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ data: T.nilable(Sentdm::CallRecordings),
64
+ error: T.nilable(Sentdm::ErrorDetail),
65
+ meta: Sentdm::APIMeta,
66
+ success: T::Boolean
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIResponseOfCallsList < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Sentdm::APIResponseOfCallsList, Sentdm::Internal::AnyHash)
9
+ end
10
+
11
+ # Paginated list of calls
12
+ sig { returns(T.nilable(Sentdm::CallsList)) }
13
+ attr_reader :data
14
+
15
+ sig { params(data: T.nilable(Sentdm::CallsList::OrHash)).void }
16
+ attr_writer :data
17
+
18
+ # Error information
19
+ sig { returns(T.nilable(Sentdm::ErrorDetail)) }
20
+ attr_reader :error
21
+
22
+ sig { params(error: T.nilable(Sentdm::ErrorDetail::OrHash)).void }
23
+ attr_writer :error
24
+
25
+ # Request and response metadata
26
+ sig { returns(T.nilable(Sentdm::APIMeta)) }
27
+ attr_reader :meta
28
+
29
+ sig { params(meta: Sentdm::APIMeta::OrHash).void }
30
+ attr_writer :meta
31
+
32
+ # Indicates whether the request was successful
33
+ sig { returns(T.nilable(T::Boolean)) }
34
+ attr_reader :success
35
+
36
+ sig { params(success: T::Boolean).void }
37
+ attr_writer :success
38
+
39
+ # Standard API response envelope for all v3 endpoints
40
+ sig do
41
+ params(
42
+ data: T.nilable(Sentdm::CallsList::OrHash),
43
+ error: T.nilable(Sentdm::ErrorDetail::OrHash),
44
+ meta: Sentdm::APIMeta::OrHash,
45
+ success: T::Boolean
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # Paginated list of calls
50
+ data: nil,
51
+ # Error information
52
+ error: nil,
53
+ # Request and response metadata
54
+ meta: nil,
55
+ # Indicates whether the request was successful
56
+ success: nil
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ data: T.nilable(Sentdm::CallsList),
64
+ error: T.nilable(Sentdm::ErrorDetail),
65
+ meta: Sentdm::APIMeta,
66
+ success: T::Boolean
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,177 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class Call < Sentdm::Internal::Type::BaseModel
6
+ OrHash = T.type_alias { T.any(Sentdm::Call, Sentdm::Internal::AnyHash) }
7
+
8
+ # The call id, the same one carried by the call.request question and every call
9
+ # webhook
10
+ sig { returns(T.nilable(String)) }
11
+ attr_reader :id
12
+
13
+ sig { params(id: String).void }
14
+ attr_writer :id
15
+
16
+ # When the call was answered (UTC). Null until then, and always null for a call
17
+ # between two of your app users
18
+ sig { returns(T.nilable(Time)) }
19
+ attr_accessor :answered_at
20
+
21
+ # outbound for a call placed from your app, inbound for a call to one of your
22
+ # numbers
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :direction
25
+
26
+ sig { params(direction: String).void }
27
+ attr_writer :direction
28
+
29
+ # Billable duration in seconds. Null while the call is live
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_accessor :duration_seconds
32
+
33
+ # When the call ended (UTC). Null while the call is live
34
+ sig { returns(T.nilable(Time)) }
35
+ attr_accessor :ended_at
36
+
37
+ # Why the call did not complete: callback_timeout, invalid_answer,
38
+ # insufficient_balance, destination_blocked, rejected or no_answer. Null while the
39
+ # call is live, when it completed, and when it failed without a recorded reason
40
+ sig { returns(T.nilable(String)) }
41
+ attr_accessor :failure_reason
42
+
43
+ # One end of a call
44
+ sig { returns(T.nilable(Sentdm::CallParty)) }
45
+ attr_reader :from
46
+
47
+ sig { params(from: Sentdm::CallParty::OrHash).void }
48
+ attr_writer :from
49
+
50
+ # Your number that owns the call, in E.164 format: the dialed number for an
51
+ # inbound call, the caller's bound number for a call placed from your app
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :number
54
+
55
+ sig { params(number: String).void }
56
+ attr_writer :number
57
+
58
+ # What the call cost. Null until it has been priced
59
+ sig { returns(T.nilable(Float)) }
60
+ attr_accessor :price
61
+
62
+ # True once a recording of the call is available
63
+ sig { returns(T.nilable(T::Boolean)) }
64
+ attr_reader :recording_available
65
+
66
+ sig { params(recording_available: T::Boolean).void }
67
+ attr_writer :recording_available
68
+
69
+ # When the call was placed (UTC)
70
+ sig { returns(T.nilable(Time)) }
71
+ attr_reader :started_at
72
+
73
+ sig { params(started_at: Time).void }
74
+ attr_writer :started_at
75
+
76
+ # initiated, ringing, answered, completed, failed, no_answer or rejected
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :status
79
+
80
+ sig { params(status: String).void }
81
+ attr_writer :status
82
+
83
+ # When the call entered each status, oldest first. Only returned when reading one
84
+ # call
85
+ sig { returns(T.nilable(T::Array[Sentdm::CallTimelineEntry])) }
86
+ attr_accessor :timeline
87
+
88
+ # One end of a call
89
+ sig { returns(T.nilable(Sentdm::CallParty)) }
90
+ attr_reader :to
91
+
92
+ sig { params(to: Sentdm::CallParty::OrHash).void }
93
+ attr_writer :to
94
+
95
+ # A call record
96
+ sig do
97
+ params(
98
+ id: String,
99
+ answered_at: T.nilable(Time),
100
+ direction: String,
101
+ duration_seconds: T.nilable(Integer),
102
+ ended_at: T.nilable(Time),
103
+ failure_reason: T.nilable(String),
104
+ from: Sentdm::CallParty::OrHash,
105
+ number: String,
106
+ price: T.nilable(Float),
107
+ recording_available: T::Boolean,
108
+ started_at: Time,
109
+ status: String,
110
+ timeline: T.nilable(T::Array[Sentdm::CallTimelineEntry::OrHash]),
111
+ to: Sentdm::CallParty::OrHash
112
+ ).returns(T.attached_class)
113
+ end
114
+ def self.new(
115
+ # The call id, the same one carried by the call.request question and every call
116
+ # webhook
117
+ id: nil,
118
+ # When the call was answered (UTC). Null until then, and always null for a call
119
+ # between two of your app users
120
+ answered_at: nil,
121
+ # outbound for a call placed from your app, inbound for a call to one of your
122
+ # numbers
123
+ direction: nil,
124
+ # Billable duration in seconds. Null while the call is live
125
+ duration_seconds: nil,
126
+ # When the call ended (UTC). Null while the call is live
127
+ ended_at: nil,
128
+ # Why the call did not complete: callback_timeout, invalid_answer,
129
+ # insufficient_balance, destination_blocked, rejected or no_answer. Null while the
130
+ # call is live, when it completed, and when it failed without a recorded reason
131
+ failure_reason: nil,
132
+ # One end of a call
133
+ from: nil,
134
+ # Your number that owns the call, in E.164 format: the dialed number for an
135
+ # inbound call, the caller's bound number for a call placed from your app
136
+ number: nil,
137
+ # What the call cost. Null until it has been priced
138
+ price: nil,
139
+ # True once a recording of the call is available
140
+ recording_available: nil,
141
+ # When the call was placed (UTC)
142
+ started_at: nil,
143
+ # initiated, ringing, answered, completed, failed, no_answer or rejected
144
+ status: nil,
145
+ # When the call entered each status, oldest first. Only returned when reading one
146
+ # call
147
+ timeline: nil,
148
+ # One end of a call
149
+ to: nil
150
+ )
151
+ end
152
+
153
+ sig do
154
+ override.returns(
155
+ {
156
+ id: String,
157
+ answered_at: T.nilable(Time),
158
+ direction: String,
159
+ duration_seconds: T.nilable(Integer),
160
+ ended_at: T.nilable(Time),
161
+ failure_reason: T.nilable(String),
162
+ from: Sentdm::CallParty,
163
+ number: String,
164
+ price: T.nilable(Float),
165
+ recording_available: T::Boolean,
166
+ started_at: Time,
167
+ status: String,
168
+ timeline: T.nilable(T::Array[Sentdm::CallTimelineEntry]),
169
+ to: Sentdm::CallParty
170
+ }
171
+ )
172
+ end
173
+ def to_hash
174
+ end
175
+ end
176
+ end
177
+ end
@@ -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