ruby-bandwidth-iris 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +0 -0
  3. data/.gitignore +0 -0
  4. data/.rspec +0 -0
  5. data/.travis.yml +0 -1
  6. data/Gemfile +0 -0
  7. data/LICENSE.txt +0 -0
  8. data/README.md +0 -0
  9. data/Rakefile +0 -0
  10. data/examples/account.rb +0 -0
  11. data/examples/available_npa_nxx.rb +0 -0
  12. data/examples/available_number.rb +0 -0
  13. data/examples/available_number_details.rb +15 -0
  14. data/examples/city.rb +0 -0
  15. data/examples/config.yml.example +0 -0
  16. data/examples/covered-rate-center.rb +0 -0
  17. data/examples/loa.pdf +0 -0
  18. data/examples/order.rb +0 -0
  19. data/examples/port-in.rb +0 -0
  20. data/examples/sip_peer.rb +0 -0
  21. data/examples/site.rb +0 -0
  22. data/examples/tn.rb +0 -0
  23. data/lib/bandwidth-iris/account.rb +0 -0
  24. data/lib/bandwidth-iris/api_item.rb +0 -0
  25. data/lib/bandwidth-iris/available_npa_nxx.rb +0 -0
  26. data/lib/bandwidth-iris/available_number.rb +3 -1
  27. data/lib/bandwidth-iris/city.rb +0 -0
  28. data/lib/bandwidth-iris/client.rb +0 -0
  29. data/lib/bandwidth-iris/client_wrapper.rb +0 -0
  30. data/lib/bandwidth-iris/covered_rate_center.rb +0 -0
  31. data/lib/bandwidth-iris/disc_number.rb +0 -0
  32. data/lib/bandwidth-iris/disconnect.rb +0 -0
  33. data/lib/bandwidth-iris/dlda.rb +0 -0
  34. data/lib/bandwidth-iris/errors.rb +0 -0
  35. data/lib/bandwidth-iris/import_to_account.rb +0 -0
  36. data/lib/bandwidth-iris/in_service_number.rb +0 -0
  37. data/lib/bandwidth-iris/lidb.rb +0 -0
  38. data/lib/bandwidth-iris/lnp_checker.rb +0 -0
  39. data/lib/bandwidth-iris/lsr_order.rb +0 -0
  40. data/lib/bandwidth-iris/order.rb +0 -0
  41. data/lib/bandwidth-iris/port_in.rb +0 -0
  42. data/lib/bandwidth-iris/port_out.rb +0 -0
  43. data/lib/bandwidth-iris/rate_center.rb +0 -0
  44. data/lib/bandwidth-iris/sip_peer.rb +0 -0
  45. data/lib/bandwidth-iris/site.rb +0 -0
  46. data/lib/bandwidth-iris/subscription.rb +0 -0
  47. data/lib/bandwidth-iris/tn.rb +0 -0
  48. data/lib/bandwidth-iris/tn_reservation.rb +0 -0
  49. data/lib/bandwidth-iris/user.rb +0 -0
  50. data/lib/bandwidth-iris/version.rb +1 -1
  51. data/lib/ruby-bandwidth-iris.rb +0 -0
  52. data/ruby-bandwidth-iris.gemspec +0 -0
  53. data/spec/bandwidth-iris/account_spec.rb +0 -0
  54. data/spec/bandwidth-iris/available_npa_nxx_spec.rb +0 -0
  55. data/spec/bandwidth-iris/available_number_spec.rb +8 -0
  56. data/spec/bandwidth-iris/city_spec.rb +0 -0
  57. data/spec/bandwidth-iris/client_spec.rb +0 -0
  58. data/spec/bandwidth-iris/covered_rate_center_spec.rb +0 -0
  59. data/spec/bandwidth-iris/disc_number_spec.rb +0 -0
  60. data/spec/bandwidth-iris/disconnect_spec.rb +0 -0
  61. data/spec/bandwidth-iris/dlda_spec.rb +0 -0
  62. data/spec/bandwidth-iris/import_to_account_spec.rb +0 -0
  63. data/spec/bandwidth-iris/in_service_number_spec.rb +0 -0
  64. data/spec/bandwidth-iris/lidb_spec.rb +0 -0
  65. data/spec/bandwidth-iris/lnp_checker_spec.rb +0 -0
  66. data/spec/bandwidth-iris/lsr_order_spec.rb +0 -0
  67. data/spec/bandwidth-iris/order_spec.rb +0 -0
  68. data/spec/bandwidth-iris/port_in_spec.rb +0 -0
  69. data/spec/bandwidth-iris/port_out_spec.rb +0 -0
  70. data/spec/bandwidth-iris/rate_center_spec.rb +0 -0
  71. data/spec/bandwidth-iris/sip_peer_spec.rb +0 -0
  72. data/spec/bandwidth-iris/site_spec.rb +0 -0
  73. data/spec/bandwidth-iris/subscription_spec.rb +0 -0
  74. data/spec/bandwidth-iris/tn_reservation_spec.rb +0 -0
  75. data/spec/bandwidth-iris/tn_spec.rb +0 -0
  76. data/spec/bandwidth-iris/user_spec.rb +0 -0
  77. data/spec/helper.rb +0 -0
  78. data/spec/xml.yml +1 -0
  79. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8038f21dfe1331b61d10b6e9269213dd79e46009
4
- data.tar.gz: 44968f75ec155cab8d5971fb13cabb4e18ab8c58
3
+ metadata.gz: '048cc1df999897afa6afac04397a85d74cf0cee4'
4
+ data.tar.gz: 4b81f43bbdb9860072ad5fccd7f67dbe4079e4b3
5
5
  SHA512:
6
- metadata.gz: dcb866dfd5f1c8ced1f121b995defbf7e394cdfa27a4e087f1da1aa09154123b4aad468e90e7247878117784d68f4c13bbc218956b93479cde9e7e2352f540d2
7
- data.tar.gz: bff2d1b1b8823d33d53ee0b44a0b14501307a2560627f18935adcfbb7bcaf706ec5e32a393980741ba7b7ad7b142a0d43e1669f85de21c8901067db04ea5894f
6
+ metadata.gz: 9f6ce08ff0b9bd63efb6f6ccdbf92825e92ca66eb56489ffc1f2bcb2cbf4124d3ef6d6cee044a224a1d4baef762ec981c53719453fccdfdeae3b1b00f80283d2
7
+ data.tar.gz: 485f4b27477730114069bc1cd653f5737e7366a9e16b73ec3f6ddfa7c0fa54627c731a21ec850f47bbe2db6286718ce928ae5d2cc947a707e1db9c9e5ef33951
data/.editorconfig CHANGED
File without changes
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
data/.travis.yml CHANGED
@@ -5,4 +5,3 @@ rvm:
5
5
  - '2.1.0'
6
6
  - '2.2.0'
7
7
  - '2.3.0'
8
-
data/Gemfile CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
data/examples/account.rb CHANGED
File without changes
File without changes
File without changes
@@ -0,0 +1,15 @@
1
+ lib = File.expand_path('../../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require 'yaml'
5
+ require 'ruby-bandwidth-iris'
6
+ config = YAML.load_file('config.yml')
7
+
8
+ BandwidthIris::Client.global_options = {
9
+ :api_endpoint => config['api_endpoint'],
10
+ :user_name => config['user_name'],
11
+ :password => config['password'],
12
+ :account_id => config['account_id']
13
+ }
14
+
15
+ puts BandwidthIris::AvailableNumber.list({:state => "NC", :quantity => 3, :enable_t_n_detail => true})
data/examples/city.rb CHANGED
File without changes
File without changes
File without changes
data/examples/loa.pdf CHANGED
File without changes
data/examples/order.rb CHANGED
File without changes
data/examples/port-in.rb CHANGED
File without changes
data/examples/sip_peer.rb CHANGED
File without changes
data/examples/site.rb CHANGED
File without changes
data/examples/tn.rb CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -5,7 +5,9 @@ module BandwidthIris
5
5
  extend ClientWrapper
6
6
 
7
7
  def self.list(client, query)
8
- list = client.make_request(:get, client.concat_account_path(AVAILABLE_NUMBER_PATH), query)[0][:telephone_number_list][:telephone_number]
8
+ response = client.make_request(:get, client.concat_account_path(AVAILABLE_NUMBER_PATH), query)
9
+ list = response[0] && response[0][:telephone_number_list] && response[0][:telephone_number_list][:telephone_number]
10
+ list ||= response[0] && response[0][:telephone_number_detail_list] && response[0][:telephone_number_detail_list][:telephone_number_detail]
9
11
  return [] if !list
10
12
  if list.is_a?(Array) then list else [list] end
11
13
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
1
  module BandwidthIris
2
2
  # Version of this gem
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
File without changes
File without changes
File without changes
File without changes
@@ -14,6 +14,14 @@ describe BandwidthIris::AvailableNumber do
14
14
  client.stubs.get('/v1.0/accounts/accountId/availableNumbers?areaCode=866&quantity=5') {|env| [200, {}, Helper.xml['available_numbers']]}
15
15
  expect(AvailableNumber.list(client, {:area_code => 866, :quantity => 5}).length).to eql(2)
16
16
  end
17
+
18
+ it 'should return number details' do
19
+ client.stubs.get('/v1.0/accounts/accountId/availableNumbers?areaCode=201&quantity=5&enableTNDetail=true') {|env| [200, {}, Helper.xml['available_number_details']]}
20
+ expect(AvailableNumber.list(client, {:area_code => 201, :quantity => 5, :enable_t_n_detail => true}).length).to eql(5)
21
+ expect(AvailableNumber.list(client, {:area_code => 201, :quantity => 5, :enable_t_n_detail => true})[0]).to be_a(Hash)
22
+ expect(AvailableNumber.list(client, {:area_code => 201, :quantity => 5, 'enableTNDetail' => true}).length).to eql(5)
23
+ expect(AvailableNumber.list(client, {:area_code => 201, :quantity => 5, 'enableTNDetail' => true})[0]).to be_a(Hash)
24
+ end
17
25
  end
18
26
 
19
27
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/spec/helper.rb CHANGED
File without changes
data/spec/xml.yml CHANGED
@@ -32,6 +32,7 @@
32
32
  lnp_check: "<?xml version=\"1.0\" encoding=\"utf-8\"?><NumberPortabilityResponse><SupportedRateCenters><RateCenterGroup><RateCenter>Center1</RateCenter><City>City1</City><State>State1</State><LATA>11</LATA><Tiers><Tier>111</Tier><Tier>222</Tier><Tier>333</Tier></Tiers><TnList><Tn>1111</Tn><Tn>2222</Tn><Tn>3333</Tn></TnList></RateCenterGroup></SupportedRateCenters><UnsupportedRateCenters/></NumberPortabilityResponse>"
33
33
  cities: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><CityResponse><ResultCount>2</ResultCount><Cities><City><RcAbbreviation>SOUTHEPINS</RcAbbreviation><Name>ABERDEEN</Name></City><City><RcAbbreviation>JULIAN</RcAbbreviation><Name>ADVANCE</Name></City></Cities></CityResponse>"
34
34
  available_numbers: "<SearchResult><ResultCount>2</ResultCount><TelephoneNumberList><TelephoneNumber><City>JERSEY CITY</City><LATA>224</LATA><RateCenter>JERSEYCITY</RateCenter><State>NJ</State>></TelephoneNumber><TelephoneNumber><City>JERSEY CITY</City><LATA>224</LATA><RateCenter>JERSEYCITY</RateCenter><State>NJ</State></TelephoneNumber></TelephoneNumberList></SearchResult>"
35
+ available_number_details: "<SearchResult><ResultCount>5</ResultCount><TelephoneNumberDetailList><TelephoneNumberDetail><City>RIDGEWOOD</City><LATA>224</LATA><RateCenter>RIDGEWOOD</RateCenter><State>NJ</State><FullNumber>2013458710</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName></TelephoneNumberDetail><TelephoneNumberDetail><City>ORADELL</City><LATA>224</LATA><RateCenter>ORADELL</RateCenter><State>NJ</State><FullNumber>2013508574</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName></TelephoneNumberDetail><TelephoneNumberDetail><City>ORADELL</City><LATA>224</LATA><RateCenter>ORADELL</RateCenter><State>NJ</State><FullNumber>2013508149</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName></TelephoneNumberDetail><TelephoneNumberDetail><City>ORADELL</City><LATA>224</LATA><RateCenter>ORADELL</RateCenter><State>NJ</State><FullNumber>2013508183</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName></TelephoneNumberDetail><TelephoneNumberDetail><City>ORADELL</City><LATA>224</LATA><RateCenter>ORADELL</RateCenter><State>NJ</State><FullNumber>2013508213</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName></TelephoneNumberDetail></TelephoneNumberDetailList></SearchResult>"
35
36
  available_npa_nxx: "<?xml version=\"1.0\" encoding=\"utf-8\"?><SearchResultForAvailableNpaNxx><AvailableNpaNxxList><AvailableNpaNxx><City>City1</City><State>State1</State><Npa>Npa1</Npa><Nxx>Nxx1</Nxx><Quantity>10</Quantity></AvailableNpaNxx><AvailableNpaNxx><City>City2</City><State>State2</State><Npa>Npa2</Npa><Nxx>Nxx2</Nxx><Quantity>20</Quantity></AvailableNpaNxx></AvailableNpaNxxList></SearchResultForAvailableNpaNxx>"
36
37
  users: "<?xml version=\"1.0\"?><UsersResponse><Users><User><Username>testcustomer</Username><FirstName>Jane</FirstName><LastName>Doe</LastName><EmailAddress>janedoe@bandwidth.com</EmailAddress><TelephoneNumber>9199999999</TelephoneNumber></User><User><Username>johndoe</Username><FirstName>John</FirstName><LastName>Doe</LastName><EmailAddress>johndoe@bandwidth.com</EmailAddress><TelephoneNumber>9199999998</TelephoneNumber></User></Users></UsersResponse>"
37
38
  dldas: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><ResponseSelectWrapper><ListOrderIdUserIdDate><TotalCount>3</TotalCount><OrderIdUserIdDate><accountId>14</accountId><CountOfTNs>2</CountOfTNs><userId>team_ua</userId><lastModifiedDate>2014-07-07T10:06:43.427Z</lastModifiedDate><OrderType>dlda</OrderType><OrderDate>2014-07-07T10:06:43.427Z</OrderDate><orderId>37a6447c-1a0b-4be9-ba89-3f5cb0aea142</orderId><OrderStatus>FAILED</OrderStatus></OrderIdUserIdDate><OrderIdUserIdDate><accountId>14</accountId><CountOfTNs>2</CountOfTNs><userId>team_ua</userId><lastModifiedDate>2014-07-07T10:05:56.595Z</lastModifiedDate><OrderType>dlda</OrderType><OrderDate>2014-07-07T10:05:56.595Z</OrderDate><orderId>743b0e64-3350-42e4-baa6-406dac7f4a85</orderId><OrderStatus>RECEIVED</OrderStatus></OrderIdUserIdDate><OrderIdUserIdDate><accountId>14</accountId><CountOfTNs>2</CountOfTNs><userId>team_ua</userId><lastModifiedDate>2014-07-07T09:32:17.234Z</lastModifiedDate><OrderType>dlda</OrderType><OrderDate>2014-07-07T09:32:17.234Z</OrderDate><orderId>f71eb4d2-bfef-4384-957f-45cd6321185e</orderId><OrderStatus>RECEIVED</OrderStatus></OrderIdUserIdDate></ListOrderIdUserIdDate></ResponseSelectWrapper>"
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: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Belchikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2019-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -139,6 +139,7 @@ files:
139
139
  - examples/account.rb
140
140
  - examples/available_npa_nxx.rb
141
141
  - examples/available_number.rb
142
+ - examples/available_number_details.rb
142
143
  - examples/city.rb
143
144
  - examples/config.yml.example
144
145
  - examples/covered-rate-center.rb
@@ -224,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
225
  version: '0'
225
226
  requirements: []
226
227
  rubyforge_project:
227
- rubygems_version: 2.6.6
228
+ rubygems_version: 2.5.2.3
228
229
  signing_key:
229
230
  specification_version: 4
230
231
  summary: Gem for integrating to Bandwidth's Iris API