sentdm 0.39.0 → 0.40.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 (140) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +1 -1
  4. data/lib/sentdm/internal/voice_agents_page.rb +115 -0
  5. data/lib/sentdm/models/call_event.rb +8 -6
  6. data/lib/sentdm/models/call_event_payload.rb +25 -6
  7. data/lib/sentdm/models/channels/voice_create_params.rb +23 -11
  8. data/lib/sentdm/models/channels/voice_number.rb +23 -1
  9. data/lib/sentdm/models/channels/voice_update_params.rb +12 -1
  10. data/lib/sentdm/models/voice/agent_create_params.rb +142 -0
  11. data/lib/sentdm/models/voice/agent_delete_params.rb +28 -0
  12. data/lib/sentdm/models/voice/agent_list_params.rb +38 -0
  13. data/lib/sentdm/models/voice/agent_retrieve_params.rb +28 -0
  14. data/lib/sentdm/models/voice/agent_rotate_secret_params.rb +34 -0
  15. data/lib/sentdm/models/voice/agent_update_params.rb +141 -0
  16. data/lib/sentdm/models/voice/api_response_of_voice_agent.rb +51 -0
  17. data/lib/sentdm/models/voice/api_response_of_voice_agent_secret.rb +45 -0
  18. data/lib/sentdm/models/voice/api_response_of_voice_agents_list.rb +48 -0
  19. data/lib/sentdm/models/voice/api_response_of_voice_catalogue.rb +49 -0
  20. data/lib/sentdm/models/voice/call.rb +97 -5
  21. data/lib/sentdm/models/voice/call_list_params.rb +19 -1
  22. data/lib/sentdm/models/voice/catalogue_list_params.rb +22 -0
  23. data/lib/sentdm/models/voice/voice_agent.rb +138 -0
  24. data/lib/sentdm/models/voice/voice_agent_audio.rb +19 -0
  25. data/lib/sentdm/models/voice/voice_agent_audio_spec.rb +20 -0
  26. data/lib/sentdm/models/voice/voice_agent_limits.rb +31 -0
  27. data/lib/sentdm/models/voice/voice_agent_limits_spec.rb +40 -0
  28. data/lib/sentdm/models/voice/voice_agent_party.rb +25 -0
  29. data/lib/sentdm/models/voice/voice_agent_party_spec.rb +28 -0
  30. data/lib/sentdm/models/voice/voice_agent_secret.rb +27 -0
  31. data/lib/sentdm/models/voice/voice_agent_speech.rb +31 -0
  32. data/lib/sentdm/models/voice/voice_agent_speech_spec.rb +40 -0
  33. data/lib/sentdm/models/voice/voice_agent_transcripts.rb +25 -0
  34. data/lib/sentdm/models/voice/voice_agent_transcripts_spec.rb +32 -0
  35. data/lib/sentdm/models/voice/voice_agents_list.rb +30 -0
  36. data/lib/sentdm/models/voice/voice_catalogue.rb +30 -0
  37. data/lib/sentdm/models/voice/voice_catalogue_voice.rb +43 -0
  38. data/lib/sentdm/models/webhook_create_params.rb +31 -5
  39. data/lib/sentdm/models/webhook_response.rb +66 -4
  40. data/lib/sentdm/models/webhook_update_params.rb +15 -3
  41. data/lib/sentdm/resources/channels/voice.rb +38 -15
  42. data/lib/sentdm/resources/profiles/campaigns.rb +3 -2
  43. data/lib/sentdm/resources/voice/agents.rb +319 -0
  44. data/lib/sentdm/resources/voice/calls/participants.rb +11 -0
  45. data/lib/sentdm/resources/voice/calls.rb +44 -13
  46. data/lib/sentdm/resources/voice/catalogue.rb +71 -0
  47. data/lib/sentdm/resources/voice/tokens.rb +11 -0
  48. data/lib/sentdm/resources/voice.rb +86 -0
  49. data/lib/sentdm/resources/webhooks.rb +43 -15
  50. data/lib/sentdm/version.rb +1 -1
  51. data/lib/sentdm.rb +29 -0
  52. data/rbi/sentdm/internal/voice_agents_page.rbi +71 -0
  53. data/rbi/sentdm/models/call_event.rbi +14 -10
  54. data/rbi/sentdm/models/call_event_payload.rbi +28 -5
  55. data/rbi/sentdm/models/channels/voice_create_params.rbi +33 -17
  56. data/rbi/sentdm/models/channels/voice_number.rbi +31 -0
  57. data/rbi/sentdm/models/channels/voice_update_params.rbi +14 -0
  58. data/rbi/sentdm/models/voice/agent_create_params.rbi +215 -0
  59. data/rbi/sentdm/models/voice/agent_delete_params.rbi +48 -0
  60. data/rbi/sentdm/models/voice/agent_list_params.rbi +66 -0
  61. data/rbi/sentdm/models/voice/agent_retrieve_params.rbi +48 -0
  62. data/rbi/sentdm/models/voice/agent_rotate_secret_params.rbi +64 -0
  63. data/rbi/sentdm/models/voice/agent_update_params.rbi +211 -0
  64. data/rbi/sentdm/models/voice/api_response_of_voice_agent.rbi +85 -0
  65. data/rbi/sentdm/models/voice/api_response_of_voice_agent_secret.rbi +81 -0
  66. data/rbi/sentdm/models/voice/api_response_of_voice_agents_list.rbi +83 -0
  67. data/rbi/sentdm/models/voice/api_response_of_voice_catalogue.rbi +83 -0
  68. data/rbi/sentdm/models/voice/call.rbi +141 -8
  69. data/rbi/sentdm/models/voice/call_list_params.rbi +20 -0
  70. data/rbi/sentdm/models/voice/catalogue_list_params.rbi +40 -0
  71. data/rbi/sentdm/models/voice/voice_agent.rbi +196 -0
  72. data/rbi/sentdm/models/voice/voice_agent_audio.rbi +30 -0
  73. data/rbi/sentdm/models/voice/voice_agent_audio_spec.rbi +33 -0
  74. data/rbi/sentdm/models/voice/voice_agent_limits.rbi +57 -0
  75. data/rbi/sentdm/models/voice/voice_agent_limits_spec.rbi +62 -0
  76. data/rbi/sentdm/models/voice/voice_agent_party.rbi +36 -0
  77. data/rbi/sentdm/models/voice/voice_agent_party_spec.rbi +45 -0
  78. data/rbi/sentdm/models/voice/voice_agent_secret.rbi +37 -0
  79. data/rbi/sentdm/models/voice/voice_agent_speech.rbi +48 -0
  80. data/rbi/sentdm/models/voice/voice_agent_speech_spec.rbi +62 -0
  81. data/rbi/sentdm/models/voice/voice_agent_transcripts.rbi +43 -0
  82. data/rbi/sentdm/models/voice/voice_agent_transcripts_spec.rbi +51 -0
  83. data/rbi/sentdm/models/voice/voice_agents_list.rbi +55 -0
  84. data/rbi/sentdm/models/voice/voice_catalogue.rbi +59 -0
  85. data/rbi/sentdm/models/voice/voice_catalogue_voice.rbi +75 -0
  86. data/rbi/sentdm/models/webhook_create_params.rbi +41 -3
  87. data/rbi/sentdm/models/webhook_response.rbi +112 -3
  88. data/rbi/sentdm/models/webhook_update_params.rbi +18 -3
  89. data/rbi/sentdm/resources/channels/voice.rbi +52 -19
  90. data/rbi/sentdm/resources/profiles/campaigns.rbi +3 -2
  91. data/rbi/sentdm/resources/voice/agents.rbi +316 -0
  92. data/rbi/sentdm/resources/voice/calls/participants.rbi +11 -0
  93. data/rbi/sentdm/resources/voice/calls.rbi +46 -11
  94. data/rbi/sentdm/resources/voice/catalogue.rbi +59 -0
  95. data/rbi/sentdm/resources/voice/tokens.rbi +11 -0
  96. data/rbi/sentdm/resources/voice.rbi +84 -0
  97. data/rbi/sentdm/resources/webhooks.rbi +56 -16
  98. data/sig/sentdm/internal/voice_agents_page.rbs +41 -0
  99. data/sig/sentdm/models/call_event_payload.rbs +12 -0
  100. data/sig/sentdm/models/channels/voice_create_params.rbs +9 -4
  101. data/sig/sentdm/models/channels/voice_number.rbs +12 -0
  102. data/sig/sentdm/models/channels/voice_update_params.rbs +5 -0
  103. data/sig/sentdm/models/voice/agent_create_params.rbs +99 -0
  104. data/sig/sentdm/models/voice/agent_delete_params.rbs +34 -0
  105. data/sig/sentdm/models/voice/agent_list_params.rbs +40 -0
  106. data/sig/sentdm/models/voice/agent_retrieve_params.rbs +32 -0
  107. data/sig/sentdm/models/voice/agent_rotate_secret_params.rbs +40 -0
  108. data/sig/sentdm/models/voice/agent_update_params.rbs +108 -0
  109. data/sig/sentdm/models/voice/api_response_of_voice_agent.rbs +41 -0
  110. data/sig/sentdm/models/voice/api_response_of_voice_agent_secret.rbs +41 -0
  111. data/sig/sentdm/models/voice/api_response_of_voice_agents_list.rbs +41 -0
  112. data/sig/sentdm/models/voice/api_response_of_voice_catalogue.rbs +41 -0
  113. data/sig/sentdm/models/voice/call.rbs +65 -0
  114. data/sig/sentdm/models/voice/call_list_params.rbs +10 -0
  115. data/sig/sentdm/models/voice/catalogue_list_params.rbs +27 -0
  116. data/sig/sentdm/models/voice/voice_agent.rbs +116 -0
  117. data/sig/sentdm/models/voice/voice_agent_audio.rbs +19 -0
  118. data/sig/sentdm/models/voice/voice_agent_audio_spec.rbs +17 -0
  119. data/sig/sentdm/models/voice/voice_agent_limits.rbs +38 -0
  120. data/sig/sentdm/models/voice/voice_agent_limits_spec.rbs +34 -0
  121. data/sig/sentdm/models/voice/voice_agent_party.rbs +23 -0
  122. data/sig/sentdm/models/voice/voice_agent_party_spec.rbs +19 -0
  123. data/sig/sentdm/models/voice/voice_agent_secret.rbs +19 -0
  124. data/sig/sentdm/models/voice/voice_agent_speech.rbs +32 -0
  125. data/sig/sentdm/models/voice/voice_agent_speech_spec.rbs +26 -0
  126. data/sig/sentdm/models/voice/voice_agent_transcripts.rbs +23 -0
  127. data/sig/sentdm/models/voice/voice_agent_transcripts_spec.rbs +20 -0
  128. data/sig/sentdm/models/voice/voice_agents_list.rbs +35 -0
  129. data/sig/sentdm/models/voice/voice_catalogue.rbs +35 -0
  130. data/sig/sentdm/models/voice/voice_catalogue_voice.rbs +42 -0
  131. data/sig/sentdm/models/webhook_create_params.rbs +12 -0
  132. data/sig/sentdm/models/webhook_response.rbs +46 -3
  133. data/sig/sentdm/models/webhook_update_params.rbs +5 -0
  134. data/sig/sentdm/resources/channels/voice.rbs +3 -1
  135. data/sig/sentdm/resources/voice/agents.rbs +74 -0
  136. data/sig/sentdm/resources/voice/calls.rbs +2 -0
  137. data/sig/sentdm/resources/voice/catalogue.rbs +14 -0
  138. data/sig/sentdm/resources/voice.rbs +4 -0
  139. data/sig/sentdm/resources/webhooks.rbs +3 -0
  140. metadata +89 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e41c64a8341791db8801e49a4450c5631344d953d37ea8de82e1f734f7cfd06
4
- data.tar.gz: c71e0a7f614f260ac4f68e410a49049f0a3315bc2823e32af7413b6d5d484e1c
3
+ metadata.gz: b0fe2b102d0383035abaeca878cfc21c6ca248654c43cd778b525ebc7c3f2ad5
4
+ data.tar.gz: f581f11fa8a55d391fcc1ee01958b359fec4562bc58702060db9c598d4d6f1a4
5
5
  SHA512:
6
- metadata.gz: '0783884c3912784e4b10961fbaf990d3908c1a95949a76b4cdd559c9e08d1d35cc5d4e614249de86f9906cd9954d5bc0e611273fd4a44cd272ba7a22b8b9f329'
7
- data.tar.gz: f229587522eb6b177f69ba05866180ab32183d968b52995e51d39e97f77437a457608b720b7e09fbe163d411fac7754c1c40335274e97b6f3c66df98fc0cd9f8
6
+ metadata.gz: f337dcafa200de5fb45bc924339b2a0b07179a2bf531fee5535ac38ffcea924e35612892a4a9a9c96fc31ebbd2e398a630aa7ef41c67d67179b83c58fa456fc3
7
+ data.tar.gz: '0878a20b5965654dfcd33ef5a39d34e1631d9d7591b073bf2c75a3ac0a69c49f4868eb169f8fe5d75bce928111c9a0ee4af1f3e14fd2ec0dcc2d6bd7c728c4d5'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.40.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.39.0...v0.40.0) (2026-10-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add voice agents, the voice catalogue and agent_id ([abd31b9](https://github.com/sentdm/sent-dm-ruby/commit/abd31b96b520c10bd3ac67bb1c2b243c3a75b5fd))
9
+ * **api:** sync generated SDKs from the committed spec ([30477ca](https://github.com/sentdm/sent-dm-ruby/commit/30477cacd760dccdf6ce8c5112267d75197746a6))
10
+ * **api:** sync OpenAPI spec from production ([fa5b9f1](https://github.com/sentdm/sent-dm-ruby/commit/fa5b9f12f44e770a7aa6f2382585755fd9935acf))
11
+
3
12
  ## [0.39.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.38.1...v0.39.0) (2026-10-23)
4
13
 
5
14
 
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "sentdm", "~> 0.39.0"
20
+ gem "sentdm", "~> 0.40.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -0,0 +1,115 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Internal
5
+ # @generic Elem
6
+ #
7
+ # @example
8
+ # if voice_agents_page.has_next?
9
+ # voice_agents_page = voice_agents_page.next_page
10
+ # end
11
+ #
12
+ # @example
13
+ # voice_agents_page.auto_paging_each do |agent|
14
+ # puts(agent)
15
+ # end
16
+ class VoiceAgentsPage
17
+ include Sentdm::Internal::Type::BasePage
18
+
19
+ # @return [Data]
20
+ attr_accessor :data
21
+
22
+ # @return [Boolean]
23
+ def next_page?
24
+ data&.pagination&.has_more
25
+ end
26
+
27
+ # @raise [Sentdm::HTTP::Error]
28
+ # @return [self]
29
+ def next_page
30
+ unless next_page?
31
+ message = "No more pages available. Please check #next_page? before calling ##{__method__}"
32
+ raise RuntimeError.new(message)
33
+ end
34
+
35
+ req = Sentdm::Internal::Util.deep_merge(
36
+ @req,
37
+ {query: {page: @req.fetch(:query).fetch(:page, 1).to_i.succ}}
38
+ )
39
+ @client.request(req)
40
+ end
41
+
42
+ # @param blk [Proc]
43
+ #
44
+ # @yieldparam [generic<Elem>]
45
+ def auto_paging_each(&blk)
46
+ unless block_given?
47
+ raise ArgumentError.new("A block must be given to ##{__method__}")
48
+ end
49
+
50
+ page = self
51
+ loop do
52
+ page.data&.agents&.each(&blk)
53
+
54
+ break unless page.next_page?
55
+ page = page.next_page
56
+ end
57
+ end
58
+
59
+ # @api private
60
+ #
61
+ # @param client [Sentdm::Internal::Transport::BaseClient]
62
+ # @param req [Hash{Symbol=>Object}]
63
+ # @param headers [Hash{String=>String}]
64
+ # @param page_data [Hash{Symbol=>Object}]
65
+ def initialize(client:, req:, headers:, page_data:)
66
+ super
67
+
68
+ case page_data
69
+ in {data: Hash | nil => data}
70
+ if (agents = data[:agents]).is_a?(Array)
71
+ data = {**data, agents: agents.map { Sentdm::Internal::Type::Converter.coerce(@model, _1) }}
72
+ end
73
+ @data = Sentdm::Internal::Type::Converter.coerce(Sentdm::Internal::VoiceAgentsPage::Data, data)
74
+ else
75
+ end
76
+ end
77
+
78
+ # @api private
79
+ #
80
+ # @return [String]
81
+ def inspect
82
+ model = Sentdm::Internal::Type::Converter.inspect(@model, depth: 1)
83
+
84
+ "#<#{self.class}[#{model}]:0x#{object_id.to_s(16)}>"
85
+ end
86
+
87
+ class Data < Sentdm::Internal::Type::BaseModel
88
+ # @!attribute agents
89
+ #
90
+ # @return [Array<Object>, nil]
91
+ optional :agents, Sentdm::Internal::Type::ArrayOf[Sentdm::Internal::Type::Unknown]
92
+
93
+ # @!attribute pagination
94
+ #
95
+ # @return [Data::Pagination, nil]
96
+ optional :pagination, -> { Data::Pagination }
97
+
98
+ # @!method initialize(agents: nil, pagination: nil)
99
+ # @param agents [Array<Object>]
100
+ # @param pagination [Data::Pagination]
101
+
102
+ # @see Data#pagination
103
+ class Pagination < Sentdm::Internal::Type::BaseModel
104
+ # @!attribute has_more
105
+ #
106
+ # @return [Boolean, nil]
107
+ optional :has_more, Sentdm::Internal::Type::Boolean
108
+
109
+ # @!method initialize(has_more: nil)
110
+ # @param has_more [Boolean]
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
@@ -19,15 +19,17 @@ module Sentdm
19
19
  optional :field, String
20
20
 
21
21
  # @!attribute payload
22
- # Body of a call.initiated, call.answered, call.completed, call.failed or
23
- # call.recording_ready event. Which of them occurred is the envelope's event.
22
+ # Body of a call.initiated, call.answered, call.agent_connected, call.completed,
23
+ # call.failed or call.recording_ready event. Which of them occurred is the
24
+ # envelope's event.
24
25
  #
25
26
  # Shaped like the message, inbound, template and channel payloads: account_id
26
27
  # names the account the event is about, channel names the channel, and updated_at
27
28
  # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
28
- # duration_seconds and price are added on call.completed, reason on call.failed
29
- # and recording_id on call.recording_ready; each is omitted rather than sent as
30
- # null when it does not apply.
29
+ # Every event says how the call is handled in mode, and an agent call names its
30
+ # agent in agent_id. duration_seconds and price are added on call.completed,
31
+ # reason on call.failed and recording_id on call.recording_ready; each is omitted
32
+ # rather than sent as null when it does not apply.
31
33
  #
32
34
  # Casing is snake_case because these ride the same webhook stream customers
33
35
  # already parse message_id from; the question/answer contract is a separate
@@ -62,7 +64,7 @@ module Sentdm
62
64
  #
63
65
  # @param field [String] The event family, for example message, templates or contact. Route on
64
66
  #
65
- # @param payload [Sentdm::Models::CallEventPayload, nil] Body of a call.initiated, call.answered, call.completed, call.failed
67
+ # @param payload [Sentdm::Models::CallEventPayload, nil] Body of a call.initiated, call.answered, call.agent_connected, call.completed,
66
68
  #
67
69
  # @param request_id [String, nil] The event-specific body.
68
70
  #
@@ -16,6 +16,12 @@ module Sentdm
16
16
  # @return [String, nil]
17
17
  optional :account_id, String
18
18
 
19
+ # @!attribute agent_id
20
+ # The voice agent that answers the call, agent\_…. Only on an agent call.
21
+ #
22
+ # @return [String, nil]
23
+ optional :agent_id, String, nil?: true
24
+
19
25
  # @!attribute channel
20
26
  # Always voice.
21
27
  #
@@ -28,6 +34,13 @@ module Sentdm
28
34
  # @return [Integer, nil]
29
35
  optional :duration_seconds, Integer, nil?: true
30
36
 
37
+ # @!attribute mode
38
+ # inapp, a call routed by the number's callback URL, or agent, a call one of the
39
+ # account's voice agents answers. The same value GET /v3/voice/calls returns.
40
+ #
41
+ # @return [String, nil]
42
+ optional :mode, String
43
+
31
44
  # @!attribute number
32
45
  # The customer number that owns the call, in E.164 format.
33
46
  #
@@ -62,19 +75,21 @@ module Sentdm
62
75
  # @return [String, nil]
63
76
  optional :updated_at, String
64
77
 
65
- # @!method initialize(call_id:, account_id: nil, channel: nil, duration_seconds: nil, number: nil, price: nil, reason: nil, recording_id: nil, updated_at: nil)
78
+ # @!method initialize(call_id:, account_id: nil, agent_id: nil, channel: nil, duration_seconds: nil, mode: nil, number: nil, price: nil, reason: nil, recording_id: nil, updated_at: nil)
66
79
  # Some parameter documentations has been truncated, see
67
80
  # {Sentdm::Models::CallEventPayload} for more details.
68
81
  #
69
- # Body of a call.initiated, call.answered, call.completed, call.failed or
70
- # call.recording_ready event. Which of them occurred is the envelope's event.
82
+ # Body of a call.initiated, call.answered, call.agent_connected, call.completed,
83
+ # call.failed or call.recording_ready event. Which of them occurred is the
84
+ # envelope's event.
71
85
  #
72
86
  # Shaped like the message, inbound, template and channel payloads: account_id
73
87
  # names the account the event is about, channel names the channel, and updated_at
74
88
  # is when the change happened on the call, in the same yyyy-MM-ddTHH:mm:ssZ form.
75
- # duration_seconds and price are added on call.completed, reason on call.failed
76
- # and recording_id on call.recording_ready; each is omitted rather than sent as
77
- # null when it does not apply.
89
+ # Every event says how the call is handled in mode, and an agent call names its
90
+ # agent in agent_id. duration_seconds and price are added on call.completed,
91
+ # reason on call.failed and recording_id on call.recording_ready; each is omitted
92
+ # rather than sent as null when it does not apply.
78
93
  #
79
94
  # Casing is snake_case because these ride the same webhook stream customers
80
95
  # already parse message_id from; the question/answer contract is a separate
@@ -85,10 +100,14 @@ module Sentdm
85
100
  #
86
101
  # @param account_id [String] The account the call belongs to: the key's own customer, or the sender profile i
87
102
  #
103
+ # @param agent_id [String, nil] The voice agent that answers the call, agent\_…. Only on an agent call.
104
+ #
88
105
  # @param channel [String] Always voice.
89
106
  #
90
107
  # @param duration_seconds [Integer, nil] How long the call lasted. Only on call.completed.
91
108
  #
109
+ # @param mode [String] inapp, a call routed by the number's callback URL, or agent, a call one of the a
110
+ #
92
111
  # @param number [String] The customer number that owns the call, in E.164 format.
93
112
  #
94
113
  # @param price [Float, nil] What the call was charged. Only on call.completed, and omitted there until billi
@@ -8,16 +8,15 @@ module Sentdm
8
8
  extend Sentdm::Internal::Type::RequestParameters::Converter
9
9
  include Sentdm::Internal::Type::RequestParameters
10
10
 
11
- # @!attribute callback_url
12
- # Where Sent asks what to do with each call on this number: an absolute HTTP or
13
- # HTTPS URL on a public host. A signed question is POSTed here when a call arrives
14
- # or a caller presses a key, and the answer decides the call. Every question is
15
- # signed with the callback_secret the response returns, the same way your webhooks
16
- # are signed. Turning the number on again with a different URL replaces it and
17
- # keeps the secret.
11
+ # @!attribute agent_id
12
+ # One of your voice agents (GET /v3/voice/agents), such as
13
+ # agent_9f2ab000-0000-4000-8000-000000000001, to answer calls to this number. It
14
+ # wins over callback_url for calls to the number, and both may be sent; calls your
15
+ # app places from the number still follow your app. Send it instead of
16
+ # callback_url for a number only an agent answers.
18
17
  #
19
- # @return [String]
20
- required :callback_url, String
18
+ # @return [String, nil]
19
+ optional :agent_id, String, nil?: true
21
20
 
22
21
  # @!attribute area_code
23
22
  # The US area code a new number should be in, as 212. Only for a request that
@@ -28,6 +27,17 @@ module Sentdm
28
27
  # @return [String, nil]
29
28
  optional :area_code, String, nil?: true
30
29
 
30
+ # @!attribute callback_url
31
+ # Where Sent asks what to do with each call on this number: an absolute HTTP or
32
+ # HTTPS URL on a public host. A signed question is POSTed here when a call arrives
33
+ # or a caller presses a key, and the answer decides the call. Every question is
34
+ # signed with the callback_secret the response returns, the same way your webhooks
35
+ # are signed. Turning the number on again with a different URL replaces it and
36
+ # keeps the secret. Required unless agent_id is sent.
37
+ #
38
+ # @return [String, nil]
39
+ optional :callback_url, String, nil?: true
40
+
31
41
  # @!attribute default_for_app_calls
32
42
  # Make this the line app-originated calls are placed from when a voice token names
33
43
  # no number. Omit it and your first voice number takes that role; a later one
@@ -61,14 +71,16 @@ module Sentdm
61
71
  # @return [String, nil]
62
72
  optional :x_profile_id, String
63
73
 
64
- # @!method initialize(callback_url:, area_code: nil, default_for_app_calls: nil, number: nil, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
74
+ # @!method initialize(agent_id: nil, area_code: nil, callback_url: nil, default_for_app_calls: nil, number: nil, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
65
75
  # Some parameter documentations has been truncated, see
66
76
  # {Sentdm::Models::Channels::VoiceCreateParams} for more details.
67
77
  #
68
- # @param callback_url [String] Where Sent asks what to do with each call on this number: an absolute HTTP or HT
78
+ # @param agent_id [String, nil] One of your voice agents (GET /v3/voice/agents), such as
69
79
  #
70
80
  # @param area_code [String, nil] The US area code a new number should be in, as 212. Only for a request that leav
71
81
  #
82
+ # @param callback_url [String, nil] Where Sent asks what to do with each call on this number: an absolute HTTP or HT
83
+ #
72
84
  # @param default_for_app_calls [Boolean, nil] Make this the line app-originated calls are placed from when a voice token names
73
85
  #
74
86
  # @param number [String, nil] One of your phone numbers, in E.164 format. Leave the field out entirely to be g
@@ -4,6 +4,15 @@ module Sentdm
4
4
  module Models
5
5
  module Channels
6
6
  class VoiceNumber < Sentdm::Internal::Type::BaseModel
7
+ # @!attribute agent_id
8
+ # The voice agent calls to this number go to, such as
9
+ # agent_9f2ab000-0000-4000-8000-000000000001. It wins over callback_url for calls
10
+ # to the number; calls your app places from the number still follow your app. Null
11
+ # when no agent answers the number.
12
+ #
13
+ # @return [String, nil]
14
+ optional :agent_id, String, nil?: true
15
+
7
16
  # @!attribute callback_url
8
17
  # Where Sent asks what to do with each call on this number: a signed question is
9
18
  # POSTed here when a call arrives or a caller presses a key, and the answer
@@ -32,6 +41,15 @@ module Sentdm
32
41
  # @return [String, nil]
33
42
  optional :number, String
34
43
 
44
+ # @!attribute routes_to
45
+ # Who answers calls to this number: agent, the voice agent in agent_id;
46
+ # agent_pending, that agent once the number has finished moving to it, with calls
47
+ # possibly unanswered until then; callback, your callback_url; or none, in which
48
+ # case calls to it are declined.
49
+ #
50
+ # @return [String, nil]
51
+ optional :routes_to, String
52
+
35
53
  # @!attribute status
36
54
  # ACTIVE while the number carries calls, INACTIVE once it was turned off. Nothing
37
55
  # provisions: a number the customer holds can carry calls the moment voice is
@@ -45,12 +63,14 @@ module Sentdm
45
63
  # @return [Time, nil]
46
64
  optional :updated_at, Time
47
65
 
48
- # @!method initialize(callback_url: nil, created_at: nil, default_for_app_calls: nil, number: nil, status: nil, updated_at: nil)
66
+ # @!method initialize(agent_id: nil, callback_url: nil, created_at: nil, default_for_app_calls: nil, number: nil, routes_to: nil, status: nil, updated_at: nil)
49
67
  # Some parameter documentations has been truncated, see
50
68
  # {Sentdm::Models::Channels::VoiceNumber} for more details.
51
69
  #
52
70
  # One number the profile carries phone calls on.
53
71
  #
72
+ # @param agent_id [String, nil] The voice agent calls to this number go to, such as agent_9f2ab000-0000-4000-800
73
+ #
54
74
  # @param callback_url [String, nil] Where Sent asks what to do with each call on this number: a signed question is P
55
75
  #
56
76
  # @param created_at [Time]
@@ -59,6 +79,8 @@ module Sentdm
59
79
  #
60
80
  # @param number [String] The number, in E.164.
61
81
  #
82
+ # @param routes_to [String] Who answers calls to this number: agent, the voice agent in agent_id;
83
+ #
62
84
  # @param status [String] ACTIVE while the number carries calls, INACTIVE once it was turned off. Nothing
63
85
  #
64
86
  # @param updated_at [Time]
@@ -13,6 +13,15 @@ module Sentdm
13
13
  # @return [String]
14
14
  required :number, String
15
15
 
16
+ # @!attribute agent_id
17
+ # One of your voice agents, such as agent_9f2ab000-0000-4000-8000-000000000001, to
18
+ # answer calls to the number, or null to unbind it so the callback URL answers
19
+ # them again. The agent wins over callback_url for calls to the number; calls your
20
+ # app places from it still follow your app.
21
+ #
22
+ # @return [String, nil]
23
+ optional :agent_id, String, nil?: true
24
+
16
25
  # @!attribute callback_url
17
26
  # A new callback URL for the number, active or not: an absolute HTTP or HTTPS URL
18
27
  # on a public host, where Sent asks what to do with each call. The signing secret
@@ -54,12 +63,14 @@ module Sentdm
54
63
  # @return [String, nil]
55
64
  optional :x_profile_id, String
56
65
 
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: {})
66
+ # @!method initialize(number:, agent_id: nil, callback_url: nil, default_for_app_calls: nil, sandbox: nil, status: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
58
67
  # Some parameter documentations has been truncated, see
59
68
  # {Sentdm::Models::Channels::VoiceUpdateParams} for more details.
60
69
  #
61
70
  # @param number [String]
62
71
  #
72
+ # @param agent_id [String, nil] One of your voice agents, such as agent_9f2ab000-0000-4000-8000-000000000001, to
73
+ #
63
74
  # @param callback_url [String, nil] A new callback URL for the number, active or not: an absolute HTTP or HTTPS URL
64
75
  #
65
76
  # @param default_for_app_calls [Boolean, nil] true makes this the line app-originated calls are placed from when a voice token
@@ -0,0 +1,142 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Voice
6
+ # @see Sentdm::Resources::Voice::Agents#create
7
+ class AgentCreateParams < Sentdm::Internal::Type::BaseModel
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute audio
12
+ # Audio sessions only: the sound format.
13
+ #
14
+ # @return [Sentdm::Models::Voice::VoiceAgentAudioSpec, nil]
15
+ optional :audio, -> { Sentdm::Voice::VoiceAgentAudioSpec }, nil?: true
16
+
17
+ # @!attribute fallback
18
+ # Who takes the call when the agent cannot: a phone number (kind: number). Omit it
19
+ # and such a call hangs up.
20
+ #
21
+ # @return [Sentdm::Models::Voice::VoiceAgentPartySpec, nil]
22
+ optional :fallback, -> { Sentdm::Voice::VoiceAgentPartySpec }, nil?: true
23
+
24
+ # @!attribute greeting
25
+ # Text sessions only: what the caller hears as soon as the call is answered,
26
+ # before the agent's first turn. 1 to 4,096 characters. Omit it and the agent
27
+ # speaks first.
28
+ #
29
+ # @return [String, nil]
30
+ optional :greeting, String, nil?: true
31
+
32
+ # @!attribute limits
33
+ #
34
+ # @return [Sentdm::Models::Voice::VoiceAgentLimitsSpec, nil]
35
+ optional :limits, -> { Sentdm::Voice::VoiceAgentLimitsSpec }, nil?: true
36
+
37
+ # @!attribute name
38
+ # A name for your own reference, 1 to 100 characters.
39
+ #
40
+ # @return [String, nil]
41
+ optional :name, String, nil?: true
42
+
43
+ # @!attribute sandbox
44
+ # Sandbox flag - when true, the operation is simulated without side effects Useful
45
+ # for testing integrations without actual execution
46
+ #
47
+ # @return [Boolean, nil]
48
+ optional :sandbox, Sentdm::Internal::Type::Boolean
49
+
50
+ # @!attribute session_type
51
+ # text: Sent turns the caller's speech into text and the agent's text into speech,
52
+ # so the agent exchanges text frames. audio: the agent receives and sends the
53
+ # sound itself.
54
+ #
55
+ # @return [String, nil]
56
+ optional :session_type, String, nil?: true
57
+
58
+ # @!attribute speech
59
+ # Text sessions only: how the caller is spoken to and listened to.
60
+ #
61
+ # @return [Sentdm::Models::Voice::VoiceAgentSpeechSpec, nil]
62
+ optional :speech, -> { Sentdm::Voice::VoiceAgentSpeechSpec }, nil?: true
63
+
64
+ # @!attribute tools
65
+ # What the agent may do to the call: any of transfer, hangup, send_dtmf and hold.
66
+ # Default ["hangup"]. transfer needs at least one transfer_targets entry.
67
+ #
68
+ # @return [Array<String>, nil]
69
+ optional :tools, Sentdm::Internal::Type::ArrayOf[String], nil?: true
70
+
71
+ # @!attribute transcripts
72
+ #
73
+ # @return [Sentdm::Models::Voice::VoiceAgentTranscriptsSpec, nil]
74
+ optional :transcripts, -> { Sentdm::Voice::VoiceAgentTranscriptsSpec }, nil?: true
75
+
76
+ # @!attribute transfer_targets
77
+ # Where the agent may transfer a call to, up to 20 parties: a phone number (kind:
78
+ # number, E.164), one of your app users (kind: user, the identity) or another of
79
+ # your agents (kind: agent, its id). The agent can only transfer to a party listed
80
+ # here.
81
+ #
82
+ # @return [Array<Sentdm::Models::Voice::VoiceAgentPartySpec>, nil]
83
+ optional :transfer_targets,
84
+ -> { Sentdm::Internal::Type::ArrayOf[Sentdm::Voice::VoiceAgentPartySpec] },
85
+ nil?: true
86
+
87
+ # @!attribute websocket_url
88
+ # Where the gateway connects to the agent for each call: an absolute wss:// URL on
89
+ # a public host, at most 2,048 characters. The handshake is signed with the
90
+ # agent's signing_secret. Leave it out and the agent dials in instead, connecting
91
+ # to the gateway with your API key.
92
+ #
93
+ # @return [String, nil]
94
+ optional :websocket_url, String, nil?: true
95
+
96
+ # @!attribute idempotency_key
97
+ #
98
+ # @return [String, nil]
99
+ optional :idempotency_key, String
100
+
101
+ # @!attribute x_profile_id
102
+ #
103
+ # @return [String, nil]
104
+ optional :x_profile_id, String
105
+
106
+ # @!method initialize(audio: nil, fallback: nil, greeting: nil, limits: nil, name: nil, sandbox: nil, session_type: nil, speech: nil, tools: nil, transcripts: nil, transfer_targets: nil, websocket_url: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
107
+ # Some parameter documentations has been truncated, see
108
+ # {Sentdm::Models::Voice::AgentCreateParams} for more details.
109
+ #
110
+ # @param audio [Sentdm::Models::Voice::VoiceAgentAudioSpec, nil] Audio sessions only: the sound format.
111
+ #
112
+ # @param fallback [Sentdm::Models::Voice::VoiceAgentPartySpec, nil] Who takes the call when the agent cannot: a phone number (kind: number). Omit it
113
+ #
114
+ # @param greeting [String, nil] Text sessions only: what the caller hears as soon as the call is answered, befor
115
+ #
116
+ # @param limits [Sentdm::Models::Voice::VoiceAgentLimitsSpec, nil]
117
+ #
118
+ # @param name [String, nil] A name for your own reference, 1 to 100 characters.
119
+ #
120
+ # @param sandbox [Boolean] Sandbox flag - when true, the operation is simulated without side effects
121
+ #
122
+ # @param session_type [String, nil] text: Sent turns the caller's speech into text and the agent's text into speech,
123
+ #
124
+ # @param speech [Sentdm::Models::Voice::VoiceAgentSpeechSpec, nil] Text sessions only: how the caller is spoken to and listened to.
125
+ #
126
+ # @param tools [Array<String>, nil] What the agent may do to the call: any of transfer, hangup, send_dtmf and
127
+ #
128
+ # @param transcripts [Sentdm::Models::Voice::VoiceAgentTranscriptsSpec, nil]
129
+ #
130
+ # @param transfer_targets [Array<Sentdm::Models::Voice::VoiceAgentPartySpec>, nil] Where the agent may transfer a call to, up to 20 parties: a phone number (kind:
131
+ #
132
+ # @param websocket_url [String, nil] Where the gateway connects to the agent for each call: an absolute wss:// URL on
133
+ #
134
+ # @param idempotency_key [String]
135
+ #
136
+ # @param x_profile_id [String]
137
+ #
138
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
139
+ end
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Voice
6
+ # @see Sentdm::Resources::Voice::Agents#delete
7
+ class AgentDeleteParams < Sentdm::Models::MutationRequest
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!attribute x_profile_id
17
+ #
18
+ # @return [String, nil]
19
+ optional :x_profile_id, String
20
+
21
+ # @!method initialize(id:, x_profile_id: nil, request_options: {})
22
+ # @param id [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,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Voice
6
+ # @see Sentdm::Resources::Voice::Agents#list
7
+ class AgentListParams < Sentdm::Internal::Type::BaseModel
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute page
12
+ # Page number, from 1
13
+ #
14
+ # @return [Integer, nil]
15
+ optional :page, Integer
16
+
17
+ # @!attribute page_size
18
+ #
19
+ # @return [Integer, nil]
20
+ optional :page_size, Integer
21
+
22
+ # @!attribute x_profile_id
23
+ #
24
+ # @return [String, nil]
25
+ optional :x_profile_id, String
26
+
27
+ # @!method initialize(page: nil, page_size: nil, x_profile_id: nil, request_options: {})
28
+ # @param page [Integer] Page number, from 1
29
+ #
30
+ # @param page_size [Integer]
31
+ #
32
+ # @param x_profile_id [String]
33
+ #
34
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Voice
6
+ # @see Sentdm::Resources::Voice::Agents#retrieve
7
+ class AgentRetrieveParams < Sentdm::Internal::Type::BaseModel
8
+ extend Sentdm::Internal::Type::RequestParameters::Converter
9
+ include Sentdm::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!attribute x_profile_id
17
+ #
18
+ # @return [String, nil]
19
+ optional :x_profile_id, String
20
+
21
+ # @!method initialize(id:, x_profile_id: nil, request_options: {})
22
+ # @param id [String]
23
+ # @param x_profile_id [String]
24
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end