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 +4 -4
- data/lib/nexmo.rb +1 -0
- data/lib/nexmo/applications_v2.rb +31 -0
- data/lib/nexmo/client.rb +4 -0
- data/lib/nexmo/namespace.rb +8 -0
- data/lib/nexmo/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a8fa58dc0863e21f46d996987b49b60b6963db2ea256bdc6c9066fb3101b5f4
|
4
|
+
data.tar.gz: 7d34456fd79e02c343bd8560672f12f2ce5d20a4d9a62544d3681acc1125c03e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5df6af3604e8d560de92e971e8e120cea313dbf8b174887ae267ad521426af78f9e1b9c294f207978cad193f90c2c439c4207d44a72b2f689a15cdb1fde55c0b
|
7
|
+
data.tar.gz: 705e44a45ae5459c9ad7eb973becd2e487d4fce45d19c9fa03d67ce7f454b02d836a8bb692288e19e69c383aa194ac31c9367bc88c5d3a96af3e570dbac2e920
|
data/lib/nexmo.rb
CHANGED
@@ -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
|
data/lib/nexmo/client.rb
CHANGED
data/lib/nexmo/namespace.rb
CHANGED
@@ -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
|
data/lib/nexmo/version.rb
CHANGED
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.
|
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-
|
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
|