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,74 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIResponseOfCall < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Sentdm::APIResponseOfCall, Sentdm::Internal::AnyHash)
9
+ end
10
+
11
+ # A call record
12
+ sig { returns(T.nilable(Sentdm::Call)) }
13
+ attr_reader :data
14
+
15
+ sig { params(data: T.nilable(Sentdm::Call::OrHash)).void }
16
+ attr_writer :data
17
+
18
+ # Error information
19
+ sig { returns(T.nilable(Sentdm::ErrorDetail)) }
20
+ attr_reader :error
21
+
22
+ sig { params(error: T.nilable(Sentdm::ErrorDetail::OrHash)).void }
23
+ attr_writer :error
24
+
25
+ # Request and response metadata
26
+ sig { returns(T.nilable(Sentdm::APIMeta)) }
27
+ attr_reader :meta
28
+
29
+ sig { params(meta: Sentdm::APIMeta::OrHash).void }
30
+ attr_writer :meta
31
+
32
+ # Indicates whether the request was successful
33
+ sig { returns(T.nilable(T::Boolean)) }
34
+ attr_reader :success
35
+
36
+ sig { params(success: T::Boolean).void }
37
+ attr_writer :success
38
+
39
+ # Standard API response envelope for all v3 endpoints
40
+ sig do
41
+ params(
42
+ data: T.nilable(Sentdm::Call::OrHash),
43
+ error: T.nilable(Sentdm::ErrorDetail::OrHash),
44
+ meta: Sentdm::APIMeta::OrHash,
45
+ success: T::Boolean
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # A call record
50
+ data: nil,
51
+ # Error information
52
+ error: nil,
53
+ # Request and response metadata
54
+ meta: nil,
55
+ # Indicates whether the request was successful
56
+ success: nil
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ data: T.nilable(Sentdm::Call),
64
+ error: T.nilable(Sentdm::ErrorDetail),
65
+ meta: Sentdm::APIMeta,
66
+ success: T::Boolean
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIResponseOfCallRecordings < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Sentdm::APIResponseOfCallRecordings, Sentdm::Internal::AnyHash)
9
+ end
10
+
11
+ # The recordings of a call, each as a short-lived download link
12
+ sig { returns(T.nilable(Sentdm::CallRecordings)) }
13
+ attr_reader :data
14
+
15
+ sig { params(data: T.nilable(Sentdm::CallRecordings::OrHash)).void }
16
+ attr_writer :data
17
+
18
+ # Error information
19
+ sig { returns(T.nilable(Sentdm::ErrorDetail)) }
20
+ attr_reader :error
21
+
22
+ sig { params(error: T.nilable(Sentdm::ErrorDetail::OrHash)).void }
23
+ attr_writer :error
24
+
25
+ # Request and response metadata
26
+ sig { returns(T.nilable(Sentdm::APIMeta)) }
27
+ attr_reader :meta
28
+
29
+ sig { params(meta: Sentdm::APIMeta::OrHash).void }
30
+ attr_writer :meta
31
+
32
+ # Indicates whether the request was successful
33
+ sig { returns(T.nilable(T::Boolean)) }
34
+ attr_reader :success
35
+
36
+ sig { params(success: T::Boolean).void }
37
+ attr_writer :success
38
+
39
+ # Standard API response envelope for all v3 endpoints
40
+ sig do
41
+ params(
42
+ data: T.nilable(Sentdm::CallRecordings::OrHash),
43
+ error: T.nilable(Sentdm::ErrorDetail::OrHash),
44
+ meta: Sentdm::APIMeta::OrHash,
45
+ success: T::Boolean
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # The recordings of a call, each as a short-lived download link
50
+ data: nil,
51
+ # Error information
52
+ error: nil,
53
+ # Request and response metadata
54
+ meta: nil,
55
+ # Indicates whether the request was successful
56
+ success: nil
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ data: T.nilable(Sentdm::CallRecordings),
64
+ error: T.nilable(Sentdm::ErrorDetail),
65
+ meta: Sentdm::APIMeta,
66
+ success: T::Boolean
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIResponseOfCallsList < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Sentdm::APIResponseOfCallsList, Sentdm::Internal::AnyHash)
9
+ end
10
+
11
+ # Paginated list of calls
12
+ sig { returns(T.nilable(Sentdm::CallsList)) }
13
+ attr_reader :data
14
+
15
+ sig { params(data: T.nilable(Sentdm::CallsList::OrHash)).void }
16
+ attr_writer :data
17
+
18
+ # Error information
19
+ sig { returns(T.nilable(Sentdm::ErrorDetail)) }
20
+ attr_reader :error
21
+
22
+ sig { params(error: T.nilable(Sentdm::ErrorDetail::OrHash)).void }
23
+ attr_writer :error
24
+
25
+ # Request and response metadata
26
+ sig { returns(T.nilable(Sentdm::APIMeta)) }
27
+ attr_reader :meta
28
+
29
+ sig { params(meta: Sentdm::APIMeta::OrHash).void }
30
+ attr_writer :meta
31
+
32
+ # Indicates whether the request was successful
33
+ sig { returns(T.nilable(T::Boolean)) }
34
+ attr_reader :success
35
+
36
+ sig { params(success: T::Boolean).void }
37
+ attr_writer :success
38
+
39
+ # Standard API response envelope for all v3 endpoints
40
+ sig do
41
+ params(
42
+ data: T.nilable(Sentdm::CallsList::OrHash),
43
+ error: T.nilable(Sentdm::ErrorDetail::OrHash),
44
+ meta: Sentdm::APIMeta::OrHash,
45
+ success: T::Boolean
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # Paginated list of calls
50
+ data: nil,
51
+ # Error information
52
+ error: nil,
53
+ # Request and response metadata
54
+ meta: nil,
55
+ # Indicates whether the request was successful
56
+ success: nil
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ data: T.nilable(Sentdm::CallsList),
64
+ error: T.nilable(Sentdm::ErrorDetail),
65
+ meta: Sentdm::APIMeta,
66
+ success: T::Boolean
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,177 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class Call < Sentdm::Internal::Type::BaseModel
6
+ OrHash = T.type_alias { T.any(Sentdm::Call, Sentdm::Internal::AnyHash) }
7
+
8
+ # The call id, the same one carried by the call.request question and every call
9
+ # webhook
10
+ sig { returns(T.nilable(String)) }
11
+ attr_reader :id
12
+
13
+ sig { params(id: String).void }
14
+ attr_writer :id
15
+
16
+ # When the call was answered (UTC). Null until then, and always null for a call
17
+ # between two of your app users
18
+ sig { returns(T.nilable(Time)) }
19
+ attr_accessor :answered_at
20
+
21
+ # outbound for a call placed from your app, inbound for a call to one of your
22
+ # numbers
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :direction
25
+
26
+ sig { params(direction: String).void }
27
+ attr_writer :direction
28
+
29
+ # Billable duration in seconds. Null while the call is live
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_accessor :duration_seconds
32
+
33
+ # When the call ended (UTC). Null while the call is live
34
+ sig { returns(T.nilable(Time)) }
35
+ attr_accessor :ended_at
36
+
37
+ # Why the call did not complete: callback_timeout, invalid_answer,
38
+ # insufficient_balance, destination_blocked, rejected or no_answer. Null while the
39
+ # call is live, when it completed, and when it failed without a recorded reason
40
+ sig { returns(T.nilable(String)) }
41
+ attr_accessor :failure_reason
42
+
43
+ # One end of a call
44
+ sig { returns(T.nilable(Sentdm::CallParty)) }
45
+ attr_reader :from
46
+
47
+ sig { params(from: Sentdm::CallParty::OrHash).void }
48
+ attr_writer :from
49
+
50
+ # Your number that owns the call, in E.164 format: the dialed number for an
51
+ # inbound call, the caller's bound number for a call placed from your app
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :number
54
+
55
+ sig { params(number: String).void }
56
+ attr_writer :number
57
+
58
+ # What the call cost. Null until it has been priced
59
+ sig { returns(T.nilable(Float)) }
60
+ attr_accessor :price
61
+
62
+ # True once a recording of the call is available
63
+ sig { returns(T.nilable(T::Boolean)) }
64
+ attr_reader :recording_available
65
+
66
+ sig { params(recording_available: T::Boolean).void }
67
+ attr_writer :recording_available
68
+
69
+ # When the call was placed (UTC)
70
+ sig { returns(T.nilable(Time)) }
71
+ attr_reader :started_at
72
+
73
+ sig { params(started_at: Time).void }
74
+ attr_writer :started_at
75
+
76
+ # initiated, ringing, answered, completed, failed, no_answer or rejected
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :status
79
+
80
+ sig { params(status: String).void }
81
+ attr_writer :status
82
+
83
+ # When the call entered each status, oldest first. Only returned when reading one
84
+ # call
85
+ sig { returns(T.nilable(T::Array[Sentdm::CallTimelineEntry])) }
86
+ attr_accessor :timeline
87
+
88
+ # One end of a call
89
+ sig { returns(T.nilable(Sentdm::CallParty)) }
90
+ attr_reader :to
91
+
92
+ sig { params(to: Sentdm::CallParty::OrHash).void }
93
+ attr_writer :to
94
+
95
+ # A call record
96
+ sig do
97
+ params(
98
+ id: String,
99
+ answered_at: T.nilable(Time),
100
+ direction: String,
101
+ duration_seconds: T.nilable(Integer),
102
+ ended_at: T.nilable(Time),
103
+ failure_reason: T.nilable(String),
104
+ from: Sentdm::CallParty::OrHash,
105
+ number: String,
106
+ price: T.nilable(Float),
107
+ recording_available: T::Boolean,
108
+ started_at: Time,
109
+ status: String,
110
+ timeline: T.nilable(T::Array[Sentdm::CallTimelineEntry::OrHash]),
111
+ to: Sentdm::CallParty::OrHash
112
+ ).returns(T.attached_class)
113
+ end
114
+ def self.new(
115
+ # The call id, the same one carried by the call.request question and every call
116
+ # webhook
117
+ id: nil,
118
+ # When the call was answered (UTC). Null until then, and always null for a call
119
+ # between two of your app users
120
+ answered_at: nil,
121
+ # outbound for a call placed from your app, inbound for a call to one of your
122
+ # numbers
123
+ direction: nil,
124
+ # Billable duration in seconds. Null while the call is live
125
+ duration_seconds: nil,
126
+ # When the call ended (UTC). Null while the call is live
127
+ ended_at: nil,
128
+ # Why the call did not complete: callback_timeout, invalid_answer,
129
+ # insufficient_balance, destination_blocked, rejected or no_answer. Null while the
130
+ # call is live, when it completed, and when it failed without a recorded reason
131
+ failure_reason: nil,
132
+ # One end of a call
133
+ from: nil,
134
+ # Your number that owns the call, in E.164 format: the dialed number for an
135
+ # inbound call, the caller's bound number for a call placed from your app
136
+ number: nil,
137
+ # What the call cost. Null until it has been priced
138
+ price: nil,
139
+ # True once a recording of the call is available
140
+ recording_available: nil,
141
+ # When the call was placed (UTC)
142
+ started_at: nil,
143
+ # initiated, ringing, answered, completed, failed, no_answer or rejected
144
+ status: nil,
145
+ # When the call entered each status, oldest first. Only returned when reading one
146
+ # call
147
+ timeline: nil,
148
+ # One end of a call
149
+ to: nil
150
+ )
151
+ end
152
+
153
+ sig do
154
+ override.returns(
155
+ {
156
+ id: String,
157
+ answered_at: T.nilable(Time),
158
+ direction: String,
159
+ duration_seconds: T.nilable(Integer),
160
+ ended_at: T.nilable(Time),
161
+ failure_reason: T.nilable(String),
162
+ from: Sentdm::CallParty,
163
+ number: String,
164
+ price: T.nilable(Float),
165
+ recording_available: T::Boolean,
166
+ started_at: Time,
167
+ status: String,
168
+ timeline: T.nilable(T::Array[Sentdm::CallTimelineEntry]),
169
+ to: Sentdm::CallParty
170
+ }
171
+ )
172
+ end
173
+ def to_hash
174
+ end
175
+ end
176
+ end
177
+ end
@@ -0,0 +1,114 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class CallEvent < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias { T.any(Sentdm::CallEvent, Sentdm::Internal::AnyHash) }
8
+
9
+ # The specific event within the family, for example message.delivered,
10
+ # message.received or contact.opt_out. Absent on events that have no subtype, so
11
+ # treat it as optional.
12
+ sig { returns(T.nilable(String)) }
13
+ attr_accessor :event
14
+
15
+ # The event family, for example message, templates or contact. Route on this
16
+ # first, then on event for the specific change.
17
+ sig { returns(T.nilable(String)) }
18
+ attr_reader :field
19
+
20
+ sig { params(field: String).void }
21
+ attr_writer :field
22
+
23
+ # Body of a call.initiated, call.answered, call.completed, call.failed or
24
+ # call.recording_ready event. Which of them occurred is the envelope's event.
25
+ #
26
+ # Shaped like the message, inbound, template and channel payloads: account_id
27
+ # names the account the event is about, channel names the channel, and updated_at
28
+ # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
29
+ # duration_seconds and price are added on call.completed, reason on call.failed
30
+ # and recording_id on call.recording_ready; each is omitted rather than sent as
31
+ # null when it does not apply.
32
+ #
33
+ # Casing is snake_case because these ride the same webhook stream customers
34
+ # already parse message_id from; the question/answer contract is a separate
35
+ # surface and stays camelCase. Nothing here is provider-shaped: no provider call
36
+ # id, no namespaced identity.
37
+ sig { returns(T.nilable(Sentdm::CallEventPayload)) }
38
+ attr_reader :payload
39
+
40
+ sig { params(payload: T.nilable(Sentdm::CallEventPayload::OrHash)).void }
41
+ attr_writer :payload
42
+
43
+ # The event-specific body.
44
+ sig { returns(T.nilable(String)) }
45
+ attr_accessor :request_id
46
+
47
+ # When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
48
+ # time, not the time the underlying change happened. Use the timestamp inside the
49
+ # payload for the latter.
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :timestamp
52
+
53
+ sig { params(timestamp: String).void }
54
+ attr_writer :timestamp
55
+
56
+ # The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
57
+ # this shape and varies only in Payload.
58
+ sig do
59
+ params(
60
+ event: T.nilable(String),
61
+ field: String,
62
+ payload: T.nilable(Sentdm::CallEventPayload::OrHash),
63
+ request_id: T.nilable(String),
64
+ timestamp: String
65
+ ).returns(T.attached_class)
66
+ end
67
+ def self.new(
68
+ # The specific event within the family, for example message.delivered,
69
+ # message.received or contact.opt_out. Absent on events that have no subtype, so
70
+ # treat it as optional.
71
+ event: nil,
72
+ # The event family, for example message, templates or contact. Route on this
73
+ # first, then on event for the specific change.
74
+ field: nil,
75
+ # Body of a call.initiated, call.answered, call.completed, call.failed or
76
+ # call.recording_ready event. Which of them occurred is the envelope's event.
77
+ #
78
+ # Shaped like the message, inbound, template and channel payloads: account_id
79
+ # names the account the event is about, channel names the channel, and updated_at
80
+ # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
81
+ # duration_seconds and price are added on call.completed, reason on call.failed
82
+ # and recording_id on call.recording_ready; each is omitted rather than sent as
83
+ # null when it does not apply.
84
+ #
85
+ # Casing is snake_case because these ride the same webhook stream customers
86
+ # already parse message_id from; the question/answer contract is a separate
87
+ # surface and stays camelCase. Nothing here is provider-shaped: no provider call
88
+ # id, no namespaced identity.
89
+ payload: nil,
90
+ # The event-specific body.
91
+ request_id: nil,
92
+ # When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
93
+ # time, not the time the underlying change happened. Use the timestamp inside the
94
+ # payload for the latter.
95
+ timestamp: nil
96
+ )
97
+ end
98
+
99
+ sig do
100
+ override.returns(
101
+ {
102
+ event: T.nilable(String),
103
+ field: String,
104
+ payload: T.nilable(Sentdm::CallEventPayload),
105
+ request_id: T.nilable(String),
106
+ timestamp: String
107
+ }
108
+ )
109
+ end
110
+ def to_hash
111
+ end
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,135 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class CallEventPayload < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Sentdm::CallEventPayload, Sentdm::Internal::AnyHash)
9
+ end
10
+
11
+ # Sent's call id, the same one the customer saw on the first question.
12
+ sig { returns(String) }
13
+ attr_accessor :call_id
14
+
15
+ # The account the call belongs to: the key's own customer, or the sender profile
16
+ # it acted as.
17
+ sig { returns(T.nilable(String)) }
18
+ attr_reader :account_id
19
+
20
+ sig { params(account_id: String).void }
21
+ attr_writer :account_id
22
+
23
+ # Always voice.
24
+ sig { returns(T.nilable(String)) }
25
+ attr_reader :channel
26
+
27
+ sig { params(channel: String).void }
28
+ attr_writer :channel
29
+
30
+ # How long the call lasted. Only on call.completed.
31
+ sig { returns(T.nilable(Integer)) }
32
+ attr_accessor :duration_seconds
33
+
34
+ # The customer number that owns the call, in E.164 format.
35
+ sig { returns(T.nilable(String)) }
36
+ attr_reader :number
37
+
38
+ sig { params(number: String).void }
39
+ attr_writer :number
40
+
41
+ # What the call was charged. Only on call.completed, and omitted there until
42
+ # billing has recorded the charge.
43
+ sig { returns(T.nilable(Float)) }
44
+ attr_accessor :price
45
+
46
+ # The machine-readable reason the call did not complete. Only on call.failed, and
47
+ # omitted when no reason was recorded.
48
+ sig { returns(T.nilable(String)) }
49
+ attr_accessor :reason
50
+
51
+ # The recording that became available, the same id GET /v3/calls/{id}/recordings
52
+ # lists it under. Only on call.recording_ready, which is sent once per recording.
53
+ sig { returns(T.nilable(String)) }
54
+ attr_accessor :recording_id
55
+
56
+ # When the change happened on the call, as opposed to when the event was emitted.
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :updated_at
59
+
60
+ sig { params(updated_at: String).void }
61
+ attr_writer :updated_at
62
+
63
+ # Body of a call.initiated, call.answered, call.completed, call.failed or
64
+ # call.recording_ready event. Which of them occurred is the envelope's event.
65
+ #
66
+ # Shaped like the message, inbound, template and channel payloads: account_id
67
+ # names the account the event is about, channel names the channel, and updated_at
68
+ # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
69
+ # duration_seconds and price are added on call.completed, reason on call.failed
70
+ # and recording_id on call.recording_ready; each is omitted rather than sent as
71
+ # null when it does not apply.
72
+ #
73
+ # Casing is snake_case because these ride the same webhook stream customers
74
+ # already parse message_id from; the question/answer contract is a separate
75
+ # surface and stays camelCase. Nothing here is provider-shaped: no provider call
76
+ # id, no namespaced identity.
77
+ sig do
78
+ params(
79
+ call_id: String,
80
+ account_id: String,
81
+ channel: String,
82
+ duration_seconds: T.nilable(Integer),
83
+ number: String,
84
+ price: T.nilable(Float),
85
+ reason: T.nilable(String),
86
+ recording_id: T.nilable(String),
87
+ updated_at: String
88
+ ).returns(T.attached_class)
89
+ end
90
+ def self.new(
91
+ # Sent's call id, the same one the customer saw on the first question.
92
+ call_id:,
93
+ # The account the call belongs to: the key's own customer, or the sender profile
94
+ # it acted as.
95
+ account_id: nil,
96
+ # Always voice.
97
+ channel: nil,
98
+ # How long the call lasted. Only on call.completed.
99
+ duration_seconds: nil,
100
+ # The customer number that owns the call, in E.164 format.
101
+ number: nil,
102
+ # What the call was charged. Only on call.completed, and omitted there until
103
+ # billing has recorded the charge.
104
+ price: nil,
105
+ # The machine-readable reason the call did not complete. Only on call.failed, and
106
+ # omitted when no reason was recorded.
107
+ reason: nil,
108
+ # The recording that became available, the same id GET /v3/calls/{id}/recordings
109
+ # lists it under. Only on call.recording_ready, which is sent once per recording.
110
+ recording_id: nil,
111
+ # When the change happened on the call, as opposed to when the event was emitted.
112
+ updated_at: nil
113
+ )
114
+ end
115
+
116
+ sig do
117
+ override.returns(
118
+ {
119
+ call_id: String,
120
+ account_id: String,
121
+ channel: String,
122
+ duration_seconds: T.nilable(Integer),
123
+ number: String,
124
+ price: T.nilable(Float),
125
+ reason: T.nilable(String),
126
+ recording_id: T.nilable(String),
127
+ updated_at: String
128
+ }
129
+ )
130
+ end
131
+ def to_hash
132
+ end
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,59 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class CallHangupParams < Sentdm::Models::MutationRequest
6
+ extend Sentdm::Internal::Type::RequestParameters::Converter
7
+ include Sentdm::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Sentdm::CallHangupParams, Sentdm::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :id
16
+
17
+ sig { returns(T.nilable(String)) }
18
+ attr_reader :idempotency_key
19
+
20
+ sig { params(idempotency_key: String).void }
21
+ attr_writer :idempotency_key
22
+
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :x_profile_id
25
+
26
+ sig { params(x_profile_id: String).void }
27
+ attr_writer :x_profile_id
28
+
29
+ sig do
30
+ params(
31
+ id: String,
32
+ idempotency_key: String,
33
+ x_profile_id: String,
34
+ request_options: Sentdm::RequestOptions::OrHash
35
+ ).returns(T.attached_class)
36
+ end
37
+ def self.new(
38
+ id:,
39
+ idempotency_key: nil,
40
+ x_profile_id: nil,
41
+ request_options: {}
42
+ )
43
+ end
44
+
45
+ sig do
46
+ override.returns(
47
+ {
48
+ id: String,
49
+ idempotency_key: String,
50
+ x_profile_id: String,
51
+ request_options: Sentdm::RequestOptions
52
+ }
53
+ )
54
+ end
55
+ def to_hash
56
+ end
57
+ end
58
+ end
59
+ end