ruby-bandwidth-iris 4.2.0 → 6.0.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: 357817b797657f2774dcc40552d77a0cb89f40af087ff1ae2b0034be3705a940
4
- data.tar.gz: ac3b0522e1bd592dfdadb14ec58cf38e9089e25b74316a912e03458eb8be47a7
3
+ metadata.gz: a078992d099b9230e03bf89a886d2a20722f589487fe42cf60870cf8d58a78f2
4
+ data.tar.gz: 16a89092f0ade496f0fe8f7b38bfe99aa33262dda8c5d2ecde7d3108fd692ace
5
5
  SHA512:
6
- metadata.gz: 25debb84b4997bef6beb4863eec6db8fc33f472bab4aacb160dec6435abdb26aeb1e0c5a3f73dc1168a5624cd0604bb9c37b65eecd4700f69e5726550a503fce
7
- data.tar.gz: 1c5c4ed9c913d524336887cf618e76c6685d567f565246b8b6770f5f794714b6955ee4ef53341a602d7520dd7e20c36aa86534a4d80a0e785b648efcc9eeb8f4
6
+ metadata.gz: 55cec4a52822fac10792cd040b6837acc876241dbeb7cfb7e238b1a699e00ebe3ca7ecc60b32915180edf370009dfa9d021fd5ba31f6a6a82d1e455f9206a180
7
+ data.tar.gz: b313d0f487d7816a73a0631c863b44a3b8ca3f35154562265dd625c2f0671367c4dcad04cb8da8d823ce8b6ba8d68e494a3fb628604d3779cf5107c5c782e516
data/README.md CHANGED
@@ -387,6 +387,11 @@ order.get_notes()
387
387
  ```
388
388
 
389
389
  ## Port Ins
390
+
391
+ ### List Portins
392
+ ```ruby
393
+ page = BandwidthIris::PortIn.list(client, {'page': 1, 'size': 5})
394
+ ```
390
395
  ### Create PortIn
391
396
  ```ruby
392
397
  data = {
@@ -505,6 +510,28 @@ BandwidthIris::SipPeer.list(sipPeer.siteId)
505
510
  ```ruby
506
511
  sipPeer.delete()
507
512
  ```
513
+
514
+ ### SipPeer Attributes
515
+ ```ruby
516
+ #peer_id
517
+ sipPeer.peer_id
518
+
519
+ #peer_name
520
+ sipPeer.peer_name
521
+
522
+ #is_default_peer
523
+ sipPeer.is_default_peer
524
+
525
+ #products
526
+ sipPeer.products
527
+
528
+ #ss_send_to_customer
529
+ sipPeer.ss_send_to_customer
530
+
531
+ #site_id
532
+ sipPeer.site_id
533
+ ```
534
+
508
535
  ### SipPeer TN Methods
509
536
  ```ruby
510
537
  # get TN for this peer
data/examples/account.rb CHANGED
@@ -11,5 +11,10 @@ BandwidthIris::Client.global_options = {
11
11
  :password => config['password'],
12
12
  :account_id => config['account_id']
13
13
  }
14
- puts BandwidthIris::Account.get()
14
+
15
+ begin
16
+ puts BandwidthIris::Account.get()
17
+ rescue BandwidthIris::Errors::GenericError => e
18
+ puts e.message
19
+ end
15
20
 
@@ -13,5 +13,9 @@ BandwidthIris::Client.global_options = {
13
13
  }
14
14
 
15
15
 
16
- puts BandwidthIris::AvailableNpaNxx.list({:state => 'NC', :quantity => 3})
16
+ begin
17
+ puts BandwidthIris::AvailableNpaNxx.list({:state => 'NC', :quantity => 3})
18
+ rescue BandwidthIris::Errors::GenericError => e
19
+ puts e.message
20
+ end
17
21
 
@@ -13,5 +13,9 @@ BandwidthIris::Client.global_options = {
13
13
  }
14
14
 
15
15
 
16
- puts BandwidthIris::AvailableNumber.list({:state => "NC", :quantity => 3})
16
+ begin
17
+ puts BandwidthIris::AvailableNumber.list({:state => "NC", :quantity => 3})
18
+ rescue BandwidthIris::Errors::GenericError => e
19
+ puts e.message
20
+ end
17
21
 
@@ -12,4 +12,8 @@ BandwidthIris::Client.global_options = {
12
12
  :account_id => config['account_id']
13
13
  }
14
14
 
15
- puts BandwidthIris::AvailableNumber.list({:state => "NC", :quantity => 3, :enable_t_n_detail => true})
15
+ begin
16
+ puts BandwidthIris::AvailableNumber.list({:state => "NC", :quantity => 3, :enable_t_n_detail => true})
17
+ rescue BandwidthIris::Errors::GenericError => e
18
+ puts e.message
19
+ end
data/examples/city.rb CHANGED
@@ -12,5 +12,9 @@ BandwidthIris::Client.global_options = {
12
12
  :account_id => config['account_id']
13
13
  }
14
14
 
15
- puts BandwidthIris::City.list({:available => true, :state => 'NC'})
15
+ begin
16
+ puts BandwidthIris::City.list({:available => true, :state => 'NC'})
17
+ rescue BandwidthIris::Errors::GenericError => e
18
+ puts e.message
19
+ end
16
20
 
@@ -1,4 +1,4 @@
1
- api_endpoint: "https:/dashboard.bandwidth.com"
1
+ api_endpoint: "https://dashboard.bandwidth.com"
2
2
  account_id: ""
3
3
  user_name: ""
4
4
  password: ""
@@ -12,8 +12,11 @@ BandwidthIris::Client.global_options = {
12
12
  :account_id => config['account_id']
13
13
  }
14
14
 
15
-
16
- BandwidthIris::CoveredRateCenter.list({:zip => '27609', :page=>1, :size=>100}).each do |c|
17
- puts c.to_data
15
+ begin
16
+ BandwidthIris::CoveredRateCenter.list({:zip => '27609', :page=>1, :size=>100}).each do |c|
17
+ puts c.to_data
18
+ end
19
+ rescue BandwidthIris::Errors::GenericError => e
20
+ puts e.message
18
21
  end
19
22
 
data/examples/order.rb CHANGED
@@ -14,35 +14,39 @@ BandwidthIris::Client.global_options = {
14
14
 
15
15
  number = '9195551212' #exisitng number for order
16
16
 
17
+ begin
18
+ site = BandwidthIris::Site.create({
19
+ :name => "Ruby Test Site",
20
+ :description => "A Site From Ruby SDK Examples",
21
+ :address => {
22
+ :house_number => "123",
23
+ :street_name => "Anywhere St",
24
+ :city => "Raleigh",
25
+ :state_code =>"NC",
26
+ :zip => "27609",
27
+ :address_type => "Service"
28
+ }
29
+ })
30
+
31
+ order = BandwidthIris::Order.create({
32
+ :name =>"A Test Order",
33
+ :site_id => site.id,
34
+ :existing_telephone_number_order_type => {
35
+ :telephone_number_list =>
36
+ {
37
+ :telephone_number => [number]
38
+ }
39
+
40
+ }
41
+ })
42
+
43
+ puts order.to_data
44
+
45
+ order = BandwidthIris::Order.get(order.id)
46
+ rescue BandwidthIris::Errors::GenericError => e
47
+ puts e.message
48
+ end
17
49
 
18
- site = BandwidthIris::Site.create({
19
- :name => "Ruby Test Site",
20
- :description => "A Site From Ruby SDK Examples",
21
- :address => {
22
- :house_number => "123",
23
- :street_name => "Anywhere St",
24
- :city => "Raleigh",
25
- :state_code =>"NC",
26
- :zip => "27609",
27
- :address_type => "Service"
28
- }
29
- })
30
-
31
- order = BandwidthIris::Order.create({
32
- :name =>"A Test Order",
33
- :site_id => site.id,
34
- :existing_telephone_number_order_type => {
35
- :telephone_number_list =>
36
- {
37
- :telephone_number => [number]
38
- }
39
-
40
- }
41
- })
42
-
43
- puts order.to_data
44
-
45
- order = BandwidthIris::Order.get(order.id)
46
50
 
47
51
  puts order.to_data
48
52
 
data/examples/port-in.rb CHANGED
@@ -16,58 +16,62 @@ number_to_check = '+12525130283' #TODO fill with valid number
16
16
 
17
17
  host = '1.1.2.3'
18
18
 
19
+ begin
20
+ site = BandwidthIris::Site.create({
21
+ :name => "Ruby Test Site",
22
+ :description => "A Site From Ruby SDK Examples",
23
+ :address => {
24
+ :house_number => "123",
25
+ :street_name => "Anywhere St",
26
+ :city => "Raleigh",
27
+ :state_code =>"NC",
28
+ :zip => "27609",
29
+ :address_type => "Service"
30
+ }
31
+ })
19
32
 
20
- site = BandwidthIris::Site.create({
21
- :name => "Ruby Test Site",
22
- :description => "A Site From Ruby SDK Examples",
23
- :address => {
24
- :house_number => "123",
25
- :street_name => "Anywhere St",
26
- :city => "Raleigh",
27
- :state_code =>"NC",
28
- :zip => "27609",
29
- :address_type => "Service"
30
- }
31
- })
32
-
33
- data = {
34
- :peer_name => "A New SIP Peer",
35
- :is_default_peer => true,
36
- :short_messaging_protocol => "SMPP",
37
- :site_id => site[:id],
38
- :voice_hosts =>
39
- {
40
- :host => {
41
- :host_name => host
42
- }
43
- },
44
- :sms_hosts =>
45
- {
46
- :host => {
47
- :host_name => host
48
- }
49
- },
50
- :termination_hosts =>
33
+ data = {
34
+ :peer_name => "A New SIP Peer",
35
+ :is_default_peer => true,
36
+ :short_messaging_protocol => "SMPP",
37
+ :site_id => site[:id],
38
+ :voice_hosts =>
51
39
  {
52
- :termination_host => {
53
- :host_name => host,
54
- :port => 5060,
40
+ :host => {
41
+ :host_name => host
42
+ }
43
+ },
44
+ :sms_hosts =>
45
+ {
46
+ :host => {
47
+ :host_name => host
48
+ }
49
+ },
50
+ :termination_hosts =>
51
+ {
52
+ :termination_host => {
53
+ :host_name => host,
54
+ :port => 5060,
55
+ }
55
56
  }
56
- }
57
57
 
58
- }
58
+ }
59
59
 
60
- sip_peer = BandwidthIris::SipPeer.create(site[:id], data)
60
+ sip_peer = BandwidthIris::SipPeer.create(site[:id], data)
61
61
 
62
- res = BandwidthIris::LnpChecker.check(number_to_check)
62
+ res = BandwidthIris::LnpChecker.check(number_to_check)
63
63
 
64
- if res[:portable_numbers] && res[:portable_numbers][:tn] == number_to_check
65
- puts 'Your number is portable. Creating PortIn Order'
66
- port_in = BandwidthIris::PortIn.create(create_port_in_order(number_to_check, site, sip_peer))
67
- puts "Created order #{port_in[:id]}"
68
- port_in.create_file(File.open('./loa.pdf', 'r'), 'application/pdf')
64
+ if res[:portable_numbers] && res[:portable_numbers][:tn] == number_to_check
65
+ puts 'Your number is portable. Creating PortIn Order'
66
+ port_in = BandwidthIris::PortIn.create(create_port_in_order(number_to_check, site, sip_peer))
67
+ puts "Created order #{port_in[:id]}"
68
+ port_in.create_file(File.open('./loa.pdf', 'r'), 'application/pdf')
69
+ end
70
+ rescue BandwidthIris::Errors::GenericError => e
71
+ puts e.message
69
72
  end
70
73
 
74
+
71
75
  def create_port_in_order(number, site, sip_peer)
72
76
  {
73
77
  :site_id => site[:id],
@@ -0,0 +1,28 @@
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
+ @portins = Array.new # All portins on the account will be stored in this array
16
+ page = BandwidthIris::PortIn.list({'page': 1, 'size': 5}) # Get the first page of paginated portin results
17
+
18
+ def get_portins(page) # Recursively check for more pages of results and populate array with portins from current page
19
+ page.each do |portin|
20
+ @portins.push(portin)
21
+ end
22
+ unless page.next.nil?
23
+ get_portins(page.next)
24
+ end
25
+ end
26
+
27
+ get_portins(page)
28
+ puts "Total Port-Ins: #{@portins.length()}" # Print total number of portins on account
data/examples/sip_peer.rb CHANGED
@@ -14,47 +14,51 @@ BandwidthIris::Client.global_options = {
14
14
 
15
15
  host = '10.20.30.41'
16
16
 
17
+ begin
18
+ site = BandwidthIris::Site.create({
19
+ :name => "Ruby Test Site",
20
+ :description => "A Site From Ruby SDK Examples",
21
+ :address => {
22
+ :house_number => "123",
23
+ :street_name => "Anywhere St",
24
+ :city => "Raleigh",
25
+ :state_code =>"NC",
26
+ :zip => "27609",
27
+ :address_type => "Service"
28
+ }
29
+ })
17
30
 
18
- site = BandwidthIris::Site.create({
19
- :name => "Ruby Test Site",
20
- :description => "A Site From Ruby SDK Examples",
21
- :address => {
22
- :house_number => "123",
23
- :street_name => "Anywhere St",
24
- :city => "Raleigh",
25
- :state_code =>"NC",
26
- :zip => "27609",
27
- :address_type => "Service"
28
- }
29
- })
30
-
31
- data = {
32
- :peer_name => "A New SIP Peer",
33
- :is_default_peer => true,
34
- :short_messaging_protocol => "SMPP",
35
- :site_id => site[:id],
36
- :voice_hosts =>
37
- {
38
- :host => {
39
- :host_name => host
40
- }
41
- },
42
- :sms_hosts =>
43
- {
44
- :host => {
45
- :host_name => host
46
- }
47
- },
48
- :termination_hosts =>
31
+ data = {
32
+ :peer_name => "A New SIP Peer",
33
+ :is_default_peer => true,
34
+ :short_messaging_protocol => "SMPP",
35
+ :site_id => site[:id],
36
+ :voice_hosts =>
37
+ {
38
+ :host => {
39
+ :host_name => host
40
+ }
41
+ },
42
+ :sms_hosts =>
49
43
  {
50
- :termination_host => {
51
- :host_name => host,
52
- :port => 5060,
44
+ :host => {
45
+ :host_name => host
46
+ }
47
+ },
48
+ :termination_hosts =>
49
+ {
50
+ :termination_host => {
51
+ :host_name => host,
52
+ :port => 5060,
53
+ }
53
54
  }
54
- }
55
55
 
56
- }
57
- sip_peer = BandwidthIris::SipPeer.create(site[:id], data)
56
+ }
57
+ sip_peer = BandwidthIris::SipPeer.create(site[:id], data)
58
+ rescue BandwidthIris::Errors::GenericError => e
59
+ puts e.message
60
+ end
61
+
58
62
 
59
63
 
60
64
  sip_peer.delete(site[:id])
data/examples/site.rb CHANGED
@@ -12,18 +12,21 @@ BandwidthIris::Client.global_options = {
12
12
  :account_id => config['account_id']
13
13
  }
14
14
 
15
-
16
- site = BandwidthIris::Site.create({
17
- :name => "Ruby Test Sitei1",
18
- :description => "A Site From Ruby SDK Examples",
19
- :address => {
20
- :house_number => "123",
21
- :street_name => "Anywhere St",
22
- :city => "Raleigh",
23
- :state_code =>"NC",
24
- :zip => "27609",
25
- :address_type => "Service"
26
- }
27
- })
15
+ begin
16
+ site = BandwidthIris::Site.create({
17
+ :name => "Ruby Test Sitei1",
18
+ :description => "A Site From Ruby SDK Examples",
19
+ :address => {
20
+ :house_number => "123",
21
+ :street_name => "Anywhere St",
22
+ :city => "Raleigh",
23
+ :state_code =>"NC",
24
+ :zip => "27609",
25
+ :address_type => "Service"
26
+ }
27
+ })
28
+ rescue BandwidthIris::Errors::GenericError => e
29
+ puts e.message
30
+ end
28
31
 
29
32
  site.delete()
data/examples/tn.rb CHANGED
@@ -13,8 +13,11 @@ BandwidthIris::Client.global_options = {
13
13
  :account_id => config['account_id']
14
14
  }
15
15
 
16
- list = BandwidthIris::Tn.list({:npa => '818', :page => 1, :size => 100}).each do |n|
17
- puts n.to_data
16
+ begin
17
+ list = BandwidthIris::Tn.list({:npa => '818', :page => 1, :size => 100}).each do |n|
18
+ puts n.to_data
19
+ end
20
+ puts BandwidthIris::Tn.get(list[0][:full_number]).to_data
21
+ rescue BandwidthIris::Errors::GenericError => e
22
+ puts e.message
18
23
  end
19
-
20
- puts BandwidthIris::Tn.get(list[0][:full_number]).to_data
@@ -14,7 +14,7 @@ module BandwidthIris
14
14
  # return [Hash] Body
15
15
  attr_reader :body
16
16
 
17
- # @return [String] Error code
17
+ # @return [String] Iris Error code
18
18
  attr_reader :code
19
19
 
20
20
  # @api private
@@ -23,8 +23,7 @@ module BandwidthIris
23
23
  @reason = reason
24
24
  @headers = headers
25
25
  @body = body
26
- @code = '' # Iris Error Code can be accessed with body[:error][:code]
27
- super message = "Http code #{@http_status}"
26
+ super message = "HTTP Error\nStatus Code: #{@http_status}\nReason: #{@reason}\nHTTP Headers: #{@headers}\nResponse Body: #{@body}"
28
27
  end
29
28
  end
30
29
 
@@ -0,0 +1,17 @@
1
+ require "delegate"
2
+
3
+ module BandwidthIris
4
+ class PaginatedResult < SimpleDelegator
5
+ def initialize(items, links, &block)
6
+ super(items)
7
+ @links = links
8
+ @requestor = block
9
+ end
10
+
11
+ def next
12
+ return unless @links[:next]
13
+
14
+ @requestor.call(@links[:next].match(/\<([^>]+)\>/)[1].sub(/^http.*\/v1.0/, ""))
15
+ end
16
+ end
17
+ end
@@ -13,6 +13,26 @@ module BandwidthIris
13
13
  end
14
14
  wrap_client_arg :create
15
15
 
16
+ def self.list_from_page_url(client, url, query=nil)
17
+ response = client.make_request(:get, url, query)[0]
18
+ items = response[:lnp_port_info_for_given_status]
19
+ items = items.is_a?(Array) ? items : [items]
20
+ PaginatedResult.new(
21
+ items.map { |item| PortIn.new(item, client) },
22
+ response[:links]
23
+ ) do |next_url|
24
+ list_from_page_url(client, next_url)
25
+ end
26
+ end
27
+
28
+ def self.list(client, query=nil)
29
+ list_from_page_url(client, client.concat_account_path(PORT_IN_PATH), query)
30
+ end
31
+ wrap_client_arg :list
32
+
33
+ def tns
34
+ Array(@client.make_request(:get, "#{@client.concat_account_path(PORT_IN_PATH)}/#{order_id}/tns")[0][:telephone_number])
35
+ end
16
36
 
17
37
  def update(data)
18
38
  @client.make_request(:put,"#{@client.concat_account_path(PORT_IN_PATH)}/#{id}", {:lnp_order_supp => data})
@@ -10,8 +10,8 @@ module BandwidthIris
10
10
  end
11
11
  wrap_client_arg :list
12
12
 
13
- def self.get(client, site_id, id)
14
- Site.new({:id => site_id}, client).get_sip_peer(id)
13
+ def self.get(client, site_id, peer_id)
14
+ Site.new({:id => site_id}, client).get_sip_peer(peer_id)
15
15
  end
16
16
  wrap_client_arg :get
17
17
 
@@ -21,12 +21,12 @@ module BandwidthIris
21
21
  wrap_client_arg :create
22
22
 
23
23
  def delete()
24
- @client.make_request(:delete,"#{@client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{id}")
24
+ @client.make_request(:delete,"#{@client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{peer_id}")
25
25
  end
26
26
 
27
27
 
28
28
  def get_tns(number = nil)
29
- r = @client.make_request(:get,"#{@client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{id}/tns#{if number then '/' + CGI.escape(number) else '' end}")[0]
29
+ r = @client.make_request(:get,"#{@client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{peer_id}/tns#{if number then '/' + CGI.escape(number) else '' end}")[0]
30
30
  if number
31
31
  r[:sip_peer_telephone_number]
32
32
  else
@@ -37,11 +37,11 @@ module BandwidthIris
37
37
  end
38
38
 
39
39
  def update_tns(number, data)
40
- @client.make_request(:put,"#{@client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{id}/tns/#{CGI.escape(number)}", {:sip_peer_telephone_number => data})[0]
40
+ @client.make_request(:put,"#{@client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{peer_id}/tns/#{CGI.escape(number)}", {:sip_peer_telephone_number => data})[0]
41
41
  end
42
42
 
43
43
  def move_tns(numbers)
44
- @client.make_request(:post,"#{@client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{id}/movetns", {:sip_peer_telephone_numbers => {:full_number => numbers}})[0]
44
+ @client.make_request(:post,"#{@client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{peer_id}/movetns", {:sip_peer_telephone_numbers => {:full_number => numbers}})[0]
45
45
  end
46
46
  end
47
47
  end
@@ -38,7 +38,8 @@ module BandwidthIris
38
38
 
39
39
  def get_sip_peer(peer_id)
40
40
  item = @client.make_request(:get, "#{@client.concat_account_path(SITE_PATH)}/#{id}/sippeers/#{peer_id}")[0][:sip_peer]
41
- item[:id] = item[:peer_id]
41
+ item[:site_id] = id
42
+ puts item
42
43
  item
43
44
  end
44
45
 
@@ -46,7 +47,7 @@ module BandwidthIris
46
47
  list = @client.make_request(:get, "#{@client.concat_account_path(SITE_PATH)}/#{id}/sippeers")[0][:sip_peers][:sip_peer]
47
48
  return [] if !list
48
49
  list = if list.is_a?(Array) then list else [list] end
49
- list.each {|i| i[:id] = i[:peer_id]}
50
+ list.each {|i| i[:site_id] = id}
50
51
  list
51
52
  end
52
53
 
@@ -37,5 +37,13 @@ module BandwidthIris
37
37
  def get_details()
38
38
  @client.make_request(:get, "#{TN_PATH}/#{CGI.escape(telephone_number)}/tndetails")[0][:telephone_number_details]
39
39
  end
40
+
41
+ def move(params)
42
+ @client.make_request(
43
+ :post,
44
+ @client.concat_account_path("moveTns"),
45
+ MoveTnsOrder: params.merge(TelephoneNumbers: { TelephoneNumber: telephone_number })
46
+ )
47
+ end
40
48
  end
41
49
  end
@@ -1,4 +1,4 @@
1
1
  module BandwidthIris
2
2
  # Version of this gem
3
- VERSION = "4.2.0"
3
+ VERSION = "6.0.0"
4
4
  end
@@ -17,6 +17,7 @@ require 'bandwidth-iris/lidb'
17
17
  require 'bandwidth-iris/lnp_checker'
18
18
  require 'bandwidth-iris/lsr_order'
19
19
  require 'bandwidth-iris/order'
20
+ require 'bandwidth-iris/paginated_result'
20
21
  require 'bandwidth-iris/port_in'
21
22
  require 'bandwidth-iris/port_out'
22
23
  require 'bandwidth-iris/rate_center'
@@ -88,8 +88,12 @@ describe BandwidthIris::Client do
88
88
  end
89
89
 
90
90
  it 'should raise error if http status >= 400' do
91
- client.stubs.get('/v1.0/path1') { |env| [400, {}, ''] }
92
- expect{client.make_request(:get, '/path1')}.to raise_error(Errors::GenericError, "Http code 400")
91
+ client.stubs.get('/v1.0/path1') { |env| [400, {'content-type'=>'application/xml'}, '<SearchResult><Error><Code>4010</Code><Description>The state abbreviation N is not valid.</Description></Error></SearchResult>'] }
92
+ expect{client.make_request(:get, '/path1')}.to raise_error(an_instance_of(Errors::GenericError).and having_attributes({
93
+ http_status: 400,
94
+ headers: {"content-type"=>"application/xml"},
95
+ body: {:error=>{:code=>4010, :description=>"The state abbreviation N is not valid."}}
96
+ }))
93
97
  end
94
98
  end
95
99
  end
@@ -9,6 +9,22 @@ describe BandwidthIris::PortIn do
9
9
  client.stubs.verify_stubbed_calls()
10
10
  end
11
11
 
12
+ describe '#list_orders' do
13
+ it 'should list port in orders' do
14
+ client.stubs.get('/v1.0/accounts/accountId/portins') {|env| [200, {}, Helper.xml['port_ins']]}
15
+ orders = PortIn.list(client)
16
+ orders.each do |order|
17
+ expect(order.class).to eql(BandwidthIris::PortIn)
18
+ end
19
+ expect(orders[0][:order_id]).to eql("ab03375f-e0a9-47f8-bd31-6d8435454a6b")
20
+ expect(orders[1][:order_id]).to eql("b2190bcc-0272-4a51-ba56-7c3d628e8706")
21
+ expect(orders[0][:lnp_losing_carrier_id]).to eql(1163)
22
+ expect(orders[1][:lnp_losing_carrier_id]).to eql(1290)
23
+ expect(orders[0][:last_modified_date]).to eql(DateTime.new(2020, 1, 15, 19, 8, 57.626))
24
+ expect(orders[1][:last_modified_date]).to eql(DateTime.new(2020, 1, 15, 19, 6, 10.085))
25
+ end
26
+ end
27
+
12
28
  describe '#create' do
13
29
  it 'should create an order' do
14
30
  data = {
@@ -14,7 +14,7 @@ describe BandwidthIris::SipPeer do
14
14
  client.stubs.get('/v1.0/accounts/accountId/sites/1/sippeers') {|env| [200, {}, Helper.xml['sip_peers']]}
15
15
  list = SipPeer.list(client, 1)
16
16
  expect(list.length).to eql(1)
17
- expect(list[0][:id]).to eql(12345)
17
+ expect(list[0][:peer_id]).to eql(12345)
18
18
  expect(list[0][:peer_name]).to eql("SIP Peer 1")
19
19
  expect(list[0][:description]).to eql("Sip Peer 1 description")
20
20
  end
@@ -24,7 +24,7 @@ describe BandwidthIris::SipPeer do
24
24
  it 'should return a peer' do
25
25
  client.stubs.get('/v1.0/accounts/accountId/sites/1/sippeers/11') {|env| [200, {}, Helper.xml['sip_peer']]}
26
26
  item = SipPeer.get(client, 1, 11)
27
- expect(item[:id]).to eql(10)
27
+ expect(item[:peer_id]).to eql(10)
28
28
  expect(item[:peer_name]).to eql("SIP Peer 1")
29
29
  expect(item[:description]).to eql("Sip Peer 1 description")
30
30
  end
@@ -36,7 +36,7 @@ describe BandwidthIris::SipPeer do
36
36
  client.stubs.post('/v1.0/accounts/accountId/sites/1/sippeers', client.build_xml({:sip_peer => data})) {|env| [201, {'Location' => '/v1.0/accounts/accountId/sites/1/sippeers/11'}, '']}
37
37
  client.stubs.get('/v1.0/accounts/accountId/sites/1/sippeers/11') {|env| [200, {}, Helper.xml['sip_peer']]}
38
38
  item = SipPeer.create(client, 1, data)
39
- expect(item[:id]).to eql(10)
39
+ expect(item[:peer_id]).to eql(10)
40
40
  expect(item[:peer_name]).to eql("SIP Peer 1")
41
41
  expect(item[:description]).to eql("Sip Peer 1 description")
42
42
  end
@@ -45,7 +45,7 @@ describe BandwidthIris::SipPeer do
45
45
  describe '#delete' do
46
46
  it 'should remove a peer' do
47
47
  client.stubs.delete('/v1.0/accounts/accountId/sites/1/sippeers/11') {|env| [200, {}, '']}
48
- item = SipPeer.new({:site_id => 1, :id => 11}, client)
48
+ item = SipPeer.new({:site_id => 1, :peer_id => 11}, client)
49
49
  item.delete()
50
50
  end
51
51
  end
@@ -53,14 +53,14 @@ describe BandwidthIris::SipPeer do
53
53
  describe '#get_tns' do
54
54
  it 'should return list of numbers' do
55
55
  client.stubs.get('/v1.0/accounts/accountId/sites/1/sippeers/10/tns') {|env| [200, {}, Helper.xml['sip_peer_tns']]}
56
- item = SipPeer.new({:site_id => 1, :id => 10}, client)
56
+ item = SipPeer.new({:site_id => 1, :peer_id => 10}, client)
57
57
  list = item.get_tns()
58
58
  expect(list.length).to eql(17)
59
59
  expect(list[0][:full_number]).to eql("3034162216")
60
60
  end
61
61
  it 'should return a number' do
62
62
  client.stubs.get('/v1.0/accounts/accountId/sites/1/sippeers/10/tns/12345') {|env| [200, {}, Helper.xml['sip_peer_tn']]}
63
- item = SipPeer.new({:site_id => 1, :id => 10}, client)
63
+ item = SipPeer.new({:site_id => 1, :peer_id => 10}, client)
64
64
  item = item.get_tns('12345')
65
65
  expect(item[:full_number]).to eql("9195551212")
66
66
  end
@@ -70,7 +70,7 @@ describe BandwidthIris::SipPeer do
70
70
  it 'should update a number' do
71
71
  data = {:full_number => "123456", :rewrite_user => "test"}
72
72
  client.stubs.put('/v1.0/accounts/accountId/sites/1/sippeers/10/tns/123456', client.build_xml({:sip_peer_telephone_number => data})) {|env| [200, {}, '']}
73
- item = SipPeer.new({:site_id => 1, :id => 10}, client)
73
+ item = SipPeer.new({:site_id => 1, :peer_id => 10}, client)
74
74
  item.update_tns('123456', data)
75
75
  end
76
76
  end
@@ -79,7 +79,7 @@ describe BandwidthIris::SipPeer do
79
79
  it 'should move numbers' do
80
80
  data = ["11111", "22222"]
81
81
  client.stubs.post('/v1.0/accounts/accountId/sites/1/sippeers/10/movetns', client.build_xml({:sip_peer_telephone_numbers => {:full_number => data}})) {|env| [200, {}, '']}
82
- item = SipPeer.new({:site_id => 1, :id => 10}, client)
82
+ item = SipPeer.new({:site_id => 1, :peer_id => 10}, client)
83
83
  item.move_tns(data)
84
84
  end
85
85
  end
@@ -63,7 +63,7 @@ describe BandwidthIris::Site do
63
63
  site = Site.new({:id => 1}, client)
64
64
  list = site.get_sip_peers()
65
65
  expect(list.length).to eql(1)
66
- expect(list[0][:id]).to eql(12345)
66
+ expect(list[0][:peer_id]).to eql(12345)
67
67
  expect(list[0][:peer_name]).to eql("SIP Peer 1")
68
68
  expect(list[0][:description]).to eql("Sip Peer 1 description")
69
69
  end
@@ -74,7 +74,7 @@ describe BandwidthIris::Site do
74
74
  client.stubs.get('/v1.0/accounts/accountId/sites/1/sippeers/11') {|env| [200, {}, Helper.xml['sip_peer']]}
75
75
  site = Site.new({:id => 1}, client)
76
76
  item = site.get_sip_peer(11)
77
- expect(item[:id]).to eql(10)
77
+ expect(item[:peer_id]).to eql(10)
78
78
  expect(item[:peer_name]).to eql("SIP Peer 1")
79
79
  expect(item[:description]).to eql("Sip Peer 1 description")
80
80
  end
@@ -87,7 +87,7 @@ describe BandwidthIris::Site do
87
87
  client.stubs.get('/v1.0/accounts/accountId/sites/1/sippeers/11') {|env| [200, {}, Helper.xml['sip_peer']]}
88
88
  site = Site.new({:id => 1}, client)
89
89
  item = site.create_sip_peer(data)
90
- expect(item[:id]).to eql(10)
90
+ expect(item[:peer_id]).to eql(10)
91
91
  expect(item[:peer_name]).to eql("SIP Peer 1")
92
92
  expect(item[:description]).to eql("Sip Peer 1 description")
93
93
  end
@@ -27,6 +27,19 @@ describe BandwidthIris::Tn do
27
27
  end
28
28
  end
29
29
 
30
+ describe '#move' do
31
+ it 'should move a number' do
32
+ client.stubs.get('/v1.0/tns/1234') {|env| [200, {}, Helper.xml['tn']]}
33
+ tn = Tn.get(client, '1234')
34
+ client.stubs.post('/v1.0/accounts/accountId/moveTns') {|env| [201, {}, Helper.xml['tn_move']]}
35
+ order = tn.move({'SiteId': 12345, 'SipPeerId': 123450})[0][:move_tns_order]
36
+ expect(order[:created_by_user]).to eql('userapi')
37
+ expect(order[:order_id]).to eql('55689569-86a9-fe40-ab48-f12f6c11e108')
38
+ expect(order[:sip_peer_id]).to eql(123450)
39
+ expect(order[:site_id]).to eql(12345)
40
+ end
41
+ end
42
+
30
43
  describe '#get_sites' do
31
44
  it 'should return sites' do
32
45
  client.stubs.get('/v1.0/tns/1234/sites') {|env| [200, {}, Helper.xml['tn_sites']]}
data/spec/xml.yml CHANGED
@@ -13,12 +13,14 @@
13
13
  rate_centers1: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><RateCenterResponse><ResultCount>1</ResultCount><RateCenters><RateCenter><Abbreviation>ACME</Abbreviation><Name>ACME</Name></RateCenter></RateCenters></RateCenterResponse>"
14
14
  tn: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><TelephoneNumberResponse><TelephoneNumber>1234</TelephoneNumber><Status>Inservice</Status><LastModifiedDate>2014-05-09T21:12:03.000Z</LastModifiedDate><OrderCreateDate>2014-05-09T21:12:03.835Z</OrderCreateDate><OrderId>5f3a4dab-aac7-4b0a-8ee4-1b6a67ae04be</OrderId><OrderType>NEW_NUMBER_ORDER</OrderType><SiteId>1091</SiteId><AccountId>9500149</AccountId></TelephoneNumberResponse>"
15
15
  tns: "<?xml version=\"1.0\"?><TelephoneNumbersResponse><TelephoneNumberCount>5</TelephoneNumberCount><Links><first></first><next></next></Links><TelephoneNumbers><TelephoneNumber><City>CARY</City><Lata>426</Lata><State>NC</State><FullNumber>9192381138</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName><RateCenter>CARY</RateCenter><Status>Inservice</Status><AccountId>9900008</AccountId><LastModified>2013-12-05T05:58:27.000Z</LastModified></TelephoneNumber><TelephoneNumber><City>CARY</City><Lata>426</Lata><FullNumber>9192381139</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName><RateCenter>CARY</RateCenter><Status>Inservice</Status><AccountId>9900000</AccountId><LastModified>2013-12-05T05:58:27.000Z</LastModified></TelephoneNumber></TelephoneNumbers></TelephoneNumbersResponse>"
16
+ tn_move: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><MoveTnsOrderResponse><MoveTnsOrder><OrderCreateDate>2022-05-12T15:30:54.236Z</OrderCreateDate><AccountId>5551234</AccountId><CreatedByUser>userapi</CreatedByUser><OrderId>55689569-86a9-fe40-ab48-f12f6c11e108</OrderId><LastModifiedDate>2022-05-12T15:30:54.271Z</LastModifiedDate><SiteId>12345</SiteId><TelephoneNumbers><TelephoneNumber>1234</TelephoneNumber></TelephoneNumbers><ProcessingStatus>RECEIVED</ProcessingStatus><SipPeerId>123450</SipPeerId><Errors/><Warnings/></MoveTnsOrder></MoveTnsOrderResponse>"
16
17
  tn_sites: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Site><Id>1435</Id><Name>Sales Training</Name></Site>"
17
18
  tn_sip_peers: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><SipPeer><Id>4064</Id><Name>Sales</Name></SipPeer>"
18
19
  tn_rate_center: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><TelephoneNumberResponse><TelephoneNumberDetails><State>CO</State><RateCenter>DENVER</RateCenter></TelephoneNumberDetails></TelephoneNumberResponse>"
19
20
  tn_reservation: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><ReservationResponse><Reservation><ReservationId>e34474d6-1d47-486d-af32-be9f2eefdff4</ReservationId><AccountId>111</AccountId><ReservationExpires>13157</ReservationExpires><ReservedTn>9198975719</ReservedTn></Reservation></ReservationResponse>"
20
21
  tn_details: "<TelephoneNumberResponse><TelephoneNumberDetails><City>JERSEY CITY</City><Lata>224</Lata><State>NJ</State><FullNumber>2018981023</FullNumber><Tier>0</Tier><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName><RateCenter>JERSEYCITY</RateCenter><Status>Inservice</Status><AccountId>14</AccountId><LastModified>2014-07-30T11:29:37.000Z</LastModified><Features><E911><Status>Success</Status></E911><Lidb><Status>Pending</Status><SubscriberInformation>Fred</SubscriberInformation><UseType>BUSINESS</UseType><Visibility>PUBLIC</Visibility></Lidb><Dlda><Status>Success</Status><SubscriberType>BUSINESS</SubscriberType><ListingType>LISTED</ListingType><ListingName><FirstName>Joe</FirstName><LastName>Smith</LastName></ListingName><ListAddress>true</ListAddress><Address><HouseNumber>12</HouseNumber><StreetName>ELM</StreetName><City>New York</City><StateCode>NY</StateCode><Zip>10007</Zip><Country>United States</Country><AddressType>Dlda</AddressType></Address></Dlda></Features><TnAttributes><TnAttribute>Protected</TnAttribute></TnAttributes></TelephoneNumberDetails></TelephoneNumberResponse>"
21
22
  port_in: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><LnpOrderResponse><OrderId>d28b36f7-fa96-49eb-9556-a40fca49f7c6</OrderId><Status><Code>201</Code><Description>Order request received. Please use the order id to check the status of your order later.</Description></Status><ProcessingStatus>PENDING_DOCUMENTS</ProcessingStatus><LoaAuthorizingPerson>John Doe</LoaAuthorizingPerson><Subscriber><SubscriberType>BUSINESS</SubscriberType><BusinessName>Acme Corporation</BusinessName><ServiceAddress><HouseNumber>1623</HouseNumber><StreetName>Brockton Ave #1</StreetName><City>Los Angeles</City><StateCode>CA</StateCode><Zip>90025</Zip><Country>USA</Country></ServiceAddress></Subscriber><BillingTelephoneNumber>6882015002</BillingTelephoneNumber><ListOfPhoneNumbers><PhoneNumber>6882015025</PhoneNumber><PhoneNumber>6882015026</PhoneNumber></ListOfPhoneNumbers><Triggered>false</Triggered><BillingType>PORTIN</BillingType></LnpOrderResponse>"
23
+ port_ins: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><LNPResponseWrapper><TotalCount>2</TotalCount><Links><first>Link=&lt;https://test.dashboard.bandwidth.com:443/v1.0/accounts/9900012/portins?page=1&amp;size=10&amp;date=2020-01-15&amp;status=foc&gt;;rel=\"first\";</first></Links><lnpPortInfoForGivenStatus><accountId>9900012</accountId><CountOfTNs>1</CountOfTNs><userId>System</userId><lastModifiedDate>2020-01-15T19:08:57.626Z</lastModifiedDate><OrderDate>2020-01-15T19:08:10.488Z</OrderDate><OrderId>ab03375f-e0a9-47f8-bd31-6d8435454a6b</OrderId><OrderType>port_in</OrderType><ActualFOCDate>2020-01-16T16:30:00.000Z</ActualFOCDate><BillingTelephoneNumber>9196247209</BillingTelephoneNumber><CompanyName>WandEDemo</CompanyName><LNPLosingCarrierId>1163</LNPLosingCarrierId><LNPLosingCarrierName>Bandwidth</LNPLosingCarrierName><ProcessingStatus>FOC</ProcessingStatus><RequestedFOCDate>2020-01-16T16:30:00.000Z</RequestedFOCDate><VendorId>49</VendorId><VendorName>Bandwidth CLEC</VendorName><PON>4c129d8e-57fc-4ccb-a37d-7f21aca8b32d</PON></lnpPortInfoForGivenStatus><lnpPortInfoForGivenStatus><accountId>9900012</accountId><CountOfTNs>1</CountOfTNs><userId>gforrest</userId><lastModifiedDate>2020-01-15T19:06:10.085Z</lastModifiedDate><OrderDate>2019-10-14T17:16:41.949Z</OrderDate><OrderId>b2190bcc-0272-4a51-ba56-7c3d628e8706</OrderId><OrderType>port_in</OrderType><ActualFOCDate>2020-01-16T01:00:00.000Z</ActualFOCDate><BillingTelephoneNumber>2174101100</BillingTelephoneNumber><CompanyName>WandEDemo</CompanyName><LNPLosingCarrierId>1290</LNPLosingCarrierId><LNPLosingCarrierName>IntegraTelecom</LNPLosingCarrierName><ProcessingStatus>FOC</ProcessingStatus><RequestedFOCDate>2020-01-21T17:30:00.000Z</RequestedFOCDate><VendorId>57</VendorId><VendorName>Level 3</VendorName><PON>979E019287CDF6A1</PON></lnpPortInfoForGivenStatus></LNPResponseWrapper>"
22
24
  notes: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Notes><Note><Id>11299</Id><UserId>customer</UserId><Description>Test</Description><LastDateModifier>2014-11-20T07:08:47.000Z</LastDateModifier></Note><Note><Id>11301</Id><UserId>customer</UserId><Description>Test1</Description><LastDateModifier>2014-11-20T07:11:36.000Z</LastDateModifier></Note></Notes>"
23
25
  files: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><fileListResponse><fileCount>6</fileCount><fileData><FileName>d28b36f7-fa96-49eb-9556-a40fca49f7c6-1416231534986.txt</FileName><FileMetaData><DocumentType>LOA</DocumentType></FileMetaData></fileData><fileData><FileName>d28b36f7-fa96-49eb-9556-a40fca49f7c6-1416231558768.txt</FileName><FileMetaData><DocumentType>LOA</DocumentType></FileMetaData></fileData><fileData><FileName>d28b36f7-fa96-49eb-9556-a40fca49f7c6-1416231581134.txt</FileName><FileMetaData><DocumentType>LOA</DocumentType></FileMetaData></fileData><fileData><FileName>d28b36f7-fa96-49eb-9556-a40fca49f7c6-1416231629005.txt</FileName><FileMetaData><DocumentType>LOA</DocumentType></FileMetaData></fileData><fileData><FileName>d28b36f7-fa96-49eb-9556-a40fca49f7c6-1416231699462.txt</FileName><FileMetaData><DocumentType>LOA</DocumentType></FileMetaData></fileData><fileData><FileName>d28b36f7-fa96-49eb-9556-a40fca49f7c6-1416232756923.txt</FileName><FileMetaData><DocumentType>LOA</DocumentType></FileMetaData></fileData><resultCode>0</resultCode><resultMessage>LOA file list successfully returned</resultMessage></fileListResponse>"
24
26
  file_metadata: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><FileMetaData><DocumentType>LOA</DocumentType></FileMetaData>"
@@ -39,7 +41,6 @@
39
41
  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>"
40
42
  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>"
41
43
  dlda: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><DldaOrderResponse><DldaOrder><CustomerOrderId>5a88d16d-f8a9-45c5-a5db-137d700c6a22</CustomerOrderId><OrderCreateDate>2014-07-10T12:38:11.833Z</OrderCreateDate><AccountId>14</AccountId><CreatedByUser>jbm</CreatedByUser><OrderId>ea9e90c2-77a4-4f82-ac47-e1c5bb1311f4</OrderId><LastModifiedDate>2014-07-10T12:38:11.833Z</LastModifiedDate><ProcessingStatus>RECEIVED</ProcessingStatus><DldaTnGroups><DldaTnGroup><TelephoneNumbers><TelephoneNumber>2053778335</TelephoneNumber><TelephoneNumber>2053865784</TelephoneNumber></TelephoneNumbers><AccountType>BUSINESS</AccountType><ListingType>LISTED</ListingType><ListingName><FirstName>Joe</FirstName><LastName>Smith</LastName></ListingName><ListAddress>true</ListAddress><Address><HouseNumber>12</HouseNumber><StreetName>ELM</StreetName><City>New York</City><StateCode>NY</StateCode><Zip>10007</Zip><Country>United States</Country><AddressType>Dlda</AddressType></Address></DldaTnGroup></DldaTnGroups></DldaOrder></DldaOrderResponse>"
42
- order_history: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><OrderHistoryWrapper><OrderHistory><OrderDate>2014-05-20T14:21:43.937Z</OrderDate><Note>Order backordered - awaiting additional numbers</Note><Status>BACKORDERED</Status></OrderHistory><OrderHistory><OrderDate>2014-05-20T14:24:43.428Z</OrderDate><Note>Order backordered - awaiting additional numbers</Note><Author>System</Author><Status>BACKORDERED</Status><Difference></Difference></OrderHistory></OrderHistoryWrapper>"
43
44
  in_service_numbers: "<?xml version=\"1.0\"?><TNs><TotalCount>59</TotalCount><Links><first> ( a link goes here ) </first></Links><TelephoneNumbers><Count>59</Count><TelephoneNumber>8043024183</TelephoneNumber><TelephoneNumber>8042121778</TelephoneNumber><TelephoneNumber>8042146066</TelephoneNumber><TelephoneNumber>8043814903</TelephoneNumber><TelephoneNumber>8043814905</TelephoneNumber><TelephoneNumber>8043814864</TelephoneNumber><TelephoneNumber>8043326094</TelephoneNumber><TelephoneNumber>8042121771</TelephoneNumber><TelephoneNumber>8043024182</TelephoneNumber><!-- SNIP --><TelephoneNumber>8043814900</TelephoneNumber><TelephoneNumber>8047672642</TelephoneNumber><TelephoneNumber>8043024368</TelephoneNumber><TelephoneNumber>8042147950</TelephoneNumber><TelephoneNumber>8043169931</TelephoneNumber><TelephoneNumber>8043325302</TelephoneNumber></TelephoneNumbers></TNs>"
44
45
  in_service_numbers_totals: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Quantity><Count>3</Count></Quantity>"
45
46
  lidbs: "<?xml version=\"1.0\"?><ResponseSelectWrapper><ListOrderIdUserIdDate><TotalCount>2122</TotalCount><OrderIdUserIdDate><accountId>9999999</accountId><CountOfTNs>0</CountOfTNs><lastModifiedDate>2014-02-25T16:02:43.195Z</lastModifiedDate><OrderType>lidb</OrderType><OrderDate>2014-02-25T16:02:43.195Z</OrderDate><orderId>abe36738-6929-4c6f-926c-88e534e2d46f</orderId><OrderStatus>FAILED</OrderStatus><TelephoneNumberDetails/><userId>team_ua</userId></OrderIdUserIdDate><!-- ...SNIP... --><OrderIdUserIdDate><accountId>9999999</accountId><CountOfTNs>0</CountOfTNs><lastModifiedDate>2014-02-25T16:02:39.021Z</lastModifiedDate><OrderType>lidb</OrderType><OrderDate>2014-02-25T16:02:39.021Z</OrderDate><orderId>ba5b6297-139b-4430-aab0-9ff02c4362f4</orderId><OrderStatus>FAILED</OrderStatus><userId>team_ua</userId></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: 4.2.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Belchikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-12 00:00:00.000000000 Z
11
+ date: 2022-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -167,6 +167,7 @@ files:
167
167
  - examples/order.rb
168
168
  - examples/order_number.rb
169
169
  - examples/port-in.rb
170
+ - examples/portin_list.rb
170
171
  - examples/sip_peer.rb
171
172
  - examples/site.rb
172
173
  - examples/tn.rb
@@ -196,6 +197,7 @@ files:
196
197
  - lib/bandwidth-iris/lnp_checker.rb
197
198
  - lib/bandwidth-iris/lsr_order.rb
198
199
  - lib/bandwidth-iris/order.rb
200
+ - lib/bandwidth-iris/paginated_result.rb
199
201
  - lib/bandwidth-iris/port_in.rb
200
202
  - lib/bandwidth-iris/port_out.rb
201
203
  - lib/bandwidth-iris/rate_center.rb