nexmo 5.7.1 → 5.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bf480b73d9d9a07a03e85d9576aa10c3a206aa6d44c7f19d6068fdb7cc7441f
4
- data.tar.gz: 91911d0eb4a98b2b7d7f90ec9941e7ab873e94696beb44d838400347a2868be0
3
+ metadata.gz: 7a8fa58dc0863e21f46d996987b49b60b6963db2ea256bdc6c9066fb3101b5f4
4
+ data.tar.gz: 7d34456fd79e02c343bd8560672f12f2ce5d20a4d9a62544d3681acc1125c03e
5
5
  SHA512:
6
- metadata.gz: fd56ae91055dac674c5b74bd6b7e486d030148632a91bcf1e4cdffdfe050beb60fdfea035855f883c9b9df45a48b15560a263b77a10c3b5b97edadd15e9b0637
7
- data.tar.gz: 7fc469c70959b675a6d9de2d4ca8ca991deee76c94401136b91a4e66104dfe0a0709228278d0c872ef1b2882e587e3adc150e5586afedff41db7cf8931e925ae
6
+ metadata.gz: 5df6af3604e8d560de92e971e8e120cea313dbf8b174887ae267ad521426af78f9e1b9c294f207978cad193f90c2c439c4207d44a72b2f689a15cdb1fde55c0b
7
+ data.tar.gz: 705e44a45ae5459c9ad7eb973becd2e487d4fce45d19c9fa03d67ce7f454b02d836a8bb692288e19e69c383aa194ac31c9367bc88c5d3a96af3e570dbac2e920
@@ -24,6 +24,7 @@ require 'nexmo/client'
24
24
  require 'nexmo/account'
25
25
  require 'nexmo/alerts'
26
26
  require 'nexmo/applications'
27
+ require 'nexmo/applications_v2'
27
28
  require 'nexmo/call_dtmf'
28
29
  require 'nexmo/call_stream'
29
30
  require 'nexmo/call_talk'
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nexmo
4
+ class ApplicationsV2 < Namespace
5
+ self.authentication = Basic
6
+
7
+ self.request_body = JSON
8
+
9
+ self.request_headers['Content-Type'] = 'application/json'
10
+
11
+ def create(params)
12
+ request('/v2/applications', params: params, type: Post)
13
+ end
14
+
15
+ def list(params = nil)
16
+ request('/v2/applications', params: params)
17
+ end
18
+
19
+ def get(id)
20
+ request('/v2/applications/' + id)
21
+ end
22
+
23
+ def update(id, params)
24
+ request('/v2/applications/' + id, params: params, type: Put)
25
+ end
26
+
27
+ def delete(id)
28
+ request('/v2/applications/' + id, type: Delete)
29
+ end
30
+ end
31
+ end
@@ -125,6 +125,10 @@ module Nexmo
125
125
  @applications ||= Applications.new(self)
126
126
  end
127
127
 
128
+ def applications_v2
129
+ @applications_v2 ||= ApplicationsV2.new(self)
130
+ end
131
+
128
132
  def calls
129
133
  @calls ||= Calls.new(self)
130
134
  end
@@ -41,6 +41,10 @@ module Nexmo
41
41
  @request_body = request_body
42
42
  end
43
43
 
44
+ def self.request_headers
45
+ @request_headers ||= {}
46
+ end
47
+
44
48
  private
45
49
 
46
50
  Get = Net::HTTP::Get
@@ -66,6 +70,10 @@ module Nexmo
66
70
 
67
71
  message['User-Agent'] = @client.user_agent
68
72
 
73
+ self.class.request_headers.each do |key, value|
74
+ message[key] = value
75
+ end
76
+
69
77
  authentication.update(message)
70
78
 
71
79
  self.class.request_body.update(message, params) if type::REQUEST_HAS_BODY
@@ -1,3 +1,3 @@
1
1
  module Nexmo
2
- VERSION = '5.7.1'
2
+ VERSION = '5.8.0'
3
3
  end
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.7.1
4
+ version: 5.8.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-05-16 00:00:00.000000000 Z
11
+ date: 2019-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -93,6 +93,7 @@ files:
93
93
  - lib/nexmo/account.rb
94
94
  - lib/nexmo/alerts.rb
95
95
  - lib/nexmo/applications.rb
96
+ - lib/nexmo/applications_v2.rb
96
97
  - lib/nexmo/authentication/abstract.rb
97
98
  - lib/nexmo/authentication/basic.rb
98
99
  - lib/nexmo/authentication/bearer_token.rb