vonage 7.35.0 → 8.0.0.beta

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 (132) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +87 -880
  3. data/lib/vonage/account.rb +0 -2
  4. data/lib/vonage/applications.rb +4 -12
  5. data/lib/vonage/basic.rb +1 -1
  6. data/lib/vonage/bearer_token.rb +1 -1
  7. data/lib/vonage/client.rb +0 -72
  8. data/lib/vonage/client_error.rb +1 -1
  9. data/lib/vonage/config.rb +1 -7
  10. data/lib/vonage/conversations/events.rb +0 -12
  11. data/lib/vonage/conversations/legs.rb +0 -6
  12. data/lib/vonage/conversations/members.rb +0 -15
  13. data/lib/vonage/conversations/users.rb +0 -15
  14. data/lib/vonage/conversations.rb +0 -30
  15. data/lib/vonage/conversions.rb +0 -2
  16. data/lib/vonage/errors.rb +20 -37
  17. data/lib/vonage/gsm7.rb +1 -1
  18. data/lib/vonage/http.rb +3 -3
  19. data/lib/vonage/jwt.rb +0 -17
  20. data/lib/vonage/key_secret_params.rb +2 -3
  21. data/lib/vonage/keys.rb +1 -17
  22. data/lib/vonage/logger.rb +3 -0
  23. data/lib/vonage/messaging/channels/messenger.rb +0 -2
  24. data/lib/vonage/messaging/channels/mms.rb +3 -13
  25. data/lib/vonage/messaging/channels/sms.rb +0 -2
  26. data/lib/vonage/messaging/channels/viber.rb +2 -11
  27. data/lib/vonage/messaging/channels/whats_app.rb +1 -5
  28. data/lib/vonage/messaging/message.rb +1 -4
  29. data/lib/vonage/messaging.rb +4 -43
  30. data/lib/vonage/namespace.rb +68 -137
  31. data/lib/vonage/number_insight.rb +0 -1
  32. data/lib/vonage/numbers.rb +17 -40
  33. data/lib/vonage/server_error.rb +1 -1
  34. data/lib/vonage/signature.rb +6 -29
  35. data/lib/vonage/sms.rb +20 -25
  36. data/lib/vonage/verify.rb +0 -2
  37. data/lib/vonage/version.rb +1 -1
  38. data/lib/vonage/video/archives.rb +58 -35
  39. data/lib/vonage/video/list_response.rb +11 -0
  40. data/lib/vonage/video/moderation.rb +22 -7
  41. data/lib/vonage/video/signals.rb +9 -4
  42. data/lib/vonage/video/streams.rb +12 -6
  43. data/lib/vonage/video.rb +13 -56
  44. data/lib/vonage/voice/actions/connect.rb +9 -45
  45. data/lib/vonage/voice/actions/conversation.rb +4 -10
  46. data/lib/vonage/voice/actions/input.rb +3 -26
  47. data/lib/vonage/voice/actions/notify.rb +3 -8
  48. data/lib/vonage/voice/actions/pay.rb +107 -0
  49. data/lib/vonage/voice/actions/record.rb +4 -52
  50. data/lib/vonage/voice/actions/stream.rb +3 -7
  51. data/lib/vonage/voice/actions/talk.rb +4 -29
  52. data/lib/vonage/voice/ncco.rb +1 -3
  53. data/lib/vonage/voice/talk.rb +1 -11
  54. data/lib/vonage/voice.rb +0 -24
  55. data/lib/vonage.rb +0 -4
  56. data/vonage.gemspec +1 -3
  57. metadata +12 -116
  58. data/lib/vonage/api_error.rb +0 -33
  59. data/lib/vonage/basic_and_bearer_token.rb +0 -18
  60. data/lib/vonage/basic_and_signature.rb +0 -22
  61. data/lib/vonage/conversation/event/list_response.rb +0 -11
  62. data/lib/vonage/conversation/event.rb +0 -108
  63. data/lib/vonage/conversation/list_response.rb +0 -11
  64. data/lib/vonage/conversation/member/list_response.rb +0 -11
  65. data/lib/vonage/conversation/member.rb +0 -134
  66. data/lib/vonage/conversation/user/conversations_list_response.rb +0 -11
  67. data/lib/vonage/conversation/user/sessions_list_response.rb +0 -11
  68. data/lib/vonage/conversation/user.rb +0 -67
  69. data/lib/vonage/conversation.rb +0 -164
  70. data/lib/vonage/identity_insights/insights_builder.rb +0 -75
  71. data/lib/vonage/identity_insights.rb +0 -75
  72. data/lib/vonage/meetings/applications.rb +0 -28
  73. data/lib/vonage/meetings/dial_in_numbers/list_response.rb +0 -11
  74. data/lib/vonage/meetings/dial_in_numbers.rb +0 -26
  75. data/lib/vonage/meetings/recordings.rb +0 -42
  76. data/lib/vonage/meetings/rooms/list_response.rb +0 -11
  77. data/lib/vonage/meetings/rooms.rb +0 -167
  78. data/lib/vonage/meetings/sessions/list_response.rb +0 -11
  79. data/lib/vonage/meetings/sessions.rb +0 -31
  80. data/lib/vonage/meetings/themes/list_response.rb +0 -11
  81. data/lib/vonage/meetings/themes.rb +0 -239
  82. data/lib/vonage/meetings.rb +0 -50
  83. data/lib/vonage/messaging/channels/rcs.rb +0 -44
  84. data/lib/vonage/network_authentication/client_authentication.rb +0 -39
  85. data/lib/vonage/network_authentication/server_authentication.rb +0 -47
  86. data/lib/vonage/network_authentication.rb +0 -22
  87. data/lib/vonage/network_number_verification.rb +0 -92
  88. data/lib/vonage/network_sim_swap.rb +0 -84
  89. data/lib/vonage/number_insight_2.rb +0 -21
  90. data/lib/vonage/proactive_connect/events/list_response.rb +0 -11
  91. data/lib/vonage/proactive_connect/events.rb +0 -71
  92. data/lib/vonage/proactive_connect/item.rb +0 -116
  93. data/lib/vonage/proactive_connect/items/file_response.rb +0 -32
  94. data/lib/vonage/proactive_connect/items/list_response.rb +0 -11
  95. data/lib/vonage/proactive_connect/items.rb +0 -116
  96. data/lib/vonage/proactive_connect/list.rb +0 -186
  97. data/lib/vonage/proactive_connect/lists/list_response.rb +0 -11
  98. data/lib/vonage/proactive_connect/lists.rb +0 -38
  99. data/lib/vonage/proactive_connect.rb +0 -43
  100. data/lib/vonage/subaccounts/balance_transfers/list_response.rb +0 -11
  101. data/lib/vonage/subaccounts/credit_transfers/list_response.rb +0 -11
  102. data/lib/vonage/subaccounts/list_response.rb +0 -15
  103. data/lib/vonage/subaccounts.rb +0 -203
  104. data/lib/vonage/users/list_response.rb +0 -11
  105. data/lib/vonage/users.rb +0 -156
  106. data/lib/vonage/verify2/channels/email.rb +0 -36
  107. data/lib/vonage/verify2/channels/silent_auth.rb +0 -46
  108. data/lib/vonage/verify2/channels/sms.rb +0 -63
  109. data/lib/vonage/verify2/channels/voice.rb +0 -32
  110. data/lib/vonage/verify2/channels/whats_app.rb +0 -45
  111. data/lib/vonage/verify2/channels/whats_app_interactive.rb +0 -32
  112. data/lib/vonage/verify2/start_verification_options.rb +0 -63
  113. data/lib/vonage/verify2/template_fragments/list_response.rb +0 -11
  114. data/lib/vonage/verify2/template_fragments.rb +0 -125
  115. data/lib/vonage/verify2/templates/list_response.rb +0 -11
  116. data/lib/vonage/verify2/templates.rb +0 -86
  117. data/lib/vonage/verify2/workflow.rb +0 -39
  118. data/lib/vonage/verify2/workflow_builder.rb +0 -25
  119. data/lib/vonage/verify2.rb +0 -112
  120. data/lib/vonage/video/archives/list_response.rb +0 -11
  121. data/lib/vonage/video/broadcasts/list_response.rb +0 -11
  122. data/lib/vonage/video/broadcasts.rb +0 -75
  123. data/lib/vonage/video/captions.rb +0 -67
  124. data/lib/vonage/video/connections/list_response.rb +0 -11
  125. data/lib/vonage/video/connections.rb +0 -29
  126. data/lib/vonage/video/renders/list_response.rb +0 -11
  127. data/lib/vonage/video/renders.rb +0 -107
  128. data/lib/vonage/video/sip.rb +0 -48
  129. data/lib/vonage/video/streams/list_response.rb +0 -11
  130. data/lib/vonage/video/web_socket.rb +0 -62
  131. data/lib/vonage/voice/actions/transfer.rb +0 -83
  132. data/lib/vonage/voice/actions/wait.rb +0 -43
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vonage
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.35.0
4
+ version: 8.0.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vonage
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2022-12-12 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: vonage-jwt
@@ -15,14 +16,14 @@ dependencies:
15
16
  requirements:
16
17
  - - "~>"
17
18
  - !ruby/object:Gem::Version
18
- version: 0.2.0
19
+ version: 0.1.0
19
20
  type: :runtime
20
21
  prerelease: false
21
22
  version_requirements: !ruby/object:Gem::Requirement
22
23
  requirements:
23
24
  - - "~>"
24
25
  - !ruby/object:Gem::Version
25
- version: 0.2.0
26
+ version: 0.1.0
26
27
  - !ruby/object:Gem::Dependency
27
28
  name: zeitwerk
28
29
  requirement: !ruby/object:Gem::Requirement
@@ -57,40 +58,6 @@ dependencies:
57
58
  - - "~>"
58
59
  - !ruby/object:Gem::Version
59
60
  version: '0.5'
60
- - !ruby/object:Gem::Dependency
61
- name: multipart-post
62
- requirement: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '2.0'
67
- type: :runtime
68
- prerelease: false
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: '2.0'
74
- - !ruby/object:Gem::Dependency
75
- name: net-http-persistent
76
- requirement: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: '4.0'
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: 4.0.2
84
- type: :runtime
85
- prerelease: false
86
- version_requirements: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '4.0'
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- version: 4.0.2
94
61
  - !ruby/object:Gem::Dependency
95
62
  name: rexml
96
63
  requirement: !ruby/object:Gem::Requirement
@@ -132,26 +99,14 @@ files:
132
99
  - lib/vonage/abstract_authentication.rb
133
100
  - lib/vonage/account.rb
134
101
  - lib/vonage/alerts.rb
135
- - lib/vonage/api_error.rb
136
102
  - lib/vonage/applications.rb
137
103
  - lib/vonage/applications/list_response.rb
138
104
  - lib/vonage/authentication_error.rb
139
105
  - lib/vonage/basic.rb
140
- - lib/vonage/basic_and_bearer_token.rb
141
- - lib/vonage/basic_and_signature.rb
142
106
  - lib/vonage/bearer_token.rb
143
107
  - lib/vonage/client.rb
144
108
  - lib/vonage/client_error.rb
145
109
  - lib/vonage/config.rb
146
- - lib/vonage/conversation.rb
147
- - lib/vonage/conversation/event.rb
148
- - lib/vonage/conversation/event/list_response.rb
149
- - lib/vonage/conversation/list_response.rb
150
- - lib/vonage/conversation/member.rb
151
- - lib/vonage/conversation/member/list_response.rb
152
- - lib/vonage/conversation/user.rb
153
- - lib/vonage/conversation/user/conversations_list_response.rb
154
- - lib/vonage/conversation/user/sessions_list_response.rb
155
110
  - lib/vonage/conversations.rb
156
111
  - lib/vonage/conversations/events.rb
157
112
  - lib/vonage/conversations/legs.rb
@@ -165,57 +120,27 @@ files:
165
120
  - lib/vonage/form_data.rb
166
121
  - lib/vonage/gsm7.rb
167
122
  - lib/vonage/http.rb
168
- - lib/vonage/identity_insights.rb
169
- - lib/vonage/identity_insights/insights_builder.rb
170
123
  - lib/vonage/json.rb
171
124
  - lib/vonage/jwt.rb
172
125
  - lib/vonage/key_secret_params.rb
173
126
  - lib/vonage/keys.rb
174
127
  - lib/vonage/logger.rb
175
- - lib/vonage/meetings.rb
176
- - lib/vonage/meetings/applications.rb
177
- - lib/vonage/meetings/dial_in_numbers.rb
178
- - lib/vonage/meetings/dial_in_numbers/list_response.rb
179
- - lib/vonage/meetings/recordings.rb
180
- - lib/vonage/meetings/rooms.rb
181
- - lib/vonage/meetings/rooms/list_response.rb
182
- - lib/vonage/meetings/sessions.rb
183
- - lib/vonage/meetings/sessions/list_response.rb
184
- - lib/vonage/meetings/themes.rb
185
- - lib/vonage/meetings/themes/list_response.rb
186
128
  - lib/vonage/messages.rb
187
129
  - lib/vonage/messaging.rb
188
130
  - lib/vonage/messaging/channels/messenger.rb
189
131
  - lib/vonage/messaging/channels/mms.rb
190
- - lib/vonage/messaging/channels/rcs.rb
191
132
  - lib/vonage/messaging/channels/sms.rb
192
133
  - lib/vonage/messaging/channels/viber.rb
193
134
  - lib/vonage/messaging/channels/whats_app.rb
194
135
  - lib/vonage/messaging/message.rb
195
136
  - lib/vonage/namespace.rb
196
- - lib/vonage/network_authentication.rb
197
- - lib/vonage/network_authentication/client_authentication.rb
198
- - lib/vonage/network_authentication/server_authentication.rb
199
- - lib/vonage/network_number_verification.rb
200
- - lib/vonage/network_sim_swap.rb
201
137
  - lib/vonage/number_insight.rb
202
- - lib/vonage/number_insight_2.rb
203
138
  - lib/vonage/numbers.rb
204
139
  - lib/vonage/numbers/list_response.rb
205
140
  - lib/vonage/numbers/response.rb
206
141
  - lib/vonage/params.rb
207
142
  - lib/vonage/pricing.rb
208
143
  - lib/vonage/pricing_types.rb
209
- - lib/vonage/proactive_connect.rb
210
- - lib/vonage/proactive_connect/events.rb
211
- - lib/vonage/proactive_connect/events/list_response.rb
212
- - lib/vonage/proactive_connect/item.rb
213
- - lib/vonage/proactive_connect/items.rb
214
- - lib/vonage/proactive_connect/items/file_response.rb
215
- - lib/vonage/proactive_connect/items/list_response.rb
216
- - lib/vonage/proactive_connect/list.rb
217
- - lib/vonage/proactive_connect/lists.rb
218
- - lib/vonage/proactive_connect/lists/list_response.rb
219
144
  - lib/vonage/redact.rb
220
145
  - lib/vonage/response.rb
221
146
  - lib/vonage/secrets.rb
@@ -224,56 +149,25 @@ files:
224
149
  - lib/vonage/service_error.rb
225
150
  - lib/vonage/signature.rb
226
151
  - lib/vonage/sms.rb
227
- - lib/vonage/subaccounts.rb
228
- - lib/vonage/subaccounts/balance_transfers/list_response.rb
229
- - lib/vonage/subaccounts/credit_transfers/list_response.rb
230
- - lib/vonage/subaccounts/list_response.rb
231
152
  - lib/vonage/tfa.rb
232
153
  - lib/vonage/user_agent.rb
233
- - lib/vonage/users.rb
234
- - lib/vonage/users/list_response.rb
235
154
  - lib/vonage/verify.rb
236
- - lib/vonage/verify2.rb
237
- - lib/vonage/verify2/channels/email.rb
238
- - lib/vonage/verify2/channels/silent_auth.rb
239
- - lib/vonage/verify2/channels/sms.rb
240
- - lib/vonage/verify2/channels/voice.rb
241
- - lib/vonage/verify2/channels/whats_app.rb
242
- - lib/vonage/verify2/channels/whats_app_interactive.rb
243
- - lib/vonage/verify2/start_verification_options.rb
244
- - lib/vonage/verify2/template_fragments.rb
245
- - lib/vonage/verify2/template_fragments/list_response.rb
246
- - lib/vonage/verify2/templates.rb
247
- - lib/vonage/verify2/templates/list_response.rb
248
- - lib/vonage/verify2/workflow.rb
249
- - lib/vonage/verify2/workflow_builder.rb
250
155
  - lib/vonage/version.rb
251
156
  - lib/vonage/video.rb
252
157
  - lib/vonage/video/archives.rb
253
- - lib/vonage/video/archives/list_response.rb
254
- - lib/vonage/video/broadcasts.rb
255
- - lib/vonage/video/broadcasts/list_response.rb
256
- - lib/vonage/video/captions.rb
257
- - lib/vonage/video/connections.rb
258
- - lib/vonage/video/connections/list_response.rb
158
+ - lib/vonage/video/list_response.rb
259
159
  - lib/vonage/video/moderation.rb
260
- - lib/vonage/video/renders.rb
261
- - lib/vonage/video/renders/list_response.rb
262
160
  - lib/vonage/video/signals.rb
263
- - lib/vonage/video/sip.rb
264
161
  - lib/vonage/video/streams.rb
265
- - lib/vonage/video/streams/list_response.rb
266
- - lib/vonage/video/web_socket.rb
267
162
  - lib/vonage/voice.rb
268
163
  - lib/vonage/voice/actions/connect.rb
269
164
  - lib/vonage/voice/actions/conversation.rb
270
165
  - lib/vonage/voice/actions/input.rb
271
166
  - lib/vonage/voice/actions/notify.rb
167
+ - lib/vonage/voice/actions/pay.rb
272
168
  - lib/vonage/voice/actions/record.rb
273
169
  - lib/vonage/voice/actions/stream.rb
274
170
  - lib/vonage/voice/actions/talk.rb
275
- - lib/vonage/voice/actions/transfer.rb
276
- - lib/vonage/voice/actions/wait.rb
277
171
  - lib/vonage/voice/dtmf.rb
278
172
  - lib/vonage/voice/list_response.rb
279
173
  - lib/vonage/voice/ncco.rb
@@ -289,6 +183,7 @@ metadata:
289
183
  bug_tracker_uri: https://github.com/Vonage/vonage-ruby-sdk/issues
290
184
  changelog_uri: https://github.com/Vonage/vonage-ruby-sdk/blob/master/CHANGES.md
291
185
  documentation_uri: https://www.rubydoc.info/github/vonage/vonage-ruby-sdk
186
+ post_install_message:
292
187
  rdoc_options: []
293
188
  require_paths:
294
189
  - lib
@@ -299,11 +194,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
299
194
  version: 2.5.0
300
195
  required_rubygems_version: !ruby/object:Gem::Requirement
301
196
  requirements:
302
- - - ">="
197
+ - - ">"
303
198
  - !ruby/object:Gem::Version
304
- version: '0'
199
+ version: 1.3.1
305
200
  requirements: []
306
- rubygems_version: 3.6.9
201
+ rubygems_version: 3.3.26
202
+ signing_key:
307
203
  specification_version: 4
308
204
  summary: This is the Ruby Server SDK for Vonage APIs. To use it you'll need a Vonage
309
205
  account. Sign up for free at https://www.vonage.com
@@ -1,33 +0,0 @@
1
- # typed: strong
2
- require "json"
3
-
4
- module Vonage
5
- class APIError < Error
6
- extend T::Sig
7
-
8
- sig { returns(Net::HTTPResponse) }
9
- attr_reader :http_response
10
-
11
- sig { params(message: T.nilable(String), http_response: T.nilable(Net::HTTPResponse)).void }
12
- def initialize(message = nil, http_response: nil)
13
- super(message)
14
- @http_response = http_response
15
- end
16
-
17
- def http_response_code
18
- return nil unless http_response
19
- http_response.code
20
- end
21
-
22
- def http_response_headers
23
- return nil unless http_response
24
- http_response.to_hash
25
- end
26
-
27
- def http_response_body
28
- return nil unless http_response
29
- return {} unless http_response.content_type && http_response.content_type.include?("json")
30
- ::JSON.parse(http_response.body)
31
- end
32
- end
33
- end
@@ -1,18 +0,0 @@
1
- # typed: true
2
- # frozen_string_literal: true
3
-
4
- module Vonage
5
- class BasicAndBearerToken < AbstractAuthentication
6
- def update(object, data)
7
- return unless object.is_a?(Net::HTTPRequest)
8
-
9
- if @config.authentication_preference == :basic
10
- object.basic_auth(@config.api_key, @config.api_secret)
11
- else
12
- object['Authorization'] = 'Bearer ' + @config.token
13
- end
14
- end
15
- end
16
-
17
- private_constant :BasicAndBearerToken
18
- end
@@ -1,22 +0,0 @@
1
- # typed: true
2
-
3
- module Vonage
4
- class BasicAndSignature < AbstractAuthentication
5
- def update(object, data)
6
- if @config.authentication_preference == :signature
7
- return unless object.is_a?(Hash)
8
-
9
- object['api_key'] = T.must(@config).api_key
10
- object['timestamp'] =Time.now.to_i.to_s
11
- signature = Signature.new(@config).generate(object)
12
- object[:sig] = signature
13
- else
14
- return unless object.is_a?(Net::HTTPRequest)
15
-
16
- object.basic_auth(@config.api_key, @config.api_secret)
17
- end
18
- end
19
- end
20
-
21
- private_constant :BasicAndSignature
22
- end
@@ -1,11 +0,0 @@
1
- # typed: true
2
-
3
- class Vonage::Conversation::Event::ListResponse < Vonage::Response
4
- include Enumerable
5
-
6
- def each
7
- return enum_for(:each) unless block_given?
8
-
9
- @entity._embedded.each { |item| yield item }
10
- end
11
- end
@@ -1,108 +0,0 @@
1
- # typed: true
2
- # frozen_string_literal: true
3
-
4
- module Vonage
5
- class Conversation::Event < Namespace
6
- self.authentication = BearerToken
7
-
8
- self.request_body = JSON
9
-
10
- # List conversation events
11
- #
12
- # @example
13
- # response = client.conversation.event.list(conversation_id: 'CON-d66d47de-5bcb-4300-94f0-0c9d4b948e9a')
14
- #
15
- # @param [required, String] :conversation_id The conversation_id of the conversation to list events for
16
- #
17
- # @param [String] :start_id
18
- # The ID to start returning events at
19
- #
20
- # @param [String] :end_id
21
- # The ID to end returning events at
22
- #
23
- # @param [String] :event_type
24
- # The type of event to search for. Does not currently support custom events
25
- #
26
- # @param [Integer] :page_size
27
- # Return this amount of records in the response.
28
- #
29
- # @param ['asc', 'desc'] :order
30
- # Return the records in ascending or descending order.
31
- #
32
- # @param [String] :cursor
33
- # The cursor to start returning results from.
34
- #
35
- # @return [Conversation::Member::ListResponse]
36
- #
37
- # @see https://developer.vonage.com/en/api/conversation#getEvents
38
- #
39
- def list(conversation_id:, **params)
40
- request("/v1/conversations/#{conversation_id}/events", params: params, response_class: ListResponse)
41
- end
42
-
43
- # Create an event
44
- # @example
45
- # response = client.conversation.event.create(
46
- # conversation_id: 'CON-d66d47de-5bcb-4300-94f0-0c9d4b948e9a',
47
- # type: 'message',
48
- # body: {
49
- # message_type: 'text',
50
- # text: 'Hello World'
51
- # }
52
- # )
53
- #
54
- # @param [required, String] :conversation_id The conversation_id of the conversation to create the event for
55
- #
56
- # @param [required, String] :type
57
- # Event type.
58
- #
59
- # @param [String] :from
60
- #
61
- # @option params [required, String] :from
62
- #
63
- # @param [Hash] :body
64
- # The body of the event. There are many possible properties depending on the event type and message_type
65
- #
66
- # @return [Response]
67
- #
68
- # @see https://developer.vonage.com/en/api/conversation#createEvent
69
- #
70
- def create(conversation_id:, **params)
71
- request("/v1/conversations/#{conversation_id}/events", params: params, type: Post)
72
- end
73
-
74
- # Get details of a specific event
75
- #
76
- # @example
77
- # response = client.conversation.event.find(conversation_id: 'CON-d66d47de-5bcb-4300-94f0-0c9d4b948e9a', event_id: 1)
78
- #
79
- # @param [required, String] :conversation_id
80
- #
81
- # @param [required, String] :event_id
82
- #
83
- # @return [Response]
84
- #
85
- # @see https://developer.vonage.com/en/api/conversation#getEvent
86
- #
87
- def find(conversation_id:, event_id:)
88
- request("/v1/conversations/#{conversation_id}/events/#{event_id}")
89
- end
90
-
91
- # Delete an event.
92
- #
93
- # @example
94
- # response = client.conversation.event.delete(conversation_id: 'CON-d66d47de-5bcb-4300-94f0-0c9d4b948e9a', event_id: 1)
95
- #
96
- # @param [String] :conversation_id
97
- #
98
- # @param [String] :event_id
99
- #
100
- # @return [Response]
101
- #
102
- # @see https://developer.vonage.com/en/api/conversation#deleteEvent
103
- #
104
- def delete(conversation_id:, event_id:)
105
- request("/v1/conversations/#{conversation_id}/events/#{event_id}", type: Delete)
106
- end
107
- end
108
- end
@@ -1,11 +0,0 @@
1
- # typed: true
2
-
3
- class Vonage::Conversation::ListResponse < Vonage::Response
4
- include Enumerable
5
-
6
- def each
7
- return enum_for(:each) unless block_given?
8
-
9
- @entity._embedded.conversations.each { |item| yield item }
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # typed: true
2
-
3
- class Vonage::Conversation::Member::ListResponse < Vonage::Response
4
- include Enumerable
5
-
6
- def each
7
- return enum_for(:each) unless block_given?
8
-
9
- @entity._embedded.members.each { |item| yield item }
10
- end
11
- end
@@ -1,134 +0,0 @@
1
- # typed: true
2
- # frozen_string_literal: true
3
-
4
- module Vonage
5
- class Conversation::Member < Namespace
6
- self.authentication = BearerToken
7
-
8
- self.request_body = JSON
9
-
10
- # List members of a conversation
11
- #
12
- # @example
13
- # response = client.conversation.member.list(conversation_id: 'CON-d66d47de-5bcb-4300-94f0-0c9d4b948e9a')
14
- #
15
- # @param [required, String] :conversation_id The conversation_id of the conversation to list members for
16
- #
17
- # @param [Integer] :page_size
18
- # Return this amount of records in the response.
19
- #
20
- # @param ['asc', 'desc'] :order
21
- # Return the records in ascending or descending order.
22
- #
23
- # @param [String] :cursor
24
- # The cursor to start returning results from.
25
- #
26
- # @return [Conversation::Member::ListResponse]
27
- #
28
- # @see https://developer.vonage.com/en/api/conversation#getMembers
29
- #
30
- def list(conversation_id:, **params)
31
- request("/v1/conversations/#{conversation_id}/members", params: params, response_class: ListResponse)
32
- end
33
-
34
- # Create a member.
35
- #
36
- # @example
37
- # response = client.conversation.member.create(
38
- # conversation_id: 'CON-d66d47de-5bcb-4300-94f0-0c9d4b948e9a',
39
- # user: {
40
- # id: 'USR-82e028d9-5201-4f1e-8188-604b2d3471ec'
41
- # }
42
- # )
43
- #
44
- # @param [required, String] :conversation_id The conversation_id of the conversation for which to create the member
45
- #
46
- # @param [String] :state Must be one of ['invited', 'joined']
47
- #
48
- # @param [Hash] :user (Either :id or :name is required)
49
- # - @option user [String] :id The user_id of the user to add to the conversation
50
- # - @option user [String] :name The name of the user to add to the conversation
51
- #
52
- # @param [Hash] :channel
53
- # - @option channel [required, String] :type The type of channel
54
- # - @option channel [Hash] :from
55
- # - @option from [String] :type
56
- # - @option from [String] :number
57
- # - @option from [String] :id
58
- # - @option channel [Hash] :to
59
- # - @option from [String] :type
60
- # - @option from [String] :user
61
- # - @option from [String] :number
62
- # - @option from [String] :id
63
- #
64
- # @param [Hash] :media
65
- # - @option media [Boolean] :audio
66
- # - @option media [Hash] :audio_settings
67
- # - @option audio_settings [Boolean] :enabled
68
- # - @option audio_settings [Boolean] :earmuffed
69
- # - @option audio_settings [Boolean] :muted
70
- #
71
- # @param [String] :knocking_id
72
- #
73
- # @param [String] :member_id_inviting
74
- #
75
- # @param [String] :from
76
- #
77
- # @return [Response]
78
- #
79
- # @see https://developer.vonage.com/en/api/conversation#createMember
80
- #
81
- def create(conversation_id:, **params)
82
- request("/v1/conversations/#{conversation_id}/members", params: params, type: Post)
83
- end
84
-
85
- # Retrieve a member
86
- #
87
- # @example
88
- # response = client.conversation.member.find(
89
- # conversation_id: 'CON-d66d47de-5bcb-4300-94f0-0c9d4b948e9a',
90
- # member_id: 'MEM-63f61863-4a51-4f6b-86e1-46edebio0391'
91
- # )
92
- #
93
- # @param [required, String] :conversation_id
94
- #
95
- # @param [required, String] :member_id
96
- #
97
- # @return [Response]
98
- #
99
- # @see https://developer.vonage.com/en/api/conversation#getMember
100
- #
101
- def find(conversation_id:, member_id:)
102
- request("/v1/conversations/#{conversation_id}/members/#{member_id}", response_class: Vonage::Response)
103
- end
104
-
105
- # Update a member
106
- #
107
- # @example
108
- # response = client.conversation.member.update(
109
- # conversation_id: 'CON-d66d47de-5bcb-4300-94f0-0c9d4b948e9a',
110
- # member_id: 'MEM-63f61863-4a51-4f6b-86e1-46edebio0391',
111
- # state: 'left'
112
- # )
113
- #
114
- # @param [required, String] :conversation_id
115
- #
116
- # @param [required, String] :member_id
117
- #
118
- # @param [String] :state Must be one of ['joined', 'left']
119
- #
120
- # @param [String] :from
121
- #
122
- # @param [Hash] :reason
123
- # - @option reason [String] :code
124
- # - @option reason [String] :text
125
- #
126
- # @return [Response]
127
- #
128
- # @see https://developer.vonage.com/en/api/conversation#updateMember
129
- #
130
- def update(conversation_id:, member_id:, **params)
131
- request("/v1/conversations/#{conversation_id}/members/#{member_id}", params: params, type: Patch)
132
- end
133
- end
134
- end
@@ -1,11 +0,0 @@
1
- # typed: true
2
-
3
- class Vonage::Conversation::User::ConversationsListResponse < Vonage::Response
4
- include Enumerable
5
-
6
- def each
7
- return enum_for(:each) unless block_given?
8
-
9
- @entity._embedded.conversations.each { |item| yield item }
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # typed: true
2
-
3
- class Vonage::Conversation::User::SessionsListResponse < Vonage::Response
4
- include Enumerable
5
-
6
- def each
7
- return enum_for(:each) unless block_given?
8
-
9
- @entity._embedded.sessions.each { |item| yield item }
10
- end
11
- end
@@ -1,67 +0,0 @@
1
- # typed: true
2
- # frozen_string_literal: true
3
-
4
- module Vonage
5
- class Conversation::User < Namespace
6
- self.authentication = BearerToken
7
-
8
- # List conversations associated with a user.
9
- #
10
- # @example
11
- # response = client.conversation.user.list_conversations(user_id: 'USR-82e028d9-5201-4f1e-8188-604b2d3471ec')
12
- #
13
- # @param [required, String] :user_id The user_id of the user to list conversations for
14
- #
15
- # @param [String] :state Must be one of ['INVITED', 'JOINED', 'LEFT']
16
- #
17
- # @param [String] :order_by Must be one of ['created', 'custom_sort_key']
18
- #
19
- # @param [Boolean] :include_custom_data
20
- # @param [String] :date_start
21
- # Return the records that occurred after this point in time.
22
- #
23
- # @param [String] :date_start
24
- # Return the records that occurred after this point in time.
25
- #
26
- # @param [Integer] :page_size
27
- # Return this amount of records in the response.
28
- #
29
- # @param ['asc', 'desc'] :order
30
- # Return the records in ascending or descending order.
31
- #
32
- # @param [String] :cursor
33
- # The cursor to start returning results from.
34
- #
35
- # @return [Conversation::User::ConversationsListResponse]
36
- #
37
- # @see https://developer.vonage.com/en/api/conversation#getuserConversations
38
- #
39
- def list_conversations(user_id:, **params)
40
- request("/v1/users/#{user_id}/conversations", params: params, response_class: ConversationsListResponse)
41
- end
42
-
43
- # List conversations associated with a user.
44
- #
45
- # @example
46
- # response = client.conversation.user.list_sessions(user_id: 'USR-82e028d9-5201-4f1e-8188-604b2d3471ec')
47
- #
48
- # @param [required, String] :user_id The user_id of the user to list sessions for
49
- #
50
- # @param [Integer] :page_size
51
- # Return this amount of records in the response.
52
- #
53
- # @param ['asc', 'desc'] :order
54
- # Return the records in ascending or descending order.
55
- #
56
- # @param [String] :cursor
57
- # The cursor to start returning results from.
58
- #
59
- # @return [Conversation::User::SessionsListResponse]
60
- #
61
- # @see https://developer.vonage.com/en/api/conversation#getuserSessions
62
- #
63
- def list_sessions(user_id:, **params)
64
- request("/v1/users/#{user_id}/sessions", params: params, response_class: SessionsListResponse)
65
- end
66
- end
67
- end