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
@@ -0,0 +1,61 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ class VoiceTestParams < Sentdm::Models::MutationRequest
7
+ extend Sentdm::Internal::Type::RequestParameters::Converter
8
+ include Sentdm::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(Sentdm::Channels::VoiceTestParams, Sentdm::Internal::AnyHash)
13
+ end
14
+
15
+ sig { returns(String) }
16
+ attr_accessor :number
17
+
18
+ sig { returns(T.nilable(String)) }
19
+ attr_reader :idempotency_key
20
+
21
+ sig { params(idempotency_key: String).void }
22
+ attr_writer :idempotency_key
23
+
24
+ sig { returns(T.nilable(String)) }
25
+ attr_reader :x_profile_id
26
+
27
+ sig { params(x_profile_id: String).void }
28
+ attr_writer :x_profile_id
29
+
30
+ sig do
31
+ params(
32
+ number: String,
33
+ idempotency_key: String,
34
+ x_profile_id: String,
35
+ request_options: Sentdm::RequestOptions::OrHash
36
+ ).returns(T.attached_class)
37
+ end
38
+ def self.new(
39
+ number:,
40
+ idempotency_key: nil,
41
+ x_profile_id: nil,
42
+ request_options: {}
43
+ )
44
+ end
45
+
46
+ sig do
47
+ override.returns(
48
+ {
49
+ number: String,
50
+ idempotency_key: String,
51
+ x_profile_id: String,
52
+ request_options: Sentdm::RequestOptions
53
+ }
54
+ )
55
+ end
56
+ def to_hash
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,76 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ class VoiceToken < Sentdm::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(Sentdm::Channels::VoiceToken, Sentdm::Internal::AnyHash)
10
+ end
11
+
12
+ # The signed token. Hand it to the client SDK unchanged.
13
+ sig { returns(T.nilable(String)) }
14
+ attr_reader :token
15
+
16
+ sig { params(token: String).void }
17
+ attr_writer :token
18
+
19
+ # When the token expires (UTC)
20
+ sig { returns(T.nilable(Time)) }
21
+ attr_reader :expires_at
22
+
23
+ sig { params(expires_at: Time).void }
24
+ attr_writer :expires_at
25
+
26
+ # The identity the token was minted for
27
+ sig { returns(T.nilable(String)) }
28
+ attr_reader :identity
29
+
30
+ sig { params(identity: String).void }
31
+ attr_writer :identity
32
+
33
+ # The phone number this identity is now bound to, in E.164 format
34
+ sig { returns(T.nilable(String)) }
35
+ attr_reader :number
36
+
37
+ sig { params(number: String).void }
38
+ attr_writer :number
39
+
40
+ # A short-lived token your app passes to the voice client SDK to register
41
+ sig do
42
+ params(
43
+ token: String,
44
+ expires_at: Time,
45
+ identity: String,
46
+ number: String
47
+ ).returns(T.attached_class)
48
+ end
49
+ def self.new(
50
+ # The signed token. Hand it to the client SDK unchanged.
51
+ token: nil,
52
+ # When the token expires (UTC)
53
+ expires_at: nil,
54
+ # The identity the token was minted for
55
+ identity: nil,
56
+ # The phone number this identity is now bound to, in E.164 format
57
+ number: nil
58
+ )
59
+ end
60
+
61
+ sig do
62
+ override.returns(
63
+ {
64
+ token: String,
65
+ expires_at: Time,
66
+ identity: String,
67
+ number: String
68
+ }
69
+ )
70
+ end
71
+ def to_hash
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,158 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ class VoiceUpdateParams < Sentdm::Internal::Type::BaseModel
7
+ extend Sentdm::Internal::Type::RequestParameters::Converter
8
+ include Sentdm::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Sentdm::Channels::VoiceUpdateParams,
14
+ Sentdm::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :number
20
+
21
+ # A new callback URL for the number, active or not: an absolute HTTP or HTTPS URL
22
+ # on a public host, where Sent asks what to do with each call. The signing secret
23
+ # is kept.
24
+ sig { returns(T.nilable(String)) }
25
+ attr_accessor :callback_url
26
+
27
+ # true makes this the line app-originated calls are placed from when a voice token
28
+ # names no number. false is refused: an account with active voice numbers always
29
+ # has exactly one default, so the default moves by giving it to another number.
30
+ sig { returns(T.nilable(T::Boolean)) }
31
+ attr_accessor :default_for_app_calls
32
+
33
+ # Sandbox flag - when true, the operation is simulated without side effects Useful
34
+ # for testing integrations without actual execution
35
+ sig { returns(T.nilable(T::Boolean)) }
36
+ attr_reader :sandbox
37
+
38
+ sig { params(sandbox: T::Boolean).void }
39
+ attr_writer :sandbox
40
+
41
+ # ACTIVE turns calls on for the number again, INACTIVE turns them off. Matched
42
+ # ignoring case. Turning the default line off is refused while other active voice
43
+ # numbers remain.
44
+ sig do
45
+ returns(
46
+ T.nilable(Sentdm::Channels::VoiceUpdateParams::Status::OrSymbol)
47
+ )
48
+ end
49
+ attr_accessor :status
50
+
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :idempotency_key
53
+
54
+ sig { params(idempotency_key: String).void }
55
+ attr_writer :idempotency_key
56
+
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :x_profile_id
59
+
60
+ sig { params(x_profile_id: String).void }
61
+ attr_writer :x_profile_id
62
+
63
+ sig do
64
+ params(
65
+ number: String,
66
+ callback_url: T.nilable(String),
67
+ default_for_app_calls: T.nilable(T::Boolean),
68
+ sandbox: T::Boolean,
69
+ status:
70
+ T.nilable(Sentdm::Channels::VoiceUpdateParams::Status::OrSymbol),
71
+ idempotency_key: String,
72
+ x_profile_id: String,
73
+ request_options: Sentdm::RequestOptions::OrHash
74
+ ).returns(T.attached_class)
75
+ end
76
+ def self.new(
77
+ number:,
78
+ # A new callback URL for the number, active or not: an absolute HTTP or HTTPS URL
79
+ # on a public host, where Sent asks what to do with each call. The signing secret
80
+ # is kept.
81
+ callback_url: nil,
82
+ # true makes this the line app-originated calls are placed from when a voice token
83
+ # names no number. false is refused: an account with active voice numbers always
84
+ # has exactly one default, so the default moves by giving it to another number.
85
+ default_for_app_calls: nil,
86
+ # Sandbox flag - when true, the operation is simulated without side effects Useful
87
+ # for testing integrations without actual execution
88
+ sandbox: nil,
89
+ # ACTIVE turns calls on for the number again, INACTIVE turns them off. Matched
90
+ # ignoring case. Turning the default line off is refused while other active voice
91
+ # numbers remain.
92
+ status: nil,
93
+ idempotency_key: nil,
94
+ x_profile_id: nil,
95
+ request_options: {}
96
+ )
97
+ end
98
+
99
+ sig do
100
+ override.returns(
101
+ {
102
+ number: String,
103
+ callback_url: T.nilable(String),
104
+ default_for_app_calls: T.nilable(T::Boolean),
105
+ sandbox: T::Boolean,
106
+ status:
107
+ T.nilable(
108
+ Sentdm::Channels::VoiceUpdateParams::Status::OrSymbol
109
+ ),
110
+ idempotency_key: String,
111
+ x_profile_id: String,
112
+ request_options: Sentdm::RequestOptions
113
+ }
114
+ )
115
+ end
116
+ def to_hash
117
+ end
118
+
119
+ # ACTIVE turns calls on for the number again, INACTIVE turns them off. Matched
120
+ # ignoring case. Turning the default line off is refused while other active voice
121
+ # numbers remain.
122
+ module Status
123
+ extend Sentdm::Internal::Type::Enum
124
+
125
+ TaggedSymbol =
126
+ T.type_alias do
127
+ T.all(Symbol, Sentdm::Channels::VoiceUpdateParams::Status)
128
+ end
129
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
130
+
131
+ # Turns calls on for the number again. The callback URL and the signing secret it had are kept; send `callback_url` in the same call to replace the URL.
132
+ ACTIVE =
133
+ T.let(
134
+ :ACTIVE,
135
+ Sentdm::Channels::VoiceUpdateParams::Status::TaggedSymbol
136
+ )
137
+
138
+ # Turns calls off for the number. Refused while the number is the default line for app calls and other active voice numbers remain; move the default first. The callback URL and the secret stay on the number.
139
+ INACTIVE =
140
+ T.let(
141
+ :INACTIVE,
142
+ Sentdm::Channels::VoiceUpdateParams::Status::TaggedSymbol
143
+ )
144
+
145
+ sig do
146
+ override.returns(
147
+ T::Array[
148
+ Sentdm::Channels::VoiceUpdateParams::Status::TaggedSymbol
149
+ ]
150
+ )
151
+ end
152
+ def self.values
153
+ end
154
+ end
155
+ end
156
+ end
157
+ end
158
+ end
@@ -70,12 +70,17 @@ module Sentdm
70
70
 
71
71
  # message.scheduled only: why the message is held, either because you scheduled it
72
72
  # or because the recipient is inside a protected quiet-hours window. Omitted on
73
- # every other event.
73
+ # every other event, including message.cancelled — that is a property of the hold,
74
+ # not of the cancellation, and repeating it there would read as "why was this
75
+ # cancelled", which it does not answer.
74
76
  sig { returns(T.nilable(String)) }
75
77
  attr_accessor :schedule_reason
76
78
 
77
- # message.scheduled only: when the held message will be released for delivery, in
78
- # UTC (yyyy-MM-ddTHH:mm:ssZ). Omitted on every other event.
79
+ # message.scheduled and message.cancelled only, in UTC (yyyy-MM-ddTHH:mm:ssZ): on
80
+ # message.scheduled it is when the held message will be released for delivery, on
81
+ # message.cancelled the release instant that was called off — the same instant,
82
+ # before and after. A consumer that recorded a future send from the first event
83
+ # has what it needs to un-record it from the second. Omitted on every other event.
79
84
  sig { returns(T.nilable(String)) }
80
85
  attr_accessor :scheduled_at
81
86
 
@@ -149,10 +154,15 @@ module Sentdm
149
154
  reason_code: nil,
150
155
  # message.scheduled only: why the message is held, either because you scheduled it
151
156
  # or because the recipient is inside a protected quiet-hours window. Omitted on
152
- # every other event.
157
+ # every other event, including message.cancelled — that is a property of the hold,
158
+ # not of the cancellation, and repeating it there would read as "why was this
159
+ # cancelled", which it does not answer.
153
160
  schedule_reason: nil,
154
- # message.scheduled only: when the held message will be released for delivery, in
155
- # UTC (yyyy-MM-ddTHH:mm:ssZ). Omitted on every other event.
161
+ # message.scheduled and message.cancelled only, in UTC (yyyy-MM-ddTHH:mm:ssZ): on
162
+ # message.scheduled it is when the held message will be released for delivery, on
163
+ # message.cancelled the release instant that was called off — the same instant,
164
+ # before and after. A consumer that recorded a future send from the first event
165
+ # has what it needs to un-record it from the second. Omitted on every other event.
156
166
  scheduled_at: nil,
157
167
  # The template the message was sent from, when it was sent from one.
158
168
  template_id: nil,
@@ -216,10 +216,12 @@ module Sentdm
216
216
  sig { returns(T.nilable(String)) }
217
217
  attr_accessor :reason_code
218
218
 
219
- # SCHEDULED activities only: when the held message will be released for delivery,
220
- # in UTC. Same wire name as on the send response, the message and the webhook.
221
- # Omitted on every other activity. A message that quiet hours moved at release has
222
- # two SCHEDULED entries, each carrying the instant as it stood at that moment.
219
+ # SCHEDULED and CANCELLED activities only, in UTC: on a SCHEDULED entry, when the
220
+ # held message will be released for delivery; on a CANCELLED entry, the instant
221
+ # that was called off. Same wire name as on the send response, the message and the
222
+ # webhook. Omitted on every other activity. A message that quiet hours moved at
223
+ # release has two SCHEDULED entries, each carrying the instant as it stood at that
224
+ # moment.
223
225
  sig { returns(T.nilable(Time)) }
224
226
  attr_accessor :scheduled_at
225
227
 
@@ -278,10 +280,12 @@ module Sentdm
278
280
  # rather than on reason: the code is stable, the wording may be improved. Same
279
281
  # wire name and vocabulary as on the message and the webhook.
280
282
  reason_code: nil,
281
- # SCHEDULED activities only: when the held message will be released for delivery,
282
- # in UTC. Same wire name as on the send response, the message and the webhook.
283
- # Omitted on every other activity. A message that quiet hours moved at release has
284
- # two SCHEDULED entries, each carrying the instant as it stood at that moment.
283
+ # SCHEDULED and CANCELLED activities only, in UTC: on a SCHEDULED entry, when the
284
+ # held message will be released for delivery; on a CANCELLED entry, the instant
285
+ # that was called off. Same wire name as on the send response, the message and the
286
+ # webhook. Omitted on every other activity. A message that quiet hours moved at
287
+ # release has two SCHEDULED entries, each carrying the instant as it stood at that
288
+ # moment.
285
289
  scheduled_at: nil,
286
290
  # Activity status. Outbound: QUEUED, PROCESSED, ROUTED, SCHEDULED, SENT,
287
291
  # DELIVERED, READ, FAILED. Inbound (from contact): RECEIVED (terminal).
@@ -74,7 +74,7 @@ module Sentdm
74
74
  Sentdm::ChannelEvent::OrHash,
75
75
  Sentdm::ContactEvent::OrHash,
76
76
  Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload::OrHash,
77
- Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::OrHash
77
+ Sentdm::CallEvent::OrHash
78
78
  )
79
79
  ).void
80
80
  end
@@ -113,7 +113,7 @@ module Sentdm
113
113
  Sentdm::ChannelEvent::OrHash,
114
114
  Sentdm::ContactEvent::OrHash,
115
115
  Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload::OrHash,
116
- Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::OrHash
116
+ Sentdm::CallEvent::OrHash
117
117
  ),
118
118
  event_type: String,
119
119
  http_status_code: T.nilable(Integer),
@@ -204,7 +204,7 @@ module Sentdm
204
204
  Sentdm::ChannelEvent,
205
205
  Sentdm::ContactEvent,
206
206
  Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfLinkWebhookPayload,
207
- Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload
207
+ Sentdm::CallEvent
208
208
  )
209
209
  end
210
210
 
@@ -632,272 +632,6 @@ module Sentdm
632
632
  end
633
633
  end
634
634
 
635
- class SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload < Sentdm::Internal::Type::BaseModel
636
- OrHash =
637
- T.type_alias do
638
- T.any(
639
- Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload,
640
- Sentdm::Internal::AnyHash
641
- )
642
- end
643
-
644
- # The specific event within the family, for example message.delivered,
645
- # message.received or contact.opt_out. Absent on events that have no subtype, so
646
- # treat it as optional.
647
- sig { returns(T.nilable(String)) }
648
- attr_accessor :event
649
-
650
- # The event family, for example message, templates or contact. Route on this
651
- # first, then on event for the specific change.
652
- sig { returns(T.nilable(String)) }
653
- attr_reader :field
654
-
655
- sig { params(field: String).void }
656
- attr_writer :field
657
-
658
- # Body of a call.initiated, call.answered, call.completed, call.failed or
659
- # call.recording_ready event. Which of them occurred is the envelope's event.
660
- #
661
- # Shaped like the message, inbound, template and channel payloads: account_id
662
- # names the account the event is about, channel names the channel, and updated_at
663
- # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
664
- # duration_seconds and price are added on call.completed, reason on call.failed
665
- # and recording_id on call.recording_ready; each is omitted rather than sent as
666
- # null when it does not apply.
667
- #
668
- # Casing is snake_case because these ride the same webhook stream customers
669
- # already parse message_id from; the question/answer contract is a separate
670
- # surface and stays camelCase. Nothing here is provider-shaped: no provider call
671
- # id, no namespaced identity.
672
- sig do
673
- returns(
674
- T.nilable(
675
- Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::Payload
676
- )
677
- )
678
- end
679
- attr_reader :payload
680
-
681
- sig do
682
- params(
683
- payload:
684
- T.nilable(
685
- Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::Payload::OrHash
686
- )
687
- ).void
688
- end
689
- attr_writer :payload
690
-
691
- # The event-specific body.
692
- sig { returns(T.nilable(String)) }
693
- attr_accessor :request_id
694
-
695
- # When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
696
- # time, not the time the underlying change happened. Use the timestamp inside the
697
- # payload for the latter.
698
- sig { returns(T.nilable(String)) }
699
- attr_reader :timestamp
700
-
701
- sig { params(timestamp: String).void }
702
- attr_writer :timestamp
703
-
704
- # The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
705
- # this shape and varies only in Payload.
706
- sig do
707
- params(
708
- event: T.nilable(String),
709
- field: String,
710
- payload:
711
- T.nilable(
712
- Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::Payload::OrHash
713
- ),
714
- request_id: T.nilable(String),
715
- timestamp: String
716
- ).returns(T.attached_class)
717
- end
718
- def self.new(
719
- # The specific event within the family, for example message.delivered,
720
- # message.received or contact.opt_out. Absent on events that have no subtype, so
721
- # treat it as optional.
722
- event: nil,
723
- # The event family, for example message, templates or contact. Route on this
724
- # first, then on event for the specific change.
725
- field: nil,
726
- # Body of a call.initiated, call.answered, call.completed, call.failed or
727
- # call.recording_ready event. Which of them occurred is the envelope's event.
728
- #
729
- # Shaped like the message, inbound, template and channel payloads: account_id
730
- # names the account the event is about, channel names the channel, and updated_at
731
- # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
732
- # duration_seconds and price are added on call.completed, reason on call.failed
733
- # and recording_id on call.recording_ready; each is omitted rather than sent as
734
- # null when it does not apply.
735
- #
736
- # Casing is snake_case because these ride the same webhook stream customers
737
- # already parse message_id from; the question/answer contract is a separate
738
- # surface and stays camelCase. Nothing here is provider-shaped: no provider call
739
- # id, no namespaced identity.
740
- payload: nil,
741
- # The event-specific body.
742
- request_id: nil,
743
- # When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
744
- # time, not the time the underlying change happened. Use the timestamp inside the
745
- # payload for the latter.
746
- timestamp: nil
747
- )
748
- end
749
-
750
- sig do
751
- override.returns(
752
- {
753
- event: T.nilable(String),
754
- field: String,
755
- payload:
756
- T.nilable(
757
- Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::Payload
758
- ),
759
- request_id: T.nilable(String),
760
- timestamp: String
761
- }
762
- )
763
- end
764
- def to_hash
765
- end
766
-
767
- class Payload < Sentdm::Internal::Type::BaseModel
768
- OrHash =
769
- T.type_alias do
770
- T.any(
771
- Sentdm::Models::WebhookListEventsResponse::EventData::SentDmServicesCommonServicesWebhooksContractsWebhookEventOfCallWebhookPayload::Payload,
772
- Sentdm::Internal::AnyHash
773
- )
774
- end
775
-
776
- # Sent's call id, the same one the customer saw on the first question.
777
- sig { returns(String) }
778
- attr_accessor :call_id
779
-
780
- # The account the call belongs to: the key's own customer, or the sender profile
781
- # it acted as.
782
- sig { returns(T.nilable(String)) }
783
- attr_reader :account_id
784
-
785
- sig { params(account_id: String).void }
786
- attr_writer :account_id
787
-
788
- # Always voice.
789
- sig { returns(T.nilable(String)) }
790
- attr_reader :channel
791
-
792
- sig { params(channel: String).void }
793
- attr_writer :channel
794
-
795
- # How long the call lasted. Only on call.completed.
796
- sig { returns(T.nilable(Integer)) }
797
- attr_accessor :duration_seconds
798
-
799
- # The customer number that owns the call, in E.164 format.
800
- sig { returns(T.nilable(String)) }
801
- attr_reader :number
802
-
803
- sig { params(number: String).void }
804
- attr_writer :number
805
-
806
- # What the call was charged. Only on call.completed, and omitted there until
807
- # billing has recorded the charge.
808
- sig { returns(T.nilable(Float)) }
809
- attr_accessor :price
810
-
811
- # The machine-readable reason the call did not complete. Only on call.failed, and
812
- # omitted when no reason was recorded.
813
- sig { returns(T.nilable(String)) }
814
- attr_accessor :reason
815
-
816
- # The recording that became available, the same id GET /v3/calls/{id}/recordings
817
- # lists it under. Only on call.recording_ready, which is sent once per recording.
818
- sig { returns(T.nilable(String)) }
819
- attr_accessor :recording_id
820
-
821
- # When the change happened on the call, as opposed to when the event was emitted.
822
- sig { returns(T.nilable(String)) }
823
- attr_reader :updated_at
824
-
825
- sig { params(updated_at: String).void }
826
- attr_writer :updated_at
827
-
828
- # Body of a call.initiated, call.answered, call.completed, call.failed or
829
- # call.recording_ready event. Which of them occurred is the envelope's event.
830
- #
831
- # Shaped like the message, inbound, template and channel payloads: account_id
832
- # names the account the event is about, channel names the channel, and updated_at
833
- # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
834
- # duration_seconds and price are added on call.completed, reason on call.failed
835
- # and recording_id on call.recording_ready; each is omitted rather than sent as
836
- # null when it does not apply.
837
- #
838
- # Casing is snake_case because these ride the same webhook stream customers
839
- # already parse message_id from; the question/answer contract is a separate
840
- # surface and stays camelCase. Nothing here is provider-shaped: no provider call
841
- # id, no namespaced identity.
842
- sig do
843
- params(
844
- call_id: String,
845
- account_id: String,
846
- channel: String,
847
- duration_seconds: T.nilable(Integer),
848
- number: String,
849
- price: T.nilable(Float),
850
- reason: T.nilable(String),
851
- recording_id: T.nilable(String),
852
- updated_at: String
853
- ).returns(T.attached_class)
854
- end
855
- def self.new(
856
- # Sent's call id, the same one the customer saw on the first question.
857
- call_id:,
858
- # The account the call belongs to: the key's own customer, or the sender profile
859
- # it acted as.
860
- account_id: nil,
861
- # Always voice.
862
- channel: nil,
863
- # How long the call lasted. Only on call.completed.
864
- duration_seconds: nil,
865
- # The customer number that owns the call, in E.164 format.
866
- number: nil,
867
- # What the call was charged. Only on call.completed, and omitted there until
868
- # billing has recorded the charge.
869
- price: nil,
870
- # The machine-readable reason the call did not complete. Only on call.failed, and
871
- # omitted when no reason was recorded.
872
- reason: nil,
873
- # The recording that became available, the same id GET /v3/calls/{id}/recordings
874
- # lists it under. Only on call.recording_ready, which is sent once per recording.
875
- recording_id: nil,
876
- # When the change happened on the call, as opposed to when the event was emitted.
877
- updated_at: nil
878
- )
879
- end
880
-
881
- sig do
882
- override.returns(
883
- {
884
- call_id: String,
885
- account_id: String,
886
- channel: String,
887
- duration_seconds: T.nilable(Integer),
888
- number: String,
889
- price: T.nilable(Float),
890
- reason: T.nilable(String),
891
- recording_id: T.nilable(String),
892
- updated_at: String
893
- }
894
- )
895
- end
896
- def to_hash
897
- end
898
- end
899
- end
900
-
901
635
  sig do
902
636
  override.returns(
903
637
  T::Array[