nexmo 5.6.0 → 5.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcef65e09c820aa2be62979694389d22332b6950ac9032e83aeacc1b9a3b09ec
4
- data.tar.gz: 736e0c49c1c24d7fa76876b92a9cd1eef5ea0fa2dbe8137b8f5b8f6e5424df8a
3
+ metadata.gz: 0b9db1bb77672593f41a15c8134ddf1071f3487adce3b647f7daf4bf5f9d3db3
4
+ data.tar.gz: e3c2f18adb27d7336f2df01b2814368fde90961201cdd4a83df2591111fe3150
5
5
  SHA512:
6
- metadata.gz: b8e63854abd113d5670356a17d82ac7264c5f7b3e41d1db43252091200c05d574a2e4c48e29e487d4a5a8eb8f85e27968d1f65e037f83bc6dbf4f42944f5a667
7
- data.tar.gz: 504269980fdcfa37612957e6d6d514a8adf8c7471ba3b6f3407b54ff54d4cd05ec4226875fecae5e341df5d7372836e9484b50c898ec5a73412eac02d02b9133
6
+ metadata.gz: 6c1d1063654c744551a8b36418d01304b4011434572072effe4fdbd511748c0842735b6e6f620b2f7b5aeff063254655c8726d83289066b00ac9427198f033c0
7
+ data.tar.gz: 2a28f5f8ba3ec2b04bd4d63388cd485e0b643d05f94c2312eb8dd7e35983faefd106c7d8c1d2c2dbe6e59383ef3eaeeef133bd0ee543f4c174b0bace16b527bb
data/README.md CHANGED
@@ -12,6 +12,7 @@ need a Nexmo account. Sign up [for free at nexmo.com][signup].
12
12
  * [2FA API](#2fa-api)
13
13
  * [Voice API](#voice-api)
14
14
  * [Verify API](#verify-api)
15
+ * [Conversation API](#conversation-api)
15
16
  * [Number Insight API](#number-insight-api)
16
17
  * [Application API](#application-api)
17
18
  * [Numbers API](#numbers-api)
@@ -254,6 +255,49 @@ client.verify.trigger_next_event('00e6c3377e5348cdaf567e1417c707a5')
254
255
  Docs: [https://developer.nexmo.com/api/verify#verify-control](https://developer.nexmo.com/api/verify?utm_source=DEV_REL&utm_medium=github&utm_campaign=ruby-client-library?utm_source=DEV_REL&utm_medium=github&utm_campaign=ruby-client-library#verify-control)
255
256
 
256
257
 
258
+ ## Conversation API
259
+
260
+ ### Create a conversation
261
+
262
+ ```ruby
263
+ response = client.conversations.create(name: 'Example Conversation', display_name: 'Example Display Name')
264
+ ```
265
+
266
+ Docs: [https://developer.nexmo.com/api/conversation#createConversation](https://developer.nexmo.com/api/conversation?utm_source=DEV_REL&utm_medium=github&utm_campaign=ruby-client-library#createConversation)
267
+
268
+ ### Retrieve a list of conversations
269
+
270
+ ```ruby
271
+ response = client.conversations.list
272
+ ```
273
+
274
+ Docs: [https://developer.nexmo.com/api/conversation#listConversations](https://developer.nexmo.com/api/conversation?utm_source=DEV_REL&utm_medium=github&utm_campaign=ruby-client-library#listConversations)
275
+
276
+ ### Retrieve a single conversation
277
+
278
+ ```ruby
279
+ response = client.conversations.get(conversation_id)
280
+ ```
281
+
282
+ Docs: [https://developer.nexmo.com/api/conversation#retrieveConversation](https://developer.nexmo.com/api/conversation?utm_source=DEV_REL&utm_medium=github&utm_campaign=ruby-client-library#retrieveConversation)
283
+
284
+ ### Update a conversation
285
+
286
+ ```ruby
287
+ response = client.conversations.update(conversation_id, answer_method: 'PUT')
288
+ ```
289
+
290
+ Docs: [https://developer.nexmo.com/api/conversation#replaceConversation](https://developer.nexmo.com/api/conversation?utm_source=DEV_REL&utm_medium=github&utm_campaign=ruby-client-library#replaceConversation)
291
+
292
+ ### Delete a conversation
293
+
294
+ ```ruby
295
+ response = client.conversations.delete(conversation_id)
296
+ ```
297
+
298
+ Docs: [https://developer.nexmo.com/api/conversation#deleteConversation](https://developer.nexmo.com/api/application?utm_source=DEV_REL&utm_medium=github&utm_campaign=ruby-client-library#deleteConversation)
299
+
300
+
257
301
  ## Number Insight API
258
302
 
259
303
  ### Basic Number Insight
@@ -28,6 +28,11 @@ require 'nexmo/call_dtmf'
28
28
  require 'nexmo/call_stream'
29
29
  require 'nexmo/call_talk'
30
30
  require 'nexmo/calls'
31
+ require 'nexmo/conversation_events'
32
+ require 'nexmo/conversation_legs'
33
+ require 'nexmo/conversation_members'
34
+ require 'nexmo/conversation_users'
35
+ require 'nexmo/conversations'
31
36
  require 'nexmo/conversions'
32
37
  require 'nexmo/files'
33
38
  require 'nexmo/messages'
@@ -129,6 +129,10 @@ module Nexmo
129
129
  @calls ||= Calls.new(self)
130
130
  end
131
131
 
132
+ def conversations
133
+ @conversations ||= Conversations.new(self)
134
+ end
135
+
132
136
  def conversions
133
137
  @conversions ||= Conversions.new(self)
134
138
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nexmo
4
+ class ConversationEvents < Namespace
5
+ self.authentication = BearerToken
6
+
7
+ self.request_body = JSON
8
+
9
+ def create(conversation_id, params)
10
+ request('/beta/conversations/' + conversation_id + '/events', params: params, type: Post)
11
+ end
12
+
13
+ def list(conversation_id)
14
+ request('/beta/conversations/' + conversation_id + '/events')
15
+ end
16
+
17
+ def get(conversation_id, event_id)
18
+ request('/beta/conversations/' + conversation_id + '/events/' + event_id.to_s)
19
+ end
20
+
21
+ def delete(conversation_id, event_id)
22
+ request('/beta/conversations/' + conversation_id + '/events/' + event_id.to_s, type: Delete)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nexmo
4
+ class ConversationLegs < Namespace
5
+ self.authentication = BearerToken
6
+
7
+ def list
8
+ request('/beta/legs')
9
+ end
10
+
11
+ def delete(leg_id)
12
+ request('/beta/legs/' + leg_id, type: Delete)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nexmo
4
+ class ConversationMembers < Namespace
5
+ self.authentication = BearerToken
6
+
7
+ self.request_body = JSON
8
+
9
+ def create(conversation_id, params)
10
+ request('/beta/conversations/' + conversation_id + '/members', params: params, type: Post)
11
+ end
12
+
13
+ def list(conversation_id)
14
+ request('/beta/conversations/' + conversation_id + '/members')
15
+ end
16
+
17
+ def get(conversation_id, member_id)
18
+ request('/beta/conversations/' + conversation_id + '/members/' + member_id)
19
+ end
20
+
21
+ def update(conversation_id, member_id, params)
22
+ request('/beta/conversations/' + conversation_id + '/members/' + member_id, params: params, type: Put)
23
+ end
24
+
25
+ def delete(conversation_id, member_id)
26
+ request('/beta/conversations/' + conversation_id + '/members/' + member_id, type: Delete)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nexmo
4
+ class ConversationUsers < Namespace
5
+ self.authentication = BearerToken
6
+
7
+ self.request_body = JSON
8
+
9
+ def create(params)
10
+ request('/beta/users', params: params, type: Post)
11
+ end
12
+
13
+ def list
14
+ request('/beta/users')
15
+ end
16
+
17
+ def get(id)
18
+ request('/beta/users/' + id)
19
+ end
20
+
21
+ def update(id, params)
22
+ request('/beta/users/' + id, params: params, type: Put)
23
+ end
24
+
25
+ def delete(id)
26
+ request('/beta/users/' + id, type: Delete)
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nexmo
4
+ class Conversations < Namespace
5
+ self.authentication = BearerToken
6
+
7
+ self.request_body = JSON
8
+
9
+ def create(params)
10
+ request('/beta/conversations', params: params, type: Post)
11
+ end
12
+
13
+ def list(params = nil)
14
+ request('/beta/conversations', params: params)
15
+ end
16
+
17
+ def get(id)
18
+ request('/beta/conversations/' + id)
19
+ end
20
+
21
+ def update(id, params)
22
+ request('/beta/conversations/' + id, params: params, type: Put)
23
+ end
24
+
25
+ def delete(id)
26
+ request('/beta/conversations/' + id, type: Delete)
27
+ end
28
+
29
+ def events
30
+ @events ||= ConversationEvents.new(@client)
31
+ end
32
+
33
+ def legs
34
+ @legs ||= ConversationLegs.new(@client)
35
+ end
36
+
37
+ def members
38
+ @members ||= ConversationMembers.new(@client)
39
+ end
40
+
41
+ def users
42
+ @users ||= ConversationUsers.new(@client)
43
+ end
44
+ end
45
+ end
@@ -1,3 +1,3 @@
1
1
  module Nexmo
2
- VERSION = '5.6.0'
2
+ VERSION = '5.7.0'
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = 'https://github.com/Nexmo/nexmo-ruby'
11
11
  s.description = 'Nexmo Client Library for Ruby'
12
12
  s.summary = 'This is the Ruby client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up for free at https://www.nexmo.com'
13
- s.files = Dir.glob('{lib,spec}/**/*') + %w(LICENSE.txt README.md nexmo.gemspec)
13
+ s.files = Dir.glob('lib/**/*.rb') + %w(LICENSE.txt README.md nexmo.gemspec)
14
14
  s.required_ruby_version = '>= 2.1.0'
15
15
  s.add_dependency('jwt', '~> 2')
16
16
  s.add_development_dependency('rake', '~> 12.0')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.0
4
+ version: 5.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nexmo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-01 00:00:00.000000000 Z
11
+ date: 2019-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -103,6 +103,11 @@ files:
103
103
  - lib/nexmo/call_talk.rb
104
104
  - lib/nexmo/calls.rb
105
105
  - lib/nexmo/client.rb
106
+ - lib/nexmo/conversation_events.rb
107
+ - lib/nexmo/conversation_legs.rb
108
+ - lib/nexmo/conversation_members.rb
109
+ - lib/nexmo/conversation_users.rb
110
+ - lib/nexmo/conversations.rb
106
111
  - lib/nexmo/conversions.rb
107
112
  - lib/nexmo/entity.rb
108
113
  - lib/nexmo/errors/authentication_error.rb
@@ -156,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
161
  - !ruby/object:Gem::Version
157
162
  version: '0'
158
163
  requirements: []
159
- rubygems_version: 3.0.1
164
+ rubygems_version: 3.0.3
160
165
  signing_key:
161
166
  specification_version: 4
162
167
  summary: This is the Ruby client library for Nexmo's API. To use it you'll need a