nexmo 5.9.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -465
  3. data/lib/nexmo.rb +31 -48
  4. data/lib/nexmo/{authentication/abstract.rb → abstract_authentication.rb} +2 -2
  5. data/lib/nexmo/account.rb +4 -2
  6. data/lib/nexmo/alerts.rb +3 -3
  7. data/lib/nexmo/applications.rb +45 -63
  8. data/lib/nexmo/applications/list_response.rb +9 -0
  9. data/lib/nexmo/{errors/authentication_error.rb → authentication_error.rb} +0 -0
  10. data/lib/nexmo/{authentication/basic.rb → basic.rb} +1 -1
  11. data/lib/nexmo/{authentication/bearer_token.rb → bearer_token.rb} +1 -1
  12. data/lib/nexmo/calls.rb +18 -18
  13. data/lib/nexmo/{call_dtmf.rb → calls/dtmf.rb} +2 -2
  14. data/lib/nexmo/calls/list_response.rb +9 -0
  15. data/lib/nexmo/{call_stream.rb → calls/stream.rb} +3 -3
  16. data/lib/nexmo/{call_talk.rb → calls/talk.rb} +3 -3
  17. data/lib/nexmo/client.rb +20 -169
  18. data/lib/nexmo/{errors/client_error.rb → client_error.rb} +0 -0
  19. data/lib/nexmo/config.rb +165 -0
  20. data/lib/nexmo/conversations.rb +44 -13
  21. data/lib/nexmo/{conversation_events.rb → conversations/events.rb} +5 -5
  22. data/lib/nexmo/{conversation_legs.rb → conversations/legs.rb} +3 -3
  23. data/lib/nexmo/{conversation_members.rb → conversations/members.rb} +6 -6
  24. data/lib/nexmo/{conversation_users.rb → conversations/users.rb} +6 -6
  25. data/lib/nexmo/entity.rb +14 -0
  26. data/lib/nexmo/{errors/error.rb → error.rb} +0 -0
  27. data/lib/nexmo/files.rb +1 -2
  28. data/lib/nexmo/gsm7.rb +13 -0
  29. data/lib/nexmo/{authentication/key_secret_params.rb → key_secret_params.rb} +2 -2
  30. data/lib/nexmo/{authentication/key_secret_query.rb → key_secret_query.rb} +2 -2
  31. data/lib/nexmo/keys.rb +4 -22
  32. data/lib/nexmo/namespace.rb +22 -12
  33. data/lib/nexmo/number_insight.rb +6 -4
  34. data/lib/nexmo/number_insight/response.rb +5 -0
  35. data/lib/nexmo/numbers.rb +20 -12
  36. data/lib/nexmo/numbers/list_response.rb +9 -0
  37. data/lib/nexmo/numbers/response.rb +7 -0
  38. data/lib/nexmo/pricing.rb +2 -2
  39. data/lib/nexmo/pricing_types.rb +4 -4
  40. data/lib/nexmo/redact.rb +1 -1
  41. data/lib/nexmo/response.rb +23 -0
  42. data/lib/nexmo/secrets.rb +7 -7
  43. data/lib/nexmo/secrets/list_response.rb +9 -0
  44. data/lib/nexmo/{errors/server_error.rb → server_error.rb} +0 -0
  45. data/lib/nexmo/sms.rb +17 -3
  46. data/lib/nexmo/sms/response.rb +7 -0
  47. data/lib/nexmo/verify.rb +10 -8
  48. data/lib/nexmo/verify/response.rb +5 -0
  49. data/lib/nexmo/version.rb +1 -1
  50. data/nexmo.gemspec +4 -2
  51. metadata +45 -20
  52. data/lib/nexmo/applications_v2.rb +0 -102
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.9.0
4
+ version: 6.0.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-07-17 00:00:00.000000000 Z
11
+ date: 2019-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: zeitwerk
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -118,53 +132,63 @@ files:
118
132
  - LICENSE.txt
119
133
  - README.md
120
134
  - lib/nexmo.rb
135
+ - lib/nexmo/abstract_authentication.rb
121
136
  - lib/nexmo/account.rb
122
137
  - lib/nexmo/alerts.rb
123
138
  - lib/nexmo/applications.rb
124
- - lib/nexmo/applications_v2.rb
125
- - lib/nexmo/authentication/abstract.rb
126
- - lib/nexmo/authentication/basic.rb
127
- - lib/nexmo/authentication/bearer_token.rb
128
- - lib/nexmo/authentication/key_secret_params.rb
129
- - lib/nexmo/authentication/key_secret_query.rb
130
- - lib/nexmo/call_dtmf.rb
131
- - lib/nexmo/call_stream.rb
132
- - lib/nexmo/call_talk.rb
139
+ - lib/nexmo/applications/list_response.rb
140
+ - lib/nexmo/authentication_error.rb
141
+ - lib/nexmo/basic.rb
142
+ - lib/nexmo/bearer_token.rb
133
143
  - lib/nexmo/calls.rb
144
+ - lib/nexmo/calls/dtmf.rb
145
+ - lib/nexmo/calls/list_response.rb
146
+ - lib/nexmo/calls/stream.rb
147
+ - lib/nexmo/calls/talk.rb
134
148
  - lib/nexmo/client.rb
135
- - lib/nexmo/conversation_events.rb
136
- - lib/nexmo/conversation_legs.rb
137
- - lib/nexmo/conversation_members.rb
138
- - lib/nexmo/conversation_users.rb
149
+ - lib/nexmo/client_error.rb
150
+ - lib/nexmo/config.rb
139
151
  - lib/nexmo/conversations.rb
152
+ - lib/nexmo/conversations/events.rb
153
+ - lib/nexmo/conversations/legs.rb
154
+ - lib/nexmo/conversations/members.rb
155
+ - lib/nexmo/conversations/users.rb
140
156
  - lib/nexmo/conversions.rb
141
157
  - lib/nexmo/entity.rb
158
+ - lib/nexmo/error.rb
142
159
  - lib/nexmo/errors.rb
143
- - lib/nexmo/errors/authentication_error.rb
144
- - lib/nexmo/errors/client_error.rb
145
- - lib/nexmo/errors/error.rb
146
- - lib/nexmo/errors/server_error.rb
147
160
  - lib/nexmo/files.rb
148
161
  - lib/nexmo/form_data.rb
162
+ - lib/nexmo/gsm7.rb
149
163
  - lib/nexmo/http.rb
150
164
  - lib/nexmo/json.rb
151
165
  - lib/nexmo/jwt.rb
166
+ - lib/nexmo/key_secret_params.rb
167
+ - lib/nexmo/key_secret_query.rb
152
168
  - lib/nexmo/keys.rb
153
169
  - lib/nexmo/logger.rb
154
170
  - lib/nexmo/messages.rb
155
171
  - lib/nexmo/namespace.rb
156
172
  - lib/nexmo/number_insight.rb
173
+ - lib/nexmo/number_insight/response.rb
157
174
  - lib/nexmo/numbers.rb
175
+ - lib/nexmo/numbers/list_response.rb
176
+ - lib/nexmo/numbers/response.rb
158
177
  - lib/nexmo/params.rb
159
178
  - lib/nexmo/pricing.rb
160
179
  - lib/nexmo/pricing_types.rb
161
180
  - lib/nexmo/redact.rb
181
+ - lib/nexmo/response.rb
162
182
  - lib/nexmo/secrets.rb
183
+ - lib/nexmo/secrets/list_response.rb
184
+ - lib/nexmo/server_error.rb
163
185
  - lib/nexmo/signature.rb
164
186
  - lib/nexmo/sms.rb
187
+ - lib/nexmo/sms/response.rb
165
188
  - lib/nexmo/tfa.rb
166
189
  - lib/nexmo/user_agent.rb
167
190
  - lib/nexmo/verify.rb
191
+ - lib/nexmo/verify/response.rb
168
192
  - lib/nexmo/version.rb
169
193
  - nexmo.gemspec
170
194
  homepage: https://github.com/Nexmo/nexmo-ruby
@@ -175,6 +199,7 @@ metadata:
175
199
  source_code_uri: https://github.com/Nexmo/nexmo-ruby
176
200
  bug_tracker_uri: https://github.com/Nexmo/nexmo-ruby/issues
177
201
  changelog_uri: https://github.com/Nexmo/nexmo-ruby/blob/master/CHANGES.md
202
+ documentation_uri: https://www.rubydoc.info/github/nexmo/nexmo-ruby
178
203
  post_install_message:
179
204
  rdoc_options: []
180
205
  require_paths:
@@ -183,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
208
  requirements:
184
209
  - - ">="
185
210
  - !ruby/object:Gem::Version
186
- version: 2.1.0
211
+ version: 2.5.0
187
212
  required_rubygems_version: !ruby/object:Gem::Requirement
188
213
  requirements:
189
214
  - - ">="
@@ -1,102 +0,0 @@
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
- # Create an application.
12
- #
13
- # @option params [required, String] :name
14
- # Application name.
15
- #
16
- # @option params [Hash] :keys
17
- # - **:public_key** (String) Public key
18
- #
19
- # @option params [Hash] :capabilities
20
- # Your application can use multiple products.
21
- # This contains the configuration for each product.
22
- # This replaces the application `type` from version 1 of the Application API.
23
- #
24
- # @param [Hash] params
25
- #
26
- # @return [Entity]
27
- #
28
- # @see https://developer.nexmo.com/api/application.v2#createApplication
29
- #
30
- def create(params)
31
- request('/v2/applications', params: params, type: Post)
32
- end
33
-
34
- # List available applications.
35
- #
36
- # @option params [Integer] :page_size
37
- # The number of applications per page.
38
- #
39
- # @option params [Integer] :page
40
- # The current page number (starts at 1).
41
- #
42
- # @param [Hash] params
43
- #
44
- # @return [Entity]
45
- #
46
- # @see https://developer.nexmo.com/api/application.v2#listApplication
47
- #
48
- def list(params = nil)
49
- request('/v2/applications', params: params)
50
- end
51
-
52
- # Get an application.
53
- #
54
- # @param [String] id
55
- #
56
- # @return [Entity]
57
- #
58
- # @see https://developer.nexmo.com/api/application.v2#getApplication
59
- #
60
- def get(id)
61
- request('/v2/applications/' + id)
62
- end
63
-
64
- # Update an application.
65
- #
66
- # @option params [required, String] :name
67
- # Application name.
68
- #
69
- # @option params [Hash] :keys
70
- # - **:public_key** (String) Public key
71
- #
72
- # @option params [Hash] :capabilities
73
- # Your application can use multiple products.
74
- # This contains the configuration for each product.
75
- # This replaces the application `type` from version 1 of the Application API.
76
- #
77
- # @param [String] id
78
- # @param [Hash] params
79
- #
80
- # @return [Entity]
81
- #
82
- # @see https://developer.nexmo.com/api/application.v2#updateApplication
83
- #
84
- def update(id, params)
85
- request('/v2/applications/' + id, params: params, type: Put)
86
- end
87
-
88
- # Delete an application.
89
- #
90
- # @note Deleting an application cannot be undone.
91
- #
92
- # @param [String] id
93
- #
94
- # @return [Entity]
95
- #
96
- # @see https://developer.nexmo.com/api/application.v2#deleteApplication
97
- #
98
- def delete(id)
99
- request('/v2/applications/' + id, type: Delete)
100
- end
101
- end
102
- end