nexmo 6.1.0 → 6.2.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: 991aaf647a8a483780486cdf6ad8393305d9e597aeeda649c404e8ce4ba4f858
4
- data.tar.gz: 5849c75718751dc5b4c6d7fc0c205b224e19a5527ca536176bbd30956a916fda
3
+ metadata.gz: 435a12da7a4fdd6a713aaf4660d5e7ae9e81013e7272df5d0bbbf9b2d5c6c9b8
4
+ data.tar.gz: ed72a0177f94fdc83b592d86d2e7a198023e6b55511984ffe03a1c409d8947c4
5
5
  SHA512:
6
- metadata.gz: 2ad6c409666f784c59656bb55c793ea5e1885c6bee593fb866259edbfecd178b62d89214946ba4ab2bce1c6a36a71f2149a584b8d0781de0978eab2e498a9cbc
7
- data.tar.gz: f91e6bbcbf7de8a41a88411d47c58529b0c204780a25c5f827cac682cfe17e162c33193c86928f6ba39b4cf452f0303c7d75ded9281ddbf41b4cf2892a2f5d0f
6
+ metadata.gz: 662bf6adc6417ffad8ae5612297a1dce42be997a7a95c030c5b0630fdeff278e0bf09a26be88465827c1e7b69d6f0d4823ca9bbde77a79af132cacd7fe2fb998
7
+ data.tar.gz: 0e739f013dc8f4b564a58f90b8aa1bd1ad61920a15825f4ea1b9a38c3b32dbcea3946ee4824eb1e4aae52a3cfbcac654759016c6eef6d32d41a63eaecb238d72
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016-2019 Nexmo Inc
3
+ Copyright (c) 2016-2020 Nexmo Inc
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person
6
6
  obtaining a copy of this software and associated documentation
data/README.md CHANGED
@@ -112,7 +112,9 @@ client = Nexmo::Client.new(token: token)
112
112
  To check webhook signatures you'll also need to specify the `signature_secret` option. For example:
113
113
 
114
114
  ```ruby
115
- client = Nexmo::Client.new(signature_secret: 'secret')
115
+ client = Nexmo::Client.new
116
+ client.config.signature_secret = 'secret'
117
+ client.config.signature_method = 'sha512'
116
118
 
117
119
  if client.signature.check(request.GET)
118
120
  # valid signature
@@ -2,22 +2,18 @@
2
2
  require 'zeitwerk'
3
3
 
4
4
  module Nexmo
5
- class ZeitwerkInflector < Zeitwerk::Inflector
6
- def camelize(basename, _abspath)
7
- case basename
8
- when 'http', 'json', 'jwt', 'sms', 'tfa', 'gsm7', 'dtmf', 'version'
9
- basename.upcase
10
- else
11
- super
12
- end
13
- end
14
- end
15
-
16
- private_constant :ZeitwerkInflector
17
-
18
5
  loader = Zeitwerk::Loader.new
19
6
  loader.tag = File.basename(__FILE__, '.rb')
20
- loader.inflector = ZeitwerkInflector.new
7
+ loader.inflector.inflect({
8
+ 'dtmf' => 'DTMF',
9
+ 'gsm7' => 'GSM7',
10
+ 'http' => 'HTTP',
11
+ 'json' => 'JSON',
12
+ 'jwt' => 'JWT',
13
+ 'sms' => 'SMS',
14
+ 'tfa' => 'TFA',
15
+ 'version' => 'VERSION',
16
+ })
21
17
  loader.push_dir(__dir__)
22
18
  loader.setup
23
19
 
@@ -2,8 +2,8 @@ module Nexmo
2
2
  class Entity
3
3
  include Keys
4
4
 
5
- def initialize(**kwargs)
6
- @attributes = kwargs
5
+ def initialize(attributes = nil)
6
+ @attributes = attributes || {}
7
7
  end
8
8
 
9
9
  def [](key)
@@ -14,11 +14,16 @@ module Nexmo
14
14
  # puts "#{item.msisdn} #{item.country} #{item.type}"
15
15
  # end
16
16
  #
17
- # @option params [Integer] :index
18
- # Page index.
17
+ # @option params [String] :application_id
18
+ # The application that you want to return the numbers for.
19
19
  #
20
- # @option params [Integer] :size
21
- # Page size.
20
+ # @option params [Boolean] :has_application
21
+ # Set this optional field to `true` to restrict your results to numbers associated with an application (any application).
22
+ # Set to `false` to find all numbers not associated with any application.
23
+ # Omit the field to avoid filtering on whether or not the number is assigned to an application.
24
+ #
25
+ # @option params [String] :country
26
+ # The two character country code to filter on (in ISO 3166-1 alpha-2 format).
22
27
  #
23
28
  # @option params [String] :pattern
24
29
  # The number pattern you want to search for. Use in conjunction with **:search_pattern**.
@@ -29,13 +34,11 @@ module Nexmo
29
34
  # - `1` - Search for numbers that contain **:pattern**
30
35
  # - `2` - Search for numbers that end with **:pattern**
31
36
  #
32
- # @option params [Boolean] :has_application
33
- # Set this optional field to `true` to restrict your results to numbers associated with an application (any application).
34
- # Set to `false` to find all numbers not associated with any application.
35
- # Omit the field to avoid filtering on whether or not the number is assigned to an application.
37
+ # @option params [Integer] :size
38
+ # Page size.
36
39
  #
37
- # @option params [String] :application_id
38
- # The application that you want to return the numbers for.
40
+ # @option params [Integer] :index
41
+ # Page index.
39
42
  #
40
43
  # @param [Hash] params
41
44
  #
@@ -102,6 +105,10 @@ module Nexmo
102
105
  # @option params [required, String] :msisdn
103
106
  # An available inbound virtual number.
104
107
  #
108
+ # @option params [String] :target_api_key
109
+ # If you'd like to perform an action on a subaccount, provide the `api_key` of that account here.
110
+ # If you'd like to perform an action on your own account, you do not need to provide this field.
111
+ #
105
112
  # @param [Hash] params
106
113
  #
107
114
  # @return [Response]
@@ -123,6 +130,10 @@ module Nexmo
123
130
  # @option params [required, String] :msisdn
124
131
  # An available inbound virtual number.
125
132
  #
133
+ # @option params [String] :target_api_key
134
+ # If you'd like to perform an action on a subaccount, provide the `api_key` of that account here.
135
+ # If you'd like to perform an action on your own account, you do not need to provide this field.
136
+ #
126
137
  # @param [Hash] params
127
138
  #
128
139
  # @return [Response]
@@ -160,16 +171,8 @@ module Nexmo
160
171
  # @option params [String] :mo_smpp_sys_type
161
172
  # The associated system type for your SMPP client.
162
173
  #
163
- # @option params [String] :messages_callback_type
164
- # The SMS webhook type (always `app`).
165
- # Must be used with the **:messages_callback_value** option.
166
- #
167
- # @option params [String] :messages_callback_value
168
- # A Nexmo Application ID.
169
- # Must be used with the **:messages_callback_type** option.
170
- #
171
174
  # @option params [String] :voice_callback_type
172
- # The voice webhook type.
175
+ # Specify whether inbound voice calls on your number are handled by your Application configuration, or forwarded to a SIP or a telephone number.
173
176
  # Must be used with the **:voice_callback_value** option.
174
177
  #
175
178
  # @option params [String] :voice_callback_value
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Nexmo
4
4
  class Redact < Namespace
5
- self.authentication = KeySecretQuery
5
+ self.authentication = Basic
6
6
 
7
7
  self.request_body = JSON
8
8
 
@@ -1,3 +1,3 @@
1
1
  module Nexmo
2
- VERSION = '6.1.0'
2
+ VERSION = '6.2.0'
3
3
  end
@@ -13,13 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir.glob('lib/**/*.rb') + %w(LICENSE.txt README.md nexmo.gemspec)
14
14
  s.required_ruby_version = '>= 2.5.0'
15
15
  s.add_dependency('jwt', '~> 2')
16
- s.add_dependency('zeitwerk', '~> 2')
17
- s.add_development_dependency('rake', '~> 13')
18
- s.add_development_dependency('yard', '~> 0.9')
19
- s.add_development_dependency('minitest', '~> 5.0')
20
- s.add_development_dependency('webmock', '~> 3.0')
21
- s.add_development_dependency('simplecov', '~> 0.16')
22
- s.add_development_dependency('coveralls', '~> 0.8.15')
16
+ s.add_dependency('zeitwerk', '~> 2', '>= 2.2')
23
17
  s.require_path = 'lib'
24
18
  s.metadata = {
25
19
  'homepage' => 'https://github.com/Nexmo/nexmo-ruby',
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: 6.1.0
4
+ version: 6.2.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-18 00:00:00.000000000 Z
11
+ date: 2020-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '2.2'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,90 +41,9 @@ dependencies:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
43
  version: '2'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '13'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '13'
55
- - !ruby/object:Gem::Dependency
56
- name: yard
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.9'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0.9'
69
- - !ruby/object:Gem::Dependency
70
- name: minitest
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '5.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '5.0'
83
- - !ruby/object:Gem::Dependency
84
- name: webmock
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '3.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '3.0'
97
- - !ruby/object:Gem::Dependency
98
- name: simplecov
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '0.16'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '0.16'
111
- - !ruby/object:Gem::Dependency
112
- name: coveralls
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: 0.8.15
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
44
+ - - ">="
123
45
  - !ruby/object:Gem::Version
124
- version: 0.8.15
46
+ version: '2.2'
125
47
  description: Nexmo Client Library for Ruby
126
48
  email:
127
49
  - devrel@nexmo.com
@@ -164,7 +86,6 @@ files:
164
86
  - lib/nexmo/json.rb
165
87
  - lib/nexmo/jwt.rb
166
88
  - lib/nexmo/key_secret_params.rb
167
- - lib/nexmo/key_secret_query.rb
168
89
  - lib/nexmo/keys.rb
169
90
  - lib/nexmo/logger.rb
170
91
  - lib/nexmo/messages.rb
@@ -215,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
136
  - !ruby/object:Gem::Version
216
137
  version: '0'
217
138
  requirements: []
218
- rubygems_version: 3.0.3
139
+ rubygems_version: 3.1.2
219
140
  signing_key:
220
141
  specification_version: 4
221
142
  summary: This is the Ruby client library for Nexmo's API. To use it you'll need a
@@ -1,20 +0,0 @@
1
- module Nexmo
2
- class KeySecretQuery < AbstractAuthentication
3
- def update(object)
4
- return unless object.is_a?(URI)
5
-
6
- object.query = Params.join(object.query, params)
7
- end
8
-
9
- private
10
-
11
- def params
12
- {
13
- api_key: @config.api_key,
14
- api_secret: @config.api_secret
15
- }
16
- end
17
- end
18
-
19
- private_constant :KeySecretQuery
20
- end