ruby-bandwidth-iris 2.7.2 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -7
- data/lib/bandwidth-iris/client.rb +0 -20
- data/lib/bandwidth-iris/dlda.rb +1 -1
- data/lib/bandwidth-iris/version.rb +1 -1
- data/ruby-bandwidth-iris.gemspec +0 -1
- data/spec/bandwidth-iris/client_spec.rb +0 -35
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6eb0be263ea4f9801165248f8c578e6d85205ef4494711204d587979a8f0bd1
|
4
|
+
data.tar.gz: 96e2af6369e6a319e3be929ace9181a49e488ea98bda0491093285d8895b4416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5728361fdb4eab48bb47928514a32b3dec2d4c38bab3103e4d273ea0a9b429ad0a25eaee5eed4d695f54891987cde64f1dd45c91fea78233d6f9764e5437793d
|
7
|
+
data.tar.gz: 855ef5ba77813675956787b8511dae06f5ed25c72015661a4d52ac6bba612d098758519b54848124a425301fdecde927a0cf8082607fe1feb26dbd7ce05f272d
|
data/README.md
CHANGED
@@ -6,18 +6,46 @@ Ruby Client library for IRIS / BBS API
|
|
6
6
|
|
7
7
|
## Release Notes
|
8
8
|
|
9
|
-
| Release Version | Notes
|
10
|
-
|
11
|
-
| 1.0.5
|
12
|
-
| 2.0.0
|
13
|
-
| 2.0.1
|
14
|
-
| 2.1.0
|
9
|
+
| Release Version | Notes |
|
10
|
+
|--|--|
|
11
|
+
| 1.0.5 | Fixed incorrect generation of XML for a Disconnect request |
|
12
|
+
| 2.0.0 | Added `importTnOrders`, `removeImportedTnOrders`, `inserviceNumbers`, and `importTnChecker` endpoints. This release also changed the response body of `BandwidthIris::InServiceNumber.list()`. Please make sure to update your code to include this change. |
|
13
|
+
| 2.0.1 | Updated gem dependencies to be less restrictive |
|
14
|
+
| 2.1.0 | Added `csrs` endpoints |
|
15
|
+
| 2.2.0 | Added `loas` endpoints to `importTnOrders` |
|
15
16
|
| 2.2.0 | Added `loas` endpoints to `importTnOrders` |
|
16
17
|
| 2.3.0 | Added `get_tns_by_order_id` to the Orders class |
|
17
18
|
| 2.4.0.pre | Added application management and sippeer products endpoints |
|
18
19
|
| 2.5.0 | Added `get_order_response` to pull full `<OrderResponse>` object from API, added `id` back to order object on get requests. Fixed TN Reservation and updated tests to match reality |
|
19
20
|
| 2.6.0 | Added Emergency Calling Notification, Emergeny Notification Group, Emergency Notification Endpoint, and Alternate End User Identity methods |
|
20
21
|
| 2.7.0 | Added TNOptions endpoints |
|
22
|
+
| 3.0.0 | Removed functionality that causes an error to be raised when some type of `error` field is returned in the XML body response. This change reduces the situations that cause an error to be thrown to simply be 4XX and 5XX http responses. This change was made to improve communication when an error is found. Please update your code to handle this change. |
|
23
|
+
| 3.0.2 | Fixed an incorrect retrieval of DLDA objects |
|
24
|
+
| 4.0.0 | Removed certify gem. Users will now need to set their own SSL settings |
|
25
|
+
|
26
|
+
### 3.x.x release
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
failed_import_tn_order = "some_id"
|
30
|
+
begin
|
31
|
+
response = BandwidthIris::ImportTnOrders.get_import_tn_order(failed_import_tn_order)
|
32
|
+
puts response[0]
|
33
|
+
rescue BandwidthIris::Errors::GenericError => e
|
34
|
+
puts e
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
#### 2.x.x result
|
39
|
+
|
40
|
+
```
|
41
|
+
Messaging route of External Third Party TNs is not configured.
|
42
|
+
```
|
43
|
+
|
44
|
+
#### 3.x.x result
|
45
|
+
|
46
|
+
```
|
47
|
+
{:customer_order_id=>"custom_id", :order_create_date=>Mon, 02 Mar 2020 20:56:48 +0000, :account_id=>123, :created_by_user=>"user", :order_id=>"0f2", :last_modified_date=>Mon, 02 Mar 2020 20:56:48 +0000, :site_id=>123, :subscriber=>{:name=>"Company INC", :service_address=>{:house_number=>123, :street_name=>"Street", :city=>"City", :state_code=>"XY", :zip=>12345, :county=>"County", :country=>"Country", :address_type=>"Service"}}, :loa_authorizing_person=>"Person", :telephone_numbers=>{:telephone_number=>"5554443333"}, :processing_status=>"FAILED", :errors=>{:error=>{:code=>19005, :description=>"Messaging route of External Third Party TNs is not configured.", :telephone_numbers=>{:telephone_number=>"5554443333"}}}, :sip_peer_id=>123}
|
48
|
+
```
|
21
49
|
|
22
50
|
## Install
|
23
51
|
|
@@ -433,6 +461,7 @@ BandwidthIris::RateCenter.list(query)
|
|
433
461
|
|
434
462
|
## SIP Peers
|
435
463
|
### Create SIP Peer
|
464
|
+
A Sip Peer is what is called Location in the web UI.
|
436
465
|
```ruby
|
437
466
|
data = {
|
438
467
|
:peer_name => "A New SIP Peer",
|
@@ -495,7 +524,7 @@ sipPeer.move_tns(numbers_to_move)
|
|
495
524
|
## Sites
|
496
525
|
|
497
526
|
### Create A Site
|
498
|
-
A site is what is called
|
527
|
+
A site is what is called Sub-Account in the web UI.
|
499
528
|
```ruby
|
500
529
|
site = {
|
501
530
|
:name =>"A new site",
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'faraday_middleware'
|
3
|
-
require 'certified'
|
4
3
|
require 'active_support/xml_mini'
|
5
4
|
require 'active_support/core_ext/hash/conversions'
|
6
5
|
require 'active_support/core_ext/string/inflections'
|
@@ -120,25 +119,6 @@ module BandwidthIris
|
|
120
119
|
# @param response response object
|
121
120
|
def check_response(response)
|
122
121
|
parsed_body = parse_xml(response.body || '')
|
123
|
-
code = find_first_descendant(parsed_body, :error_code)
|
124
|
-
description = find_first_descendant(parsed_body, :description)
|
125
|
-
unless code
|
126
|
-
error = find_first_descendant(parsed_body, :error)
|
127
|
-
if error
|
128
|
-
code = error[:code]
|
129
|
-
description = error[:description]
|
130
|
-
else
|
131
|
-
errors = find_first_descendant(parsed_body, :errors)
|
132
|
-
if errors == nil || errors.length == 0
|
133
|
-
code = find_first_descendant(parsed_body, :result_code)
|
134
|
-
description = find_first_descendant(parsed_body, :result_message)
|
135
|
-
else
|
136
|
-
errors = [errors] if errors.is_a?(Hash)
|
137
|
-
raise Errors::AgregateError.new(errors.map {|e| Errors::GenericError.new(e[:code], e[:description], response.status)})
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
141
|
-
raise Errors::GenericError.new(code, description, response.status) if code && description && code != '0' && code != 0
|
142
122
|
raise Errors::GenericError.new('', "Http code #{response.status}", response.status) if response.status >= 400
|
143
123
|
parsed_body
|
144
124
|
end
|
data/lib/bandwidth-iris/dlda.rb
CHANGED
@@ -17,7 +17,7 @@ module BandwidthIris
|
|
17
17
|
wrap_client_arg :list
|
18
18
|
|
19
19
|
def self.get(client, id)
|
20
|
-
data = client.make_request(:get, "#{client.concat_account_path(DLDA_PATH)}/#{id}")[0]
|
20
|
+
data = client.make_request(:get, "#{client.concat_account_path(DLDA_PATH)}/#{id}")[0]
|
21
21
|
data[:id] = data[:order_id]
|
22
22
|
Dlda.new(data, client)
|
23
23
|
end
|
data/ruby-bandwidth-iris.gemspec
CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.add_dependency "faraday_middleware"
|
20
20
|
spec.add_dependency "nori"
|
21
21
|
spec.add_dependency "activesupport",">= 4.2.7"
|
22
|
-
spec.add_dependency "certified"
|
23
22
|
|
24
23
|
spec.add_development_dependency "bundler", ">= 1.3"
|
25
24
|
spec.add_development_dependency "rake", ">= 11.1.0"
|
@@ -86,41 +86,6 @@ describe BandwidthIris::Client do
|
|
86
86
|
client.stubs.get('/v1.0/path1') { |env| [400, {}, ''] }
|
87
87
|
expect{client.make_request(:get, '/path1')}.to raise_error(Errors::GenericError, "Http code 400")
|
88
88
|
end
|
89
|
-
|
90
|
-
it 'should fail if output contains ErrorCode and Description' do
|
91
|
-
client.stubs.get('/v1.0/path1') { |env| [200, {}, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Response><Test><ErrorCode>400</ErrorCode><Description>Error</Description></Test></Response>'] }
|
92
|
-
expect{client.make_request(:get, '/path1')}.to raise_error(Errors::GenericError, "Error")
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'should fail if output contains element Error with Code and Description' do
|
96
|
-
client.stubs.get('/v1.0/path1') { |env| [200, {}, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Response><Test><Error><Code>400</Code><Description>Error</Description></Error></Test></Response>'] }
|
97
|
-
expect{client.make_request(:get, '/path1')}.to raise_error(Errors::GenericError, "Error")
|
98
|
-
end
|
99
|
-
|
100
|
-
it 'should fail if output contains elements Errors with Code and Description' do
|
101
|
-
client.stubs.get('/v1.0/path1') { |env| [200, {}, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Response><Test><Errors><Code>400</Code><Description>Error</Description></Errors><Errors><Code>401</Code><Description>Error1</Description></Errors></Test></Response>'] }
|
102
|
-
expect{client.make_request(:get, '/path1')}.to raise_error(Errors::AgregateError)
|
103
|
-
end
|
104
|
-
|
105
|
-
it 'should fail if output contains elements Errors with Code and Description (for 1 element)' do
|
106
|
-
client.stubs.get('/v1.0/path1') { |env| [200, {}, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Response><Test><Errors><Code>400</Code><Description>Error</Description></Errors></Test></Response>'] }
|
107
|
-
expect{client.make_request(:get, '/path1')}.to raise_error(Errors::AgregateError)
|
108
|
-
end
|
109
|
-
|
110
|
-
it 'should fail if output contains elements resultCode and resultMessage' do
|
111
|
-
client.stubs.get('/v1.0/path1') { |env| [200, {}, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Response><Test><resultCode>400</resultCode><resultMessage>Error</resultMessage></Test></Response>'] }
|
112
|
-
expect{client.make_request(:get, '/path1')}.to raise_error(Errors::GenericError, "Error")
|
113
|
-
end
|
114
|
-
|
115
|
-
it 'should fail if output contains elements resultCode and resultMessage (more deep)' do
|
116
|
-
client.stubs.get('/v1.0/path1') { |env| [200, {}, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Response><Tests><Test></Test><Test><resultCode>400</resultCode><resultMessage>Error</resultMessage></Test></Tests></Response>'] }
|
117
|
-
expect{client.make_request(:get, '/path1')}.to raise_error(Errors::GenericError, "Error")
|
118
|
-
end
|
119
|
-
|
120
|
-
it 'should not fail if resultCode == 0' do
|
121
|
-
client.stubs.get('/v1.0/path1') { |env| [200, {}, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Response><Test><resultCode>0</resultCode><resultMessage>Completed</resultMessage></Test></Response>'] }
|
122
|
-
client.make_request(:get, '/path1')
|
123
|
-
end
|
124
89
|
end
|
125
90
|
end
|
126
91
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-bandwidth-iris
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Belchikov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 4.2.7
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: certified
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: bundler
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,7 +123,7 @@ dependencies:
|
|
137
123
|
- !ruby/object:Gem::Version
|
138
124
|
version: '0'
|
139
125
|
description: Gem for integrating to Bandwidth's Iris API
|
140
|
-
email:
|
126
|
+
email:
|
141
127
|
executables: []
|
142
128
|
extensions: []
|
143
129
|
extra_rdoc_files: []
|
@@ -247,7 +233,7 @@ homepage: https://github.com/bandwidthcom/ruby-bandwidth-iris
|
|
247
233
|
licenses:
|
248
234
|
- MIT
|
249
235
|
metadata: {}
|
250
|
-
post_install_message:
|
236
|
+
post_install_message:
|
251
237
|
rdoc_options: []
|
252
238
|
require_paths:
|
253
239
|
- lib
|
@@ -262,8 +248,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
248
|
- !ruby/object:Gem::Version
|
263
249
|
version: '0'
|
264
250
|
requirements: []
|
265
|
-
rubygems_version: 3.
|
266
|
-
signing_key:
|
251
|
+
rubygems_version: 3.2.20
|
252
|
+
signing_key:
|
267
253
|
specification_version: 4
|
268
254
|
summary: Gem for integrating to Bandwidth's Iris API
|
269
255
|
test_files:
|