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.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +11 -9
  4. data/lib/sentdm/client.rb +30 -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 +134 -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/channels/api_response_of_list_of_voice_number.rb +45 -0
  31. data/lib/sentdm/models/channels/api_response_of_voice_callback_test.rb +45 -0
  32. data/lib/sentdm/models/channels/api_response_of_voice_number.rb +45 -0
  33. data/lib/sentdm/models/channels/api_response_of_voice_number_created.rb +45 -0
  34. data/lib/sentdm/models/channels/api_response_of_voice_secret.rb +45 -0
  35. data/lib/sentdm/models/channels/api_response_of_voice_token.rb +45 -0
  36. data/lib/sentdm/models/channels/voice_callback_test.rb +65 -0
  37. data/lib/sentdm/models/channels/voice_callback_test_error_info.rb +41 -0
  38. data/lib/sentdm/models/channels/voice_callback_test_request_info.rb +40 -0
  39. data/lib/sentdm/models/channels/voice_callback_test_response_info.rb +28 -0
  40. data/lib/sentdm/models/channels/voice_create_params.rb +86 -0
  41. data/lib/sentdm/models/channels/voice_create_token_params.rb +69 -0
  42. data/lib/sentdm/models/channels/voice_list_params.rb +22 -0
  43. data/lib/sentdm/models/channels/voice_number.rb +68 -0
  44. data/lib/sentdm/models/channels/voice_number_created.rb +26 -0
  45. data/lib/sentdm/models/channels/voice_retrieve_params.rb +28 -0
  46. data/lib/sentdm/models/channels/voice_rotate_secret_params.rb +34 -0
  47. data/lib/sentdm/models/channels/voice_secret.rb +25 -0
  48. data/lib/sentdm/models/channels/voice_test_params.rb +34 -0
  49. data/lib/sentdm/models/channels/voice_token.rb +44 -0
  50. data/lib/sentdm/models/channels/voice_update_params.rb +95 -0
  51. data/lib/sentdm/models/message_event_payload.rb +9 -4
  52. data/lib/sentdm/models/message_retrieve_activities_response.rb +7 -5
  53. data/lib/sentdm/models/webhook_list_events_response.rb +4 -173
  54. data/lib/sentdm/models.rb +36 -0
  55. data/lib/sentdm/resources/calls/participants.rb +231 -0
  56. data/lib/sentdm/resources/calls.rb +236 -0
  57. data/lib/sentdm/resources/channels/voice.rb +381 -0
  58. data/lib/sentdm/resources/channels.rb +45 -0
  59. data/lib/sentdm/resources/messages.rb +10 -4
  60. data/lib/sentdm/version.rb +1 -1
  61. data/lib/sentdm.rb +50 -0
  62. data/rbi/sentdm/client.rbi +28 -0
  63. data/rbi/sentdm/internal/calls_page.rbi +71 -0
  64. data/rbi/sentdm/models/api_response_of_call.rbi +74 -0
  65. data/rbi/sentdm/models/api_response_of_call_recordings.rbi +74 -0
  66. data/rbi/sentdm/models/api_response_of_calls_list.rbi +74 -0
  67. data/rbi/sentdm/models/call.rbi +179 -0
  68. data/rbi/sentdm/models/call_event.rbi +114 -0
  69. data/rbi/sentdm/models/call_event_payload.rbi +135 -0
  70. data/rbi/sentdm/models/call_hangup_params.rbi +59 -0
  71. data/rbi/sentdm/models/call_list_params.rbi +112 -0
  72. data/rbi/sentdm/models/call_list_recordings_params.rbi +46 -0
  73. data/rbi/sentdm/models/call_party.rbi +41 -0
  74. data/rbi/sentdm/models/call_record_params.rbi +83 -0
  75. data/rbi/sentdm/models/call_recording.rbi +59 -0
  76. data/rbi/sentdm/models/call_recordings.rbi +39 -0
  77. data/rbi/sentdm/models/call_retrieve_params.rbi +46 -0
  78. data/rbi/sentdm/models/call_timeline_entry.rbi +40 -0
  79. data/rbi/sentdm/models/calls/api_response_of_list_of_call_participant.rbi +76 -0
  80. data/rbi/sentdm/models/calls/call_participant.rbi +92 -0
  81. data/rbi/sentdm/models/calls/call_participant_target.rbi +47 -0
  82. data/rbi/sentdm/models/calls/participant_add_params.rbi +98 -0
  83. data/rbi/sentdm/models/calls/participant_list_params.rbi +51 -0
  84. data/rbi/sentdm/models/calls/participant_remove_all_params.rbi +51 -0
  85. data/rbi/sentdm/models/calls/participant_remove_params.rbi +61 -0
  86. data/rbi/sentdm/models/calls/participant_update_params.rbi +94 -0
  87. data/rbi/sentdm/models/calls_list.rbi +47 -0
  88. data/rbi/sentdm/models/channels/api_response_of_list_of_voice_number.rbi +76 -0
  89. data/rbi/sentdm/models/channels/api_response_of_voice_callback_test.rbi +83 -0
  90. data/rbi/sentdm/models/channels/api_response_of_voice_number.rbi +81 -0
  91. data/rbi/sentdm/models/channels/api_response_of_voice_number_created.rbi +83 -0
  92. data/rbi/sentdm/models/channels/api_response_of_voice_secret.rbi +81 -0
  93. data/rbi/sentdm/models/channels/api_response_of_voice_token.rbi +81 -0
  94. data/rbi/sentdm/models/channels/voice_callback_test.rbi +126 -0
  95. data/rbi/sentdm/models/channels/voice_callback_test_error_info.rbi +65 -0
  96. data/rbi/sentdm/models/channels/voice_callback_test_request_info.rbi +66 -0
  97. data/rbi/sentdm/models/channels/voice_callback_test_response_info.rbi +48 -0
  98. data/rbi/sentdm/models/channels/voice_create_params.rbi +127 -0
  99. data/rbi/sentdm/models/channels/voice_create_token_params.rbi +104 -0
  100. data/rbi/sentdm/models/channels/voice_list_params.rbi +40 -0
  101. data/rbi/sentdm/models/channels/voice_number.rbi +105 -0
  102. data/rbi/sentdm/models/channels/voice_number_created.rbi +42 -0
  103. data/rbi/sentdm/models/channels/voice_retrieve_params.rbi +51 -0
  104. data/rbi/sentdm/models/channels/voice_rotate_secret_params.rbi +64 -0
  105. data/rbi/sentdm/models/channels/voice_secret.rbi +35 -0
  106. data/rbi/sentdm/models/channels/voice_test_params.rbi +61 -0
  107. data/rbi/sentdm/models/channels/voice_token.rbi +76 -0
  108. data/rbi/sentdm/models/channels/voice_update_params.rbi +158 -0
  109. data/rbi/sentdm/models/message_event_payload.rbi +16 -6
  110. data/rbi/sentdm/models/message_retrieve_activities_response.rbi +12 -8
  111. data/rbi/sentdm/models/webhook_list_events_response.rbi +3 -269
  112. data/rbi/sentdm/models.rbi +36 -0
  113. data/rbi/sentdm/resources/calls/participants.rbi +199 -0
  114. data/rbi/sentdm/resources/calls.rbi +207 -0
  115. data/rbi/sentdm/resources/channels/voice.rbi +371 -0
  116. data/rbi/sentdm/resources/channels.rbi +42 -0
  117. data/rbi/sentdm/resources/messages.rbi +10 -4
  118. data/sig/sentdm/client.rbs +4 -0
  119. data/sig/sentdm/internal/calls_page.rbs +41 -0
  120. data/sig/sentdm/models/api_response_of_call.rbs +39 -0
  121. data/sig/sentdm/models/api_response_of_call_recordings.rbs +39 -0
  122. data/sig/sentdm/models/api_response_of_calls_list.rbs +39 -0
  123. data/sig/sentdm/models/call.rbs +101 -0
  124. data/sig/sentdm/models/call_event.rbs +44 -0
  125. data/sig/sentdm/models/call_event_payload.rbs +68 -0
  126. data/sig/sentdm/models/call_hangup_params.rbs +38 -0
  127. data/sig/sentdm/models/call_list_params.rbs +67 -0
  128. data/sig/sentdm/models/call_list_recordings_params.rbs +30 -0
  129. data/sig/sentdm/models/call_party.rbs +17 -0
  130. data/sig/sentdm/models/call_record_params.rbs +54 -0
  131. data/sig/sentdm/models/call_recording.rbs +32 -0
  132. data/sig/sentdm/models/call_recordings.rbs +17 -0
  133. data/sig/sentdm/models/call_retrieve_params.rbs +30 -0
  134. data/sig/sentdm/models/call_timeline_entry.rbs +19 -0
  135. data/sig/sentdm/models/calls/api_response_of_list_of_call_participant.rbs +41 -0
  136. data/sig/sentdm/models/calls/call_participant.rbs +52 -0
  137. data/sig/sentdm/models/calls/call_participant_target.rbs +23 -0
  138. data/sig/sentdm/models/calls/participant_add_params.rbs +63 -0
  139. data/sig/sentdm/models/calls/participant_list_params.rbs +32 -0
  140. data/sig/sentdm/models/calls/participant_remove_all_params.rbs +34 -0
  141. data/sig/sentdm/models/calls/participant_remove_params.rbs +40 -0
  142. data/sig/sentdm/models/calls/participant_update_params.rbs +61 -0
  143. data/sig/sentdm/models/calls_list.rbs +26 -0
  144. data/sig/sentdm/models/channels/api_response_of_list_of_voice_number.rbs +41 -0
  145. data/sig/sentdm/models/channels/api_response_of_voice_callback_test.rbs +41 -0
  146. data/sig/sentdm/models/channels/api_response_of_voice_number.rbs +41 -0
  147. data/sig/sentdm/models/channels/api_response_of_voice_number_created.rbs +41 -0
  148. data/sig/sentdm/models/channels/api_response_of_voice_secret.rbs +41 -0
  149. data/sig/sentdm/models/channels/api_response_of_voice_token.rbs +41 -0
  150. data/sig/sentdm/models/channels/voice_callback_test.rbs +51 -0
  151. data/sig/sentdm/models/channels/voice_callback_test_error_info.rbs +28 -0
  152. data/sig/sentdm/models/channels/voice_callback_test_request_info.rbs +34 -0
  153. data/sig/sentdm/models/channels/voice_callback_test_response_info.rbs +20 -0
  154. data/sig/sentdm/models/channels/voice_create_params.rbs +64 -0
  155. data/sig/sentdm/models/channels/voice_create_token_params.rbs +61 -0
  156. data/sig/sentdm/models/channels/voice_list_params.rbs +27 -0
  157. data/sig/sentdm/models/channels/voice_number.rbs +57 -0
  158. data/sig/sentdm/models/channels/voice_number_created.rbs +17 -0
  159. data/sig/sentdm/models/channels/voice_retrieve_params.rbs +32 -0
  160. data/sig/sentdm/models/channels/voice_rotate_secret_params.rbs +40 -0
  161. data/sig/sentdm/models/channels/voice_secret.rbs +17 -0
  162. data/sig/sentdm/models/channels/voice_test_params.rbs +40 -0
  163. data/sig/sentdm/models/channels/voice_token.rbs +40 -0
  164. data/sig/sentdm/models/channels/voice_update_params.rbs +78 -0
  165. data/sig/sentdm/models/webhook_list_events_response.rbs +1 -107
  166. data/sig/sentdm/models.rbs +36 -0
  167. data/sig/sentdm/resources/calls/participants.rbs +50 -0
  168. data/sig/sentdm/resources/calls.rbs +50 -0
  169. data/sig/sentdm/resources/channels/voice.rbs +68 -0
  170. data/sig/sentdm/resources/channels.rbs +9 -0
  171. metadata +152 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b4444164d11b8913195b89a66ba9d140e5edaca680199f80156774e39f3f893
4
- data.tar.gz: 38b18a67c9dc58ed79f990686d0363fbab3138b66c9a2e3b20eb76ba0d4d4988
3
+ metadata.gz: f1d07878fe77b406e3665345f7f6d2c733edfd36e5d9885919ca6a480bd448d4
4
+ data.tar.gz: a71ce847b04363a6718b2d5bcd04e99502518d77d9eaa7b07ecc7fcc44b735d9
5
5
  SHA512:
6
- metadata.gz: bd38b5407cb704af0bf1cfecccb4f4bdcc2b5b173ac638d7c3f4c8e5a6039a019637d46114d6c082ebc420f7ad3532cfd128493f56d7bff51c62abc62cf34461
7
- data.tar.gz: 3a79e6d405c70edc8e4479f28dc4955c0e0a3fbfaa59da458848c831e99650d90e87c672316609514fb9d5bd4d2b61d194d3f54a31d6c7ecac9340b12117e887
6
+ metadata.gz: e510f27198098e2f73c9d0d1eb86578b395a2222cb1e291631fa7d18682b0d334b6827165df73440e06667e876d53d2675aeee460753d4006c2e162fcb6294da
7
+ data.tar.gz: d9239a9ef793bae4801adc25f099db5dfa77a1c65bc4798e01b41521cbc482e506a0ec8c573a9933da38d0af981a8056442f9bc2264c7c7f60c75115a77d7633
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.36.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.35.0...v0.36.0) (2026-10-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** sync generated SDKs from the committed spec ([fc29692](https://github.com/sentdm/sent-dm-ruby/commit/fc29692de765a72b716a46c4920c603e2b617a95))
9
+ * **api:** sync OpenAPI spec from production ([989362a](https://github.com/sentdm/sent-dm-ruby/commit/989362a3142f3d926e68793f163d21e85d3cf346))
10
+
11
+ ## [0.35.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.34.0...v0.35.0) (2026-10-01)
12
+
13
+
14
+ ### Features
15
+
16
+ * **api:** add voice and calls endpoints to the SDKs ([53f68a7](https://github.com/sentdm/sent-dm-ruby/commit/53f68a7293095980d2674fd20bbcc6045883554d))
17
+ * **api:** sync generated SDKs from the committed spec ([b6fbc5a](https://github.com/sentdm/sent-dm-ruby/commit/b6fbc5a4e562a8f0354c7e2a9c9a357d1207cb6b))
18
+
3
19
  ## [0.34.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.33.0...v0.34.0) (2026-09-30)
4
20
 
5
21
 
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "sentdm", "~> 0.34.0"
20
+ gem "sentdm", "~> 0.36.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -289,23 +289,25 @@ sent.messages.send_(**params)
289
289
  Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:
290
290
 
291
291
  ```ruby
292
- # :PRIVATE_PROFIT
293
- puts(Sentdm::BrandBusinessInfo::EntityType::PRIVATE_PROFIT)
292
+ # :ACTIVE
293
+ puts(Sentdm::Channels::VoiceUpdateParams::Status::ACTIVE)
294
294
 
295
- # Revealed type: `T.all(Sentdm::BrandBusinessInfo::EntityType, Symbol)`
296
- T.reveal_type(Sentdm::BrandBusinessInfo::EntityType::PRIVATE_PROFIT)
295
+ # Revealed type: `T.all(Sentdm::Channels::VoiceUpdateParams::Status, Symbol)`
296
+ T.reveal_type(Sentdm::Channels::VoiceUpdateParams::Status::ACTIVE)
297
297
  ```
298
298
 
299
299
  Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
300
300
 
301
301
  ```ruby
302
- Sentdm::BrandBusinessInfo.new(
303
- entity_type: Sentdm::BrandBusinessInfo::EntityType::PRIVATE_PROFIT,
302
+ # Using the enum constants preserves the tagged type information:
303
+ sent.channels.voice.update(
304
+ status: Sentdm::Channels::VoiceUpdateParams::Status::ACTIVE,
304
305
  # …
305
306
  )
306
307
 
307
- Sentdm::BrandBusinessInfo.new(
308
- entity_type: :PRIVATE_PROFIT,
308
+ # Literal values are also permissible:
309
+ sent.channels.voice.update(
310
+ status: :ACTIVE,
309
311
  # …
310
312
  )
311
313
  ```
data/lib/sentdm/client.rb CHANGED
@@ -89,6 +89,11 @@ module Sentdm
89
89
  # the send pipeline. It is a new attempt, not a free retry: every policy runs
90
90
  # again, the message is billed again, and its status webhooks fire again. A
91
91
  # FILTERED message is never resendable.
92
+ #
93
+ # **A scheduled message can be called off.** `POST /v3/messages/{id}/cancel`
94
+ # cancels a send you scheduled with `scheduled_at`, as long as it has not been
95
+ # released yet. Cancelling is free, fires `message.cancelled`, and is final — a
96
+ # cancelled message cannot be resent.
92
97
  # @return [Sentdm::Resources::Messages]
93
98
  attr_reader :messages
94
99
 
@@ -115,6 +120,29 @@ module Sentdm
115
120
  # @return [Sentdm::Resources::Conversations]
116
121
  attr_reader :conversations
117
122
 
123
+ # Phone calls from the numbers you hold, driven by your own callback URL.
124
+ #
125
+ # `POST /v3/channels/voice` enables a number for calls, with the callback URL Sent
126
+ # asks what to do with each call on it, and `POST /v3/channels/voice/tokens` mints
127
+ # a short-lived token that lets a user of your app place and receive calls as that
128
+ # number. When a call arrives or a caller presses a key, a signed question is
129
+ # POSTed to the callback URL and the answer decides the call;
130
+ # `POST /v3/channels/voice/{number}/test` checks the URL answers the way we need
131
+ # before a real call reaches it, and
132
+ # `POST /v3/channels/voice/{number}/rotate-secret` replaces the signing secret.
133
+ # The call events themselves (`call.completed` and the rest) arrive through your
134
+ # webhooks.
135
+ #
136
+ # Every call is a record under `/v3/calls`: read it, list its recordings once one
137
+ # is ready, hang it up, start or stop recording, and add, mute or remove
138
+ # conference participants while it is live. A leg to a phone number runs for at
139
+ # most what your balance affords at the destination's rate.
140
+ # @return [Sentdm::Resources::Calls]
141
+ attr_reader :calls
142
+
143
+ # @return [Sentdm::Resources::Channels]
144
+ attr_reader :channels
145
+
118
146
  # Who the current key is.
119
147
  #
120
148
  # `GET /v3/me` answers with the account the key authenticates as, which is the
@@ -193,6 +221,8 @@ module Sentdm
193
221
  @messages = Sentdm::Resources::Messages.new(client: self)
194
222
  @contacts = Sentdm::Resources::Contacts.new(client: self)
195
223
  @conversations = Sentdm::Resources::Conversations.new(client: self)
224
+ @calls = Sentdm::Resources::Calls.new(client: self)
225
+ @channels = Sentdm::Resources::Channels.new(client: self)
196
226
  @me = Sentdm::Resources::Me.new(client: self)
197
227
  end
198
228
  end
@@ -0,0 +1,115 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Internal
5
+ # @generic Elem
6
+ #
7
+ # @example
8
+ # if calls_page.has_next?
9
+ # calls_page = calls_page.next_page
10
+ # end
11
+ #
12
+ # @example
13
+ # calls_page.auto_paging_each do |call|
14
+ # puts(call)
15
+ # end
16
+ class CallsPage
17
+ include Sentdm::Internal::Type::BasePage
18
+
19
+ # @return [Data]
20
+ attr_accessor :data
21
+
22
+ # @return [Boolean]
23
+ def next_page?
24
+ data&.pagination&.has_more
25
+ end
26
+
27
+ # @raise [Sentdm::HTTP::Error]
28
+ # @return [self]
29
+ def next_page
30
+ unless next_page?
31
+ message = "No more pages available. Please check #next_page? before calling ##{__method__}"
32
+ raise RuntimeError.new(message)
33
+ end
34
+
35
+ req = Sentdm::Internal::Util.deep_merge(
36
+ @req,
37
+ {query: {page: @req.fetch(:query).fetch(:page, 1).to_i.succ}}
38
+ )
39
+ @client.request(req)
40
+ end
41
+
42
+ # @param blk [Proc]
43
+ #
44
+ # @yieldparam [generic<Elem>]
45
+ def auto_paging_each(&blk)
46
+ unless block_given?
47
+ raise ArgumentError.new("A block must be given to ##{__method__}")
48
+ end
49
+
50
+ page = self
51
+ loop do
52
+ page.data&.calls&.each(&blk)
53
+
54
+ break unless page.next_page?
55
+ page = page.next_page
56
+ end
57
+ end
58
+
59
+ # @api private
60
+ #
61
+ # @param client [Sentdm::Internal::Transport::BaseClient]
62
+ # @param req [Hash{Symbol=>Object}]
63
+ # @param headers [Hash{String=>String}]
64
+ # @param page_data [Hash{Symbol=>Object}]
65
+ def initialize(client:, req:, headers:, page_data:)
66
+ super
67
+
68
+ case page_data
69
+ in {data: Hash | nil => data}
70
+ if (calls = data[:calls]).is_a?(Array)
71
+ data = {**data, calls: calls.map { Sentdm::Internal::Type::Converter.coerce(@model, _1) }}
72
+ end
73
+ @data = Sentdm::Internal::Type::Converter.coerce(Sentdm::Internal::CallsPage::Data, data)
74
+ else
75
+ end
76
+ end
77
+
78
+ # @api private
79
+ #
80
+ # @return [String]
81
+ def inspect
82
+ model = Sentdm::Internal::Type::Converter.inspect(@model, depth: 1)
83
+
84
+ "#<#{self.class}[#{model}]:0x#{object_id.to_s(16)}>"
85
+ end
86
+
87
+ class Data < Sentdm::Internal::Type::BaseModel
88
+ # @!attribute calls
89
+ #
90
+ # @return [Array<Object>, nil]
91
+ optional :calls, Sentdm::Internal::Type::ArrayOf[Sentdm::Internal::Type::Unknown]
92
+
93
+ # @!attribute pagination
94
+ #
95
+ # @return [Data::Pagination, nil]
96
+ optional :pagination, -> { Data::Pagination }
97
+
98
+ # @!method initialize(calls: nil, pagination: nil)
99
+ # @param calls [Array<Object>]
100
+ # @param pagination [Data::Pagination]
101
+
102
+ # @see Data#pagination
103
+ class Pagination < Sentdm::Internal::Type::BaseModel
104
+ # @!attribute has_more
105
+ #
106
+ # @return [Boolean, nil]
107
+ optional :has_more, Sentdm::Internal::Type::Boolean
108
+
109
+ # @!method initialize(has_more: nil)
110
+ # @param has_more [Boolean]
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ # @see Sentdm::Resources::Calls#retrieve
6
+ class APIResponseOfCall < Sentdm::Internal::Type::BaseModel
7
+ # @!attribute data
8
+ # A call record
9
+ #
10
+ # @return [Sentdm::Models::Call, nil]
11
+ optional :data, -> { Sentdm::Call }, nil?: true
12
+
13
+ # @!attribute error
14
+ # Error information
15
+ #
16
+ # @return [Sentdm::Models::ErrorDetail, nil]
17
+ optional :error, -> { Sentdm::ErrorDetail }, nil?: true
18
+
19
+ # @!attribute meta
20
+ # Request and response metadata
21
+ #
22
+ # @return [Sentdm::Models::APIMeta, nil]
23
+ optional :meta, -> { Sentdm::APIMeta }
24
+
25
+ # @!attribute success
26
+ # Indicates whether the request was successful
27
+ #
28
+ # @return [Boolean, nil]
29
+ optional :success, Sentdm::Internal::Type::Boolean
30
+
31
+ # @!method initialize(data: nil, error: nil, meta: nil, success: nil)
32
+ # Standard API response envelope for all v3 endpoints
33
+ #
34
+ # @param data [Sentdm::Models::Call, nil] A call record
35
+ #
36
+ # @param error [Sentdm::Models::ErrorDetail, nil] Error information
37
+ #
38
+ # @param meta [Sentdm::Models::APIMeta] Request and response metadata
39
+ #
40
+ # @param success [Boolean] Indicates whether the request was successful
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ # @see Sentdm::Resources::Calls#list_recordings
6
+ class APIResponseOfCallRecordings < Sentdm::Internal::Type::BaseModel
7
+ # @!attribute data
8
+ # The recordings of a call, each as a short-lived download link
9
+ #
10
+ # @return [Sentdm::Models::CallRecordings, nil]
11
+ optional :data, -> { Sentdm::CallRecordings }, nil?: true
12
+
13
+ # @!attribute error
14
+ # Error information
15
+ #
16
+ # @return [Sentdm::Models::ErrorDetail, nil]
17
+ optional :error, -> { Sentdm::ErrorDetail }, nil?: true
18
+
19
+ # @!attribute meta
20
+ # Request and response metadata
21
+ #
22
+ # @return [Sentdm::Models::APIMeta, nil]
23
+ optional :meta, -> { Sentdm::APIMeta }
24
+
25
+ # @!attribute success
26
+ # Indicates whether the request was successful
27
+ #
28
+ # @return [Boolean, nil]
29
+ optional :success, Sentdm::Internal::Type::Boolean
30
+
31
+ # @!method initialize(data: nil, error: nil, meta: nil, success: nil)
32
+ # Standard API response envelope for all v3 endpoints
33
+ #
34
+ # @param data [Sentdm::Models::CallRecordings, nil] The recordings of a call, each as a short-lived download link
35
+ #
36
+ # @param error [Sentdm::Models::ErrorDetail, nil] Error information
37
+ #
38
+ # @param meta [Sentdm::Models::APIMeta] Request and response metadata
39
+ #
40
+ # @param success [Boolean] Indicates whether the request was successful
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIResponseOfCallsList < Sentdm::Internal::Type::BaseModel
6
+ # @!attribute data
7
+ # Paginated list of calls
8
+ #
9
+ # @return [Sentdm::Models::CallsList, nil]
10
+ optional :data, -> { Sentdm::CallsList }, nil?: true
11
+
12
+ # @!attribute error
13
+ # Error information
14
+ #
15
+ # @return [Sentdm::Models::ErrorDetail, nil]
16
+ optional :error, -> { Sentdm::ErrorDetail }, nil?: true
17
+
18
+ # @!attribute meta
19
+ # Request and response metadata
20
+ #
21
+ # @return [Sentdm::Models::APIMeta, nil]
22
+ optional :meta, -> { Sentdm::APIMeta }
23
+
24
+ # @!attribute success
25
+ # Indicates whether the request was successful
26
+ #
27
+ # @return [Boolean, nil]
28
+ optional :success, Sentdm::Internal::Type::Boolean
29
+
30
+ # @!method initialize(data: nil, error: nil, meta: nil, success: nil)
31
+ # Standard API response envelope for all v3 endpoints
32
+ #
33
+ # @param data [Sentdm::Models::CallsList, nil] Paginated list of calls
34
+ #
35
+ # @param error [Sentdm::Models::ErrorDetail, nil] Error information
36
+ #
37
+ # @param meta [Sentdm::Models::APIMeta] Request and response metadata
38
+ #
39
+ # @param success [Boolean] Indicates whether the request was successful
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,134 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ # @see Sentdm::Resources::Calls#list
6
+ class Call < Sentdm::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The call id, the same one carried by the call.request question and every call
9
+ # webhook
10
+ #
11
+ # @return [String, nil]
12
+ optional :id, String
13
+
14
+ # @!attribute answered_at
15
+ # When the call was answered (UTC). Null until then, and always null for a call
16
+ # between two of your app users
17
+ #
18
+ # @return [Time, nil]
19
+ optional :answered_at, Time, nil?: true
20
+
21
+ # @!attribute direction
22
+ # outbound for a call placed from your app, inbound for a call to one of your
23
+ # numbers
24
+ #
25
+ # @return [String, nil]
26
+ optional :direction, String
27
+
28
+ # @!attribute duration_seconds
29
+ # Billable duration in seconds. Null while the call is live
30
+ #
31
+ # @return [Integer, nil]
32
+ optional :duration_seconds, Integer, nil?: true
33
+
34
+ # @!attribute ended_at
35
+ # When the call ended (UTC). Null while the call is live
36
+ #
37
+ # @return [Time, nil]
38
+ optional :ended_at, Time, nil?: true
39
+
40
+ # @!attribute failure_reason
41
+ # Why the call did not complete: callback_timeout, invalid_answer,
42
+ # insufficient_balance, destination_blocked, callback_not_configured, rejected or
43
+ # no_answer. Null while the call is live, when it completed, and when it failed
44
+ # without a recorded reason
45
+ #
46
+ # @return [String, nil]
47
+ optional :failure_reason, String, nil?: true
48
+
49
+ # @!attribute from
50
+ # One end of a call
51
+ #
52
+ # @return [Sentdm::Models::CallParty, nil]
53
+ optional :from, -> { Sentdm::CallParty }
54
+
55
+ # @!attribute number
56
+ # Your number that owns the call, in E.164 format: the dialed number for an
57
+ # inbound call, the caller's bound number for a call placed from your app
58
+ #
59
+ # @return [String, nil]
60
+ optional :number, String
61
+
62
+ # @!attribute price
63
+ # What the call cost. Null until it has been priced
64
+ #
65
+ # @return [Float, nil]
66
+ optional :price, Float, nil?: true
67
+
68
+ # @!attribute recording_available
69
+ # True once a recording of the call is available
70
+ #
71
+ # @return [Boolean, nil]
72
+ optional :recording_available, Sentdm::Internal::Type::Boolean
73
+
74
+ # @!attribute started_at
75
+ # When the call was placed (UTC)
76
+ #
77
+ # @return [Time, nil]
78
+ optional :started_at, Time
79
+
80
+ # @!attribute status
81
+ # INITIATED, RINGING, ANSWERED, COMPLETED, FAILED, NO_ANSWER or REJECTED
82
+ #
83
+ # @return [String, nil]
84
+ optional :status, String
85
+
86
+ # @!attribute timeline
87
+ # When the call entered each status, oldest first. Only returned when reading one
88
+ # call
89
+ #
90
+ # @return [Array<Sentdm::Models::CallTimelineEntry>, nil]
91
+ optional :timeline, -> { Sentdm::Internal::Type::ArrayOf[Sentdm::CallTimelineEntry] }, nil?: true
92
+
93
+ # @!attribute to
94
+ # One end of a call
95
+ #
96
+ # @return [Sentdm::Models::CallParty, nil]
97
+ optional :to, -> { Sentdm::CallParty }
98
+
99
+ # @!method initialize(id: nil, answered_at: nil, direction: nil, duration_seconds: nil, ended_at: nil, failure_reason: nil, from: nil, number: nil, price: nil, recording_available: nil, started_at: nil, status: nil, timeline: nil, to: nil)
100
+ # Some parameter documentations has been truncated, see {Sentdm::Models::Call} for
101
+ # more details.
102
+ #
103
+ # A call record
104
+ #
105
+ # @param id [String] The call id, the same one carried by the call.request question and every call we
106
+ #
107
+ # @param answered_at [Time, nil] When the call was answered (UTC). Null until then, and always null for a call be
108
+ #
109
+ # @param direction [String] outbound for a call placed from your app, inbound for a call to one of your numb
110
+ #
111
+ # @param duration_seconds [Integer, nil] Billable duration in seconds. Null while the call is live
112
+ #
113
+ # @param ended_at [Time, nil] When the call ended (UTC). Null while the call is live
114
+ #
115
+ # @param failure_reason [String, nil] Why the call did not complete: callback_timeout, invalid_answer, insufficient_ba
116
+ #
117
+ # @param from [Sentdm::Models::CallParty] One end of a call
118
+ #
119
+ # @param number [String] Your number that owns the call, in E.164 format: the dialed number for an inboun
120
+ #
121
+ # @param price [Float, nil] What the call cost. Null until it has been priced
122
+ #
123
+ # @param recording_available [Boolean] True once a recording of the call is available
124
+ #
125
+ # @param started_at [Time] When the call was placed (UTC)
126
+ #
127
+ # @param status [String] INITIATED, RINGING, ANSWERED, COMPLETED, FAILED, NO_ANSWER or REJECTED
128
+ #
129
+ # @param timeline [Array<Sentdm::Models::CallTimelineEntry>, nil] When the call entered each status, oldest first. Only returned when reading one
130
+ #
131
+ # @param to [Sentdm::Models::CallParty] One end of a call
132
+ end
133
+ end
134
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ class CallEvent < Sentdm::Internal::Type::BaseModel
6
+ # @!attribute event
7
+ # The specific event within the family, for example message.delivered,
8
+ # message.received or contact.opt_out. Absent on events that have no subtype, so
9
+ # treat it as optional.
10
+ #
11
+ # @return [String, nil]
12
+ optional :event, String, nil?: true
13
+
14
+ # @!attribute field
15
+ # The event family, for example message, templates or contact. Route on this
16
+ # first, then on event for the specific change.
17
+ #
18
+ # @return [String, nil]
19
+ optional :field, String
20
+
21
+ # @!attribute payload
22
+ # Body of a call.initiated, call.answered, call.completed, call.failed or
23
+ # call.recording_ready event. Which of them occurred is the envelope's event.
24
+ #
25
+ # Shaped like the message, inbound, template and channel payloads: account_id
26
+ # names the account the event is about, channel names the channel, and updated_at
27
+ # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
28
+ # duration_seconds and price are added on call.completed, reason on call.failed
29
+ # and recording_id on call.recording_ready; each is omitted rather than sent as
30
+ # null when it does not apply.
31
+ #
32
+ # Casing is snake_case because these ride the same webhook stream customers
33
+ # already parse message_id from; the question/answer contract is a separate
34
+ # surface and stays camelCase. Nothing here is provider-shaped: no provider call
35
+ # id, no namespaced identity.
36
+ #
37
+ # @return [Sentdm::Models::CallEventPayload, nil]
38
+ optional :payload, -> { Sentdm::CallEventPayload }, nil?: true
39
+
40
+ # @!attribute request_id
41
+ # The event-specific body.
42
+ #
43
+ # @return [String, nil]
44
+ optional :request_id, String, nil?: true
45
+
46
+ # @!attribute timestamp
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
+ #
51
+ # @return [String, nil]
52
+ optional :timestamp, String
53
+
54
+ # @!method initialize(event: nil, field: nil, payload: nil, request_id: nil, timestamp: nil)
55
+ # Some parameter documentations has been truncated, see
56
+ # {Sentdm::Models::CallEvent} for more details.
57
+ #
58
+ # The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
59
+ # this shape and varies only in Payload.
60
+ #
61
+ # @param event [String, nil] The specific event within the family, for example message.delivered,
62
+ #
63
+ # @param field [String] The event family, for example message, templates or contact. Route on
64
+ #
65
+ # @param payload [Sentdm::Models::CallEventPayload, nil] Body of a call.initiated, call.answered, call.completed, call.failed
66
+ #
67
+ # @param request_id [String, nil] The event-specific body.
68
+ #
69
+ # @param timestamp [String] When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ class CallEventPayload < Sentdm::Internal::Type::BaseModel
6
+ # @!attribute call_id
7
+ # Sent's call id, the same one the customer saw on the first question.
8
+ #
9
+ # @return [String]
10
+ required :call_id, String
11
+
12
+ # @!attribute account_id
13
+ # The account the call belongs to: the key's own customer, or the sender profile
14
+ # it acted as.
15
+ #
16
+ # @return [String, nil]
17
+ optional :account_id, String
18
+
19
+ # @!attribute channel
20
+ # Always voice.
21
+ #
22
+ # @return [String, nil]
23
+ optional :channel, String
24
+
25
+ # @!attribute duration_seconds
26
+ # How long the call lasted. Only on call.completed.
27
+ #
28
+ # @return [Integer, nil]
29
+ optional :duration_seconds, Integer, nil?: true
30
+
31
+ # @!attribute number
32
+ # The customer number that owns the call, in E.164 format.
33
+ #
34
+ # @return [String, nil]
35
+ optional :number, String
36
+
37
+ # @!attribute price
38
+ # What the call was charged. Only on call.completed, and omitted there until
39
+ # billing has recorded the charge.
40
+ #
41
+ # @return [Float, nil]
42
+ optional :price, Float, nil?: true
43
+
44
+ # @!attribute reason
45
+ # The machine-readable reason the call did not complete. Only on call.failed, and
46
+ # omitted when no reason was recorded.
47
+ #
48
+ # @return [String, nil]
49
+ optional :reason, String, nil?: true
50
+
51
+ # @!attribute recording_id
52
+ # The recording that became available, the same id GET /v3/calls/{id}/recordings
53
+ # lists it under. Only on call.recording_ready, which is sent once per recording.
54
+ #
55
+ # @return [String, nil]
56
+ optional :recording_id, String, nil?: true
57
+
58
+ # @!attribute updated_at
59
+ # When the change happened on the call, as opposed to when the event was emitted.
60
+ #
61
+ # @return [String, nil]
62
+ optional :updated_at, String
63
+
64
+ # @!method initialize(call_id:, account_id: nil, channel: nil, duration_seconds: nil, number: nil, price: nil, reason: nil, recording_id: nil, updated_at: nil)
65
+ # Some parameter documentations has been truncated, see
66
+ # {Sentdm::Models::CallEventPayload} for more details.
67
+ #
68
+ # Body of a call.initiated, call.answered, call.completed, call.failed or
69
+ # call.recording_ready event. Which of them occurred is the envelope's event.
70
+ #
71
+ # Shaped like the message, inbound, template and channel payloads: account_id
72
+ # names the account the event is about, channel names the channel, and updated_at
73
+ # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
74
+ # duration_seconds and price are added on call.completed, reason on call.failed
75
+ # and recording_id on call.recording_ready; each is omitted rather than sent as
76
+ # null when it does not apply.
77
+ #
78
+ # Casing is snake_case because these ride the same webhook stream customers
79
+ # already parse message_id from; the question/answer contract is a separate
80
+ # surface and stays camelCase. Nothing here is provider-shaped: no provider call
81
+ # id, no namespaced identity.
82
+ #
83
+ # @param call_id [String] Sent's call id, the same one the customer saw on the first question.
84
+ #
85
+ # @param account_id [String] The account the call belongs to: the key's own customer, or the sender profile i
86
+ #
87
+ # @param channel [String] Always voice.
88
+ #
89
+ # @param duration_seconds [Integer, nil] How long the call lasted. Only on call.completed.
90
+ #
91
+ # @param number [String] The customer number that owns the call, in E.164 format.
92
+ #
93
+ # @param price [Float, nil] What the call was charged. Only on call.completed, and omitted there until billi
94
+ #
95
+ # @param reason [String, nil] The machine-readable reason the call did not complete. Only on call.failed, and
96
+ #
97
+ # @param recording_id [String, nil] The recording that became available, the same id GET /v3/calls/{id}/recordings l
98
+ #
99
+ # @param updated_at [String] When the change happened on the call, as opposed to when the event was emitted.
100
+ end
101
+ end
102
+ end