sentdm 0.34.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 (165) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -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/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/webhook_list_events_response.rb +4 -173
  52. data/lib/sentdm/models.rb +36 -0
  53. data/lib/sentdm/resources/calls/participants.rb +231 -0
  54. data/lib/sentdm/resources/calls.rb +235 -0
  55. data/lib/sentdm/resources/channels/voice.rb +381 -0
  56. data/lib/sentdm/resources/channels.rb +45 -0
  57. data/lib/sentdm/version.rb +1 -1
  58. data/lib/sentdm.rb +50 -0
  59. data/rbi/sentdm/client.rbi +23 -0
  60. data/rbi/sentdm/internal/calls_page.rbi +71 -0
  61. data/rbi/sentdm/models/api_response_of_call.rbi +74 -0
  62. data/rbi/sentdm/models/api_response_of_call_recordings.rbi +74 -0
  63. data/rbi/sentdm/models/api_response_of_calls_list.rbi +74 -0
  64. data/rbi/sentdm/models/call.rbi +177 -0
  65. data/rbi/sentdm/models/call_event.rbi +114 -0
  66. data/rbi/sentdm/models/call_event_payload.rbi +135 -0
  67. data/rbi/sentdm/models/call_hangup_params.rbi +59 -0
  68. data/rbi/sentdm/models/call_list_params.rbi +112 -0
  69. data/rbi/sentdm/models/call_list_recordings_params.rbi +46 -0
  70. data/rbi/sentdm/models/call_party.rbi +41 -0
  71. data/rbi/sentdm/models/call_record_params.rbi +83 -0
  72. data/rbi/sentdm/models/call_recording.rbi +59 -0
  73. data/rbi/sentdm/models/call_recordings.rbi +39 -0
  74. data/rbi/sentdm/models/call_retrieve_params.rbi +46 -0
  75. data/rbi/sentdm/models/call_timeline_entry.rbi +40 -0
  76. data/rbi/sentdm/models/calls/api_response_of_list_of_call_participant.rbi +76 -0
  77. data/rbi/sentdm/models/calls/call_participant.rbi +92 -0
  78. data/rbi/sentdm/models/calls/call_participant_target.rbi +47 -0
  79. data/rbi/sentdm/models/calls/participant_add_params.rbi +98 -0
  80. data/rbi/sentdm/models/calls/participant_list_params.rbi +51 -0
  81. data/rbi/sentdm/models/calls/participant_remove_all_params.rbi +51 -0
  82. data/rbi/sentdm/models/calls/participant_remove_params.rbi +61 -0
  83. data/rbi/sentdm/models/calls/participant_update_params.rbi +94 -0
  84. data/rbi/sentdm/models/calls_list.rbi +47 -0
  85. data/rbi/sentdm/models/channels/api_response_of_list_of_voice_number.rbi +76 -0
  86. data/rbi/sentdm/models/channels/api_response_of_voice_callback_test.rbi +83 -0
  87. data/rbi/sentdm/models/channels/api_response_of_voice_number.rbi +81 -0
  88. data/rbi/sentdm/models/channels/api_response_of_voice_number_created.rbi +83 -0
  89. data/rbi/sentdm/models/channels/api_response_of_voice_secret.rbi +81 -0
  90. data/rbi/sentdm/models/channels/api_response_of_voice_token.rbi +81 -0
  91. data/rbi/sentdm/models/channels/voice_callback_test.rbi +126 -0
  92. data/rbi/sentdm/models/channels/voice_callback_test_error_info.rbi +65 -0
  93. data/rbi/sentdm/models/channels/voice_callback_test_request_info.rbi +66 -0
  94. data/rbi/sentdm/models/channels/voice_callback_test_response_info.rbi +48 -0
  95. data/rbi/sentdm/models/channels/voice_create_params.rbi +127 -0
  96. data/rbi/sentdm/models/channels/voice_create_token_params.rbi +104 -0
  97. data/rbi/sentdm/models/channels/voice_list_params.rbi +40 -0
  98. data/rbi/sentdm/models/channels/voice_number.rbi +105 -0
  99. data/rbi/sentdm/models/channels/voice_number_created.rbi +42 -0
  100. data/rbi/sentdm/models/channels/voice_retrieve_params.rbi +51 -0
  101. data/rbi/sentdm/models/channels/voice_rotate_secret_params.rbi +64 -0
  102. data/rbi/sentdm/models/channels/voice_secret.rbi +35 -0
  103. data/rbi/sentdm/models/channels/voice_test_params.rbi +61 -0
  104. data/rbi/sentdm/models/channels/voice_token.rbi +76 -0
  105. data/rbi/sentdm/models/channels/voice_update_params.rbi +158 -0
  106. data/rbi/sentdm/models/webhook_list_events_response.rbi +3 -269
  107. data/rbi/sentdm/models.rbi +36 -0
  108. data/rbi/sentdm/resources/calls/participants.rbi +199 -0
  109. data/rbi/sentdm/resources/calls.rbi +206 -0
  110. data/rbi/sentdm/resources/channels/voice.rbi +371 -0
  111. data/rbi/sentdm/resources/channels.rbi +42 -0
  112. data/sig/sentdm/client.rbs +4 -0
  113. data/sig/sentdm/internal/calls_page.rbs +41 -0
  114. data/sig/sentdm/models/api_response_of_call.rbs +39 -0
  115. data/sig/sentdm/models/api_response_of_call_recordings.rbs +39 -0
  116. data/sig/sentdm/models/api_response_of_calls_list.rbs +39 -0
  117. data/sig/sentdm/models/call.rbs +101 -0
  118. data/sig/sentdm/models/call_event.rbs +44 -0
  119. data/sig/sentdm/models/call_event_payload.rbs +68 -0
  120. data/sig/sentdm/models/call_hangup_params.rbs +38 -0
  121. data/sig/sentdm/models/call_list_params.rbs +67 -0
  122. data/sig/sentdm/models/call_list_recordings_params.rbs +30 -0
  123. data/sig/sentdm/models/call_party.rbs +17 -0
  124. data/sig/sentdm/models/call_record_params.rbs +54 -0
  125. data/sig/sentdm/models/call_recording.rbs +32 -0
  126. data/sig/sentdm/models/call_recordings.rbs +17 -0
  127. data/sig/sentdm/models/call_retrieve_params.rbs +30 -0
  128. data/sig/sentdm/models/call_timeline_entry.rbs +19 -0
  129. data/sig/sentdm/models/calls/api_response_of_list_of_call_participant.rbs +41 -0
  130. data/sig/sentdm/models/calls/call_participant.rbs +52 -0
  131. data/sig/sentdm/models/calls/call_participant_target.rbs +23 -0
  132. data/sig/sentdm/models/calls/participant_add_params.rbs +63 -0
  133. data/sig/sentdm/models/calls/participant_list_params.rbs +32 -0
  134. data/sig/sentdm/models/calls/participant_remove_all_params.rbs +34 -0
  135. data/sig/sentdm/models/calls/participant_remove_params.rbs +40 -0
  136. data/sig/sentdm/models/calls/participant_update_params.rbs +61 -0
  137. data/sig/sentdm/models/calls_list.rbs +26 -0
  138. data/sig/sentdm/models/channels/api_response_of_list_of_voice_number.rbs +41 -0
  139. data/sig/sentdm/models/channels/api_response_of_voice_callback_test.rbs +41 -0
  140. data/sig/sentdm/models/channels/api_response_of_voice_number.rbs +41 -0
  141. data/sig/sentdm/models/channels/api_response_of_voice_number_created.rbs +41 -0
  142. data/sig/sentdm/models/channels/api_response_of_voice_secret.rbs +41 -0
  143. data/sig/sentdm/models/channels/api_response_of_voice_token.rbs +41 -0
  144. data/sig/sentdm/models/channels/voice_callback_test.rbs +51 -0
  145. data/sig/sentdm/models/channels/voice_callback_test_error_info.rbs +28 -0
  146. data/sig/sentdm/models/channels/voice_callback_test_request_info.rbs +34 -0
  147. data/sig/sentdm/models/channels/voice_callback_test_response_info.rbs +20 -0
  148. data/sig/sentdm/models/channels/voice_create_params.rbs +64 -0
  149. data/sig/sentdm/models/channels/voice_create_token_params.rbs +61 -0
  150. data/sig/sentdm/models/channels/voice_list_params.rbs +27 -0
  151. data/sig/sentdm/models/channels/voice_number.rbs +57 -0
  152. data/sig/sentdm/models/channels/voice_number_created.rbs +17 -0
  153. data/sig/sentdm/models/channels/voice_retrieve_params.rbs +32 -0
  154. data/sig/sentdm/models/channels/voice_rotate_secret_params.rbs +40 -0
  155. data/sig/sentdm/models/channels/voice_secret.rbs +17 -0
  156. data/sig/sentdm/models/channels/voice_test_params.rbs +40 -0
  157. data/sig/sentdm/models/channels/voice_token.rbs +40 -0
  158. data/sig/sentdm/models/channels/voice_update_params.rbs +78 -0
  159. data/sig/sentdm/models/webhook_list_events_response.rbs +1 -107
  160. data/sig/sentdm/models.rbs +36 -0
  161. data/sig/sentdm/resources/calls/participants.rbs +50 -0
  162. data/sig/sentdm/resources/calls.rbs +50 -0
  163. data/sig/sentdm/resources/channels/voice.rbs +68 -0
  164. data/sig/sentdm/resources/channels.rbs +9 -0
  165. metadata +152 -2
@@ -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
@@ -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[
@@ -3,6 +3,12 @@
3
3
  module Sentdm
4
4
  APIMeta = Sentdm::Models::APIMeta
5
5
 
6
+ APIResponseOfCall = Sentdm::Models::APIResponseOfCall
7
+
8
+ APIResponseOfCallRecordings = Sentdm::Models::APIResponseOfCallRecordings
9
+
10
+ APIResponseOfCallsList = Sentdm::Models::APIResponseOfCallsList
11
+
6
12
  APIResponseOfContact = Sentdm::Models::APIResponseOfContact
7
13
 
8
14
  APIResponseOfContactMessageSummary =
@@ -31,10 +37,40 @@ module Sentdm
31
37
 
32
38
  BrandsBrandData = Sentdm::Models::BrandsBrandData
33
39
 
40
+ Call = Sentdm::Models::Call
41
+
42
+ CallEvent = Sentdm::Models::CallEvent
43
+
44
+ CallEventPayload = Sentdm::Models::CallEventPayload
45
+
46
+ CallHangupParams = Sentdm::Models::CallHangupParams
47
+
48
+ CallListParams = Sentdm::Models::CallListParams
49
+
50
+ CallListRecordingsParams = Sentdm::Models::CallListRecordingsParams
51
+
52
+ CallParty = Sentdm::Models::CallParty
53
+
54
+ CallRecording = Sentdm::Models::CallRecording
55
+
56
+ CallRecordings = Sentdm::Models::CallRecordings
57
+
58
+ CallRecordParams = Sentdm::Models::CallRecordParams
59
+
60
+ CallRetrieveParams = Sentdm::Models::CallRetrieveParams
61
+
62
+ Calls = Sentdm::Models::Calls
63
+
64
+ CallsList = Sentdm::Models::CallsList
65
+
66
+ CallTimelineEntry = Sentdm::Models::CallTimelineEntry
67
+
34
68
  ChannelEvent = Sentdm::Models::ChannelEvent
35
69
 
36
70
  ChannelEventPayload = Sentdm::Models::ChannelEventPayload
37
71
 
72
+ Channels = Sentdm::Models::Channels
73
+
38
74
  ContactCreateParams = Sentdm::Models::ContactCreateParams
39
75
 
40
76
  ContactDeleteParams = Sentdm::Models::ContactDeleteParams