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,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ # @see Sentdm::Resources::Channels::Voice#create_token
7
+ class VoiceCreateTokenParams < Sentdm::Internal::Type::BaseModel
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute identity
12
+ # Your identifier for the app user, such as an agent or account id. Letters,
13
+ # digits, hyphens and underscores only, up to 200 characters.
14
+ #
15
+ # @return [String, nil]
16
+ optional :identity, String
17
+
18
+ # @!attribute number
19
+ # One of your voice-enabled phone numbers in E.164 format. Calls placed by this
20
+ # identity are routed through that number. Omit to use your default app-call
21
+ # number.
22
+ #
23
+ # @return [String, nil]
24
+ optional :number, String, nil?: true
25
+
26
+ # @!attribute sandbox
27
+ # Sandbox flag - when true, the operation is simulated without side effects Useful
28
+ # for testing integrations without actual execution
29
+ #
30
+ # @return [Boolean, nil]
31
+ optional :sandbox, Sentdm::Internal::Type::Boolean
32
+
33
+ # @!attribute ttl
34
+ # Token lifetime in seconds. Defaults to 600 and cannot exceed 3600.
35
+ #
36
+ # @return [Integer, nil]
37
+ optional :ttl, Integer, nil?: true
38
+
39
+ # @!attribute idempotency_key
40
+ #
41
+ # @return [String, nil]
42
+ optional :idempotency_key, String
43
+
44
+ # @!attribute x_profile_id
45
+ #
46
+ # @return [String, nil]
47
+ optional :x_profile_id, String
48
+
49
+ # @!method initialize(identity: nil, number: nil, sandbox: nil, ttl: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
50
+ # Some parameter documentations has been truncated, see
51
+ # {Sentdm::Models::Channels::VoiceCreateTokenParams} for more details.
52
+ #
53
+ # @param identity [String] Your identifier for the app user, such as an agent or account id. Letters, digit
54
+ #
55
+ # @param number [String, nil] One of your voice-enabled phone numbers in E.164 format. Calls placed by this id
56
+ #
57
+ # @param sandbox [Boolean] Sandbox flag - when true, the operation is simulated without side effects
58
+ #
59
+ # @param ttl [Integer, nil] Token lifetime in seconds. Defaults to 600 and cannot exceed 3600.
60
+ #
61
+ # @param idempotency_key [String]
62
+ #
63
+ # @param x_profile_id [String]
64
+ #
65
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ # @see Sentdm::Resources::Channels::Voice#list
7
+ class VoiceListParams < Sentdm::Internal::Type::BaseModel
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute x_profile_id
12
+ #
13
+ # @return [String, nil]
14
+ optional :x_profile_id, String
15
+
16
+ # @!method initialize(x_profile_id: nil, request_options: {})
17
+ # @param x_profile_id [String]
18
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ class VoiceNumber < Sentdm::Internal::Type::BaseModel
7
+ # @!attribute callback_url
8
+ # Where Sent asks what to do with each call on this number: a signed question is
9
+ # POSTed here when a call arrives or a caller presses a key, and the answer
10
+ # decides the call. The signing secret is not on this read; it is shown when voice
11
+ # is turned on and by the rotate endpoint.
12
+ #
13
+ # @return [String, nil]
14
+ optional :callback_url, String, nil?: true
15
+
16
+ # @!attribute created_at
17
+ #
18
+ # @return [Time, nil]
19
+ optional :created_at, Time
20
+
21
+ # @!attribute default_for_app_calls
22
+ # Whether this is the line app-originated calls are placed from when a voice token
23
+ # names no number. Exactly one active voice number carries it while the profile
24
+ # has any.
25
+ #
26
+ # @return [Boolean, nil]
27
+ optional :default_for_app_calls, Sentdm::Internal::Type::Boolean
28
+
29
+ # @!attribute number
30
+ # The number, in E.164.
31
+ #
32
+ # @return [String, nil]
33
+ optional :number, String
34
+
35
+ # @!attribute status
36
+ # ACTIVE while the number carries calls, INACTIVE once it was turned off. Nothing
37
+ # provisions: a number the customer holds can carry calls the moment voice is
38
+ # turned on for it.
39
+ #
40
+ # @return [String, nil]
41
+ optional :status, String
42
+
43
+ # @!attribute updated_at
44
+ #
45
+ # @return [Time, nil]
46
+ optional :updated_at, Time
47
+
48
+ # @!method initialize(callback_url: nil, created_at: nil, default_for_app_calls: nil, number: nil, status: nil, updated_at: nil)
49
+ # Some parameter documentations has been truncated, see
50
+ # {Sentdm::Models::Channels::VoiceNumber} for more details.
51
+ #
52
+ # One number the profile carries phone calls on.
53
+ #
54
+ # @param callback_url [String, nil] Where Sent asks what to do with each call on this number: a signed question is P
55
+ #
56
+ # @param created_at [Time]
57
+ #
58
+ # @param default_for_app_calls [Boolean] Whether this is the line app-originated calls are placed from when a voice token
59
+ #
60
+ # @param number [String] The number, in E.164.
61
+ #
62
+ # @param status [String] ACTIVE while the number carries calls, INACTIVE once it was turned off. Nothing
63
+ #
64
+ # @param updated_at [Time]
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ class VoiceNumberCreated < Sentdm::Models::Channels::VoiceNumber
7
+ # @!attribute callback_secret
8
+ # The whsec\_ secret every question to callback_url is signed with. Shown here and
9
+ # by POST /v3/channels/voice/{number}/rotate-secret, nowhere else: store it now.
10
+ # Verify a question exactly as you verify a webhook, with X-Webhook-ID,
11
+ # X-Webhook-Timestamp and the body.
12
+ #
13
+ # @return [String, nil]
14
+ optional :callback_secret, String
15
+
16
+ # @!method initialize(callback_secret: nil)
17
+ # Some parameter documentations has been truncated, see
18
+ # {Sentdm::Models::Channels::VoiceNumberCreated} for more details.
19
+ #
20
+ # One number the profile carries phone calls on.
21
+ #
22
+ # @param callback_secret [String] The whsec\_ secret every question to callback_url is signed with. Shown here and
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ # @see Sentdm::Resources::Channels::Voice#retrieve
7
+ class VoiceRetrieveParams < Sentdm::Internal::Type::BaseModel
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute number
12
+ #
13
+ # @return [String]
14
+ required :number, String
15
+
16
+ # @!attribute x_profile_id
17
+ #
18
+ # @return [String, nil]
19
+ optional :x_profile_id, String
20
+
21
+ # @!method initialize(number:, x_profile_id: nil, request_options: {})
22
+ # @param number [String]
23
+ # @param x_profile_id [String]
24
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ # @see Sentdm::Resources::Channels::Voice#rotate_secret
7
+ class VoiceRotateSecretParams < Sentdm::Models::MutationRequest
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute number
12
+ #
13
+ # @return [String]
14
+ required :number, String
15
+
16
+ # @!attribute idempotency_key
17
+ #
18
+ # @return [String, nil]
19
+ optional :idempotency_key, String
20
+
21
+ # @!attribute x_profile_id
22
+ #
23
+ # @return [String, nil]
24
+ optional :x_profile_id, String
25
+
26
+ # @!method initialize(number:, idempotency_key: nil, x_profile_id: nil, request_options: {})
27
+ # @param number [String]
28
+ # @param idempotency_key [String]
29
+ # @param x_profile_id [String]
30
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ class VoiceSecret < Sentdm::Internal::Type::BaseModel
7
+ # @!attribute callback_secret
8
+ # The new whsec\_ secret. The previous one stopped signing the moment this was
9
+ # returned, so update your backend before the next call reaches it. Shown once.
10
+ #
11
+ # @return [String, nil]
12
+ optional :callback_secret, String
13
+
14
+ # @!method initialize(callback_secret: nil)
15
+ # Some parameter documentations has been truncated, see
16
+ # {Sentdm::Models::Channels::VoiceSecret} for more details.
17
+ #
18
+ # A freshly rotated callback signing secret
19
+ #
20
+ # @param callback_secret [String] The new whsec\_ secret. The previous one stopped signing the moment this was
21
+ # retu
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ # @see Sentdm::Resources::Channels::Voice#test_
7
+ class VoiceTestParams < Sentdm::Models::MutationRequest
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute number
12
+ #
13
+ # @return [String]
14
+ required :number, String
15
+
16
+ # @!attribute idempotency_key
17
+ #
18
+ # @return [String, nil]
19
+ optional :idempotency_key, String
20
+
21
+ # @!attribute x_profile_id
22
+ #
23
+ # @return [String, nil]
24
+ optional :x_profile_id, String
25
+
26
+ # @!method initialize(number:, idempotency_key: nil, x_profile_id: nil, request_options: {})
27
+ # @param number [String]
28
+ # @param idempotency_key [String]
29
+ # @param x_profile_id [String]
30
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ class VoiceToken < Sentdm::Internal::Type::BaseModel
7
+ # @!attribute token
8
+ # The signed token. Hand it to the client SDK unchanged.
9
+ #
10
+ # @return [String, nil]
11
+ optional :token, String
12
+
13
+ # @!attribute expires_at
14
+ # When the token expires (UTC)
15
+ #
16
+ # @return [Time, nil]
17
+ optional :expires_at, Time
18
+
19
+ # @!attribute identity
20
+ # The identity the token was minted for
21
+ #
22
+ # @return [String, nil]
23
+ optional :identity, String
24
+
25
+ # @!attribute number
26
+ # The phone number this identity is now bound to, in E.164 format
27
+ #
28
+ # @return [String, nil]
29
+ optional :number, String
30
+
31
+ # @!method initialize(token: nil, expires_at: nil, identity: nil, number: nil)
32
+ # A short-lived token your app passes to the voice client SDK to register
33
+ #
34
+ # @param token [String] The signed token. Hand it to the client SDK unchanged.
35
+ #
36
+ # @param expires_at [Time] When the token expires (UTC)
37
+ #
38
+ # @param identity [String] The identity the token was minted for
39
+ #
40
+ # @param number [String] The phone number this identity is now bound to, in E.164 format
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,95 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Channels
6
+ # @see Sentdm::Resources::Channels::Voice#update
7
+ class VoiceUpdateParams < Sentdm::Internal::Type::BaseModel
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute number
12
+ #
13
+ # @return [String]
14
+ required :number, String
15
+
16
+ # @!attribute callback_url
17
+ # A new callback URL for the number, active or not: an absolute HTTP or HTTPS URL
18
+ # on a public host, where Sent asks what to do with each call. The signing secret
19
+ # is kept.
20
+ #
21
+ # @return [String, nil]
22
+ optional :callback_url, String, nil?: true
23
+
24
+ # @!attribute default_for_app_calls
25
+ # true makes this the line app-originated calls are placed from when a voice token
26
+ # names no number. false is refused: an account with active voice numbers always
27
+ # has exactly one default, so the default moves by giving it to another number.
28
+ #
29
+ # @return [Boolean, nil]
30
+ optional :default_for_app_calls, Sentdm::Internal::Type::Boolean, nil?: true
31
+
32
+ # @!attribute sandbox
33
+ # Sandbox flag - when true, the operation is simulated without side effects Useful
34
+ # for testing integrations without actual execution
35
+ #
36
+ # @return [Boolean, nil]
37
+ optional :sandbox, Sentdm::Internal::Type::Boolean
38
+
39
+ # @!attribute status
40
+ # ACTIVE turns calls on for the number again, INACTIVE turns them off. Matched
41
+ # ignoring case. Turning the default line off is refused while other active voice
42
+ # numbers remain.
43
+ #
44
+ # @return [Symbol, Sentdm::Models::Channels::VoiceUpdateParams::Status, nil]
45
+ optional :status, enum: -> { Sentdm::Channels::VoiceUpdateParams::Status }, nil?: true
46
+
47
+ # @!attribute idempotency_key
48
+ #
49
+ # @return [String, nil]
50
+ optional :idempotency_key, String
51
+
52
+ # @!attribute x_profile_id
53
+ #
54
+ # @return [String, nil]
55
+ optional :x_profile_id, String
56
+
57
+ # @!method initialize(number:, callback_url: nil, default_for_app_calls: nil, sandbox: nil, status: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
58
+ # Some parameter documentations has been truncated, see
59
+ # {Sentdm::Models::Channels::VoiceUpdateParams} for more details.
60
+ #
61
+ # @param number [String]
62
+ #
63
+ # @param callback_url [String, nil] A new callback URL for the number, active or not: an absolute HTTP or HTTPS URL
64
+ #
65
+ # @param default_for_app_calls [Boolean, nil] true makes this the line app-originated calls are placed from when a voice token
66
+ #
67
+ # @param sandbox [Boolean] Sandbox flag - when true, the operation is simulated without side effects
68
+ #
69
+ # @param status [Symbol, Sentdm::Models::Channels::VoiceUpdateParams::Status, nil] ACTIVE turns calls on for the number again, INACTIVE turns them off. Matched
70
+ #
71
+ # @param idempotency_key [String]
72
+ #
73
+ # @param x_profile_id [String]
74
+ #
75
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
76
+
77
+ # ACTIVE turns calls on for the number again, INACTIVE turns them off. Matched
78
+ # ignoring case. Turning the default line off is refused while other active voice
79
+ # numbers remain.
80
+ module Status
81
+ extend Sentdm::Internal::Type::Enum
82
+
83
+ # 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.
84
+ ACTIVE = :ACTIVE
85
+
86
+ # 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.
87
+ INACTIVE = :INACTIVE
88
+
89
+ # @!method self.values
90
+ # @return [Array<Symbol>]
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -72,14 +72,19 @@ module Sentdm
72
72
  # @!attribute schedule_reason
73
73
  # message.scheduled only: why the message is held, either because you scheduled it
74
74
  # or because the recipient is inside a protected quiet-hours window. Omitted on
75
- # every other event.
75
+ # every other event, including message.cancelled — that is a property of the hold,
76
+ # not of the cancellation, and repeating it there would read as "why was this
77
+ # cancelled", which it does not answer.
76
78
  #
77
79
  # @return [String, nil]
78
80
  optional :schedule_reason, String, nil?: true
79
81
 
80
82
  # @!attribute scheduled_at
81
- # message.scheduled only: when the held message will be released for delivery, in
82
- # UTC (yyyy-MM-ddTHH:mm:ssZ). Omitted on every other event.
83
+ # message.scheduled and message.cancelled only, in UTC (yyyy-MM-ddTHH:mm:ssZ): on
84
+ # message.scheduled it is when the held message will be released for delivery, on
85
+ # message.cancelled the release instant that was called off — the same instant,
86
+ # before and after. A consumer that recorded a future send from the first event
87
+ # has what it needs to un-record it from the second. Omitted on every other event.
83
88
  #
84
89
  # @return [String, nil]
85
90
  optional :scheduled_at, String, nil?: true
@@ -131,7 +136,7 @@ module Sentdm
131
136
  #
132
137
  # @param schedule_reason [String, nil] message.scheduled only: why the message is held, either because you scheduled it
133
138
  #
134
- # @param scheduled_at [String, nil] message.scheduled only: when the held message will be released for delivery, in
139
+ # @param scheduled_at [String, nil] message.scheduled and message.cancelled only, in UTC (yyyy-MM-ddTHH:mm:ssZ): on
135
140
  #
136
141
  # @param template_id [String, nil] The template the message was sent from, when it was sent from one.
137
142
  #
@@ -116,10 +116,12 @@ module Sentdm
116
116
  optional :reason_code, String, nil?: true
117
117
 
118
118
  # @!attribute scheduled_at
119
- # SCHEDULED activities only: when the held message will be released for delivery,
120
- # in UTC. Same wire name as on the send response, the message and the webhook.
121
- # Omitted on every other activity. A message that quiet hours moved at release has
122
- # two SCHEDULED entries, each carrying the instant as it stood at that moment.
119
+ # SCHEDULED and CANCELLED activities only, in UTC: on a SCHEDULED entry, when the
120
+ # held message will be released for delivery; on a CANCELLED entry, the instant
121
+ # that was called off. Same wire name as on the send response, the message and the
122
+ # webhook. Omitted on every other activity. A message that quiet hours moved at
123
+ # release has two SCHEDULED entries, each carrying the instant as it stood at that
124
+ # moment.
123
125
  #
124
126
  # @return [Time, nil]
125
127
  optional :scheduled_at, Time, nil?: true
@@ -161,7 +163,7 @@ module Sentdm
161
163
  # @param reason_code [String, nil] Why the message reached this status, as a stable platform code such as
162
164
  # DELIVERY\_
163
165
  #
164
- # @param scheduled_at [Time, nil] SCHEDULED activities only: when the held message will be released for delivery,
166
+ # @param scheduled_at [Time, nil] SCHEDULED and CANCELLED activities only, in UTC: on a SCHEDULED entry, when the
165
167
  #
166
168
  # @param status [String] Activity status. Outbound: QUEUED, PROCESSED, ROUTED, SCHEDULED, SENT, DELIVERED
167
169
  #