ruby-bandwidth-iris 2.7.2 → 3.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,7 @@ module BandwidthIris
22
22
  password = options[:password] unless password
23
23
  options[:api_endpoint] = @@global_options[:api_endpoint] unless options[:api_endpoint]
24
24
  options[:api_version] = @@global_options[:api_version] unless options[:api_version]
25
- api_endpoint = options[:api_endpoint] || "https://dashboard.bandwidth.com"
25
+ api_endpoint = options[:api_endpoint] || "https://api.inetwork.com"
26
26
  api_version = options[:api_version] || "v1.0"
27
27
 
28
28
  @build_path = lambda {|path| "/#{api_version}" + (if path[0] == "/" then path else "/#{path}" end) }
@@ -32,7 +32,6 @@ module BandwidthIris
32
32
  faraday.basic_auth(user_name, password)
33
33
  #faraday.response :logger
34
34
  faraday.headers['Accept'] = 'application/xml'
35
- faraday.headers['user-agent'] = 'Ruby-Bandwidth-Iris'
36
35
  faraday.use FaradayMiddleware::FollowRedirects
37
36
  @set_adapter.call(faraday)
38
37
  }
@@ -78,8 +77,7 @@ module BandwidthIris
78
77
  req.params = d unless d == nil || d.empty?
79
78
  end
80
79
  else
81
- xml_to_send = build_xml(data) # help debug
82
- connection.run_request(method, @build_path.call(path), xml_to_send, {'Content-Type' => 'application/xml'})
80
+ connection.run_request(method, @build_path.call(path), build_xml(data), {'Content-Type' => 'application/xml'})
83
81
  end
84
82
  body = check_response(response)
85
83
  [body || {}, symbolize(response.headers || {})]
@@ -88,7 +86,7 @@ module BandwidthIris
88
86
  # Makes an HTTP request for file uploads
89
87
  # @param method [Symbol] http method to make
90
88
  # @param path [string] path of url (exclude api verion and endpoint) to make call
91
- # @param data [string] the raw binary string representing the file to upload
89
+ # @param data [string] the raw binary string representing the file to upload
92
90
  # @param content_type [string] the content type of the request
93
91
  # @return [Array] array with 2 elements: parsed data of response and response headers
94
92
  def make_request_file_upload(method, path, data, content_type)
@@ -102,7 +100,7 @@ module BandwidthIris
102
100
  # @param method [Symbol] http method to make
103
101
  # @param path [string] path of url (exclude api verion and endpoint) to make call
104
102
  # @param data [Hash] data which will be sent with request (for :get and :delete request they will be sent with query in url)
105
- # @return [string] raw response from the API
103
+ # @return [string] raw response from the API
106
104
  def make_request_file_download(method, path, data = {})
107
105
  connection = @create_connection.call()
108
106
  response = if method == :get || method == :delete
@@ -120,25 +118,6 @@ module BandwidthIris
120
118
  # @param response response object
121
119
  def check_response(response)
122
120
  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
121
  raise Errors::GenericError.new('', "Http code #{response.status}", response.status) if response.status >= 400
143
122
  parsed_body
144
123
  end
@@ -13,14 +13,6 @@ module BandwidthIris
13
13
 
14
14
  def self.get(client, id)
15
15
  data = client.make_request(:get, "#{client.concat_account_path(ORDER_PATH)}/#{id}")[0][:order]
16
- data[:id] = id
17
- Order.new(data, client)
18
- end
19
- wrap_client_arg :get
20
-
21
- def self.get_order_response(client, id)
22
- data = client.make_request(:get, "#{client.concat_account_path(ORDER_PATH)}/#{id}")[0]
23
- data[:id] = id
24
16
  Order.new(data, client)
25
17
  end
26
18
  wrap_client_arg :get
@@ -33,13 +25,6 @@ module BandwidthIris
33
25
  end
34
26
  wrap_client_arg :list
35
27
 
36
- #`get order` no longer returns an `id`, which means the subsequent `get_tns` call will fail
37
- #This is a workaround to provide the "get tns by order id" functionality
38
- def self.get_tns_by_order_id(client, id)
39
- client.make_request(:get, "#{client.concat_account_path(ORDER_PATH)}/#{id}/tns")[0]
40
- end
41
- wrap_client_arg :get_tns_by_order_id
42
-
43
28
  def update(data)
44
29
  @client.make_request(:put, "#{@client.concat_account_path(ORDER_PATH)}/#{id}", {:order => data})[0]
45
30
  end
@@ -8,14 +8,12 @@ module BandwidthIris
8
8
 
9
9
  def self.get(client, id)
10
10
  data = client.make_request(:get, "#{client.concat_account_path(TN_RESERVATION_PATH)}/#{id}")[0][:reservation]
11
- data[:id] = id
12
11
  TnReservation.new(data, client)
13
12
  end
14
13
  wrap_client_arg :get
15
14
 
16
- def self.create(client, number)
17
- reservation_request = {:reservation => {:reserved_tn => number } }
18
- location = client.make_request(:post, client.concat_account_path(TN_RESERVATION_PATH), reservation_request)[1][:location]
15
+ def self.create(client, item)
16
+ location = client.make_request(:post, client.concat_account_path(TN_RESERVATION_PATH), {:tn_reservation => item})[1][:location]
19
17
  id = Client.get_id_from_location_header(location)
20
18
  self.get(client, id)
21
19
  end
@@ -1,4 +1,4 @@
1
1
  module BandwidthIris
2
2
  # Version of this gem
3
- VERSION = "2.7.2"
3
+ VERSION = "3.0.0.pre"
4
4
  end
@@ -30,12 +30,5 @@ require 'bandwidth-iris/import_tn_orders'
30
30
  require 'bandwidth-iris/import_tn_checker'
31
31
  require 'bandwidth-iris/remove_imported_tn_orders'
32
32
  require 'bandwidth-iris/csr'
33
- require 'bandwidth-iris/applications'
34
- require 'bandwidth-iris/sip_peer_products'
35
- require 'bandwidth-iris/emergency_notification_endpoints'
36
- require 'bandwidth-iris/emergency_notification_groups'
37
- require 'bandwidth-iris/emergency_notification_recipients'
38
- require 'bandwidth-iris/aeui'
39
- require 'bandwidth-iris/tn_options'
40
33
 
41
34
  require 'bandwidth-iris/version'
@@ -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
 
@@ -12,18 +12,18 @@ describe BandwidthIris::Order do
12
12
  describe '#create' do
13
13
  it 'should create an order' do
14
14
  data = {
15
- :name => "Local Order",
16
- :siteId => "29976",
17
- :customerOrderId => "123456789",
18
- :area_code_search_and_order_type => {
19
- :area_code => 919,
15
+ :name => "Test",
16
+ :siteId => "10",
17
+ :customerOrderId => "11",
18
+ :lataSearchAndOrderType => {
19
+ :lata => "224",
20
20
  :quantity => 1
21
21
  }
22
22
  }
23
- client.stubs.post("/v1.0/accounts/accountId/orders", client.build_xml({:order => data})){|env| [200, {}, Helper.xml['create_order_response']]}
23
+ client.stubs.post("/v1.0/accounts/accountId/orders", client.build_xml({:order => data})){|env| [200, {}, Helper.xml['order']]}
24
24
  order = Order.create(client, data)
25
- expect(order.id).to eql("a7af704e-2ec0-4c4d-9dc5-1b77fa62c92a")
26
- expect(order.name).to eql("Local Order")
25
+ expect(order.id).to eql(101)
26
+ expect(order.name).to eql("Test")
27
27
  end
28
28
  end
29
29
 
@@ -31,20 +31,11 @@ describe BandwidthIris::Order do
31
31
  it 'should return an order' do
32
32
  client.stubs.get("/v1.0/accounts/accountId/orders/101"){|env| [200, {}, Helper.xml['order']]}
33
33
  order = Order.get(client, "101")
34
- expect(order.id).to eql("101")
34
+ expect(order.id).to eql(101)
35
35
  expect(order.name).to eql("Test")
36
36
  end
37
37
  end
38
38
 
39
- describe '#get_order_response' do
40
- it 'should return an order with details' do
41
- client.stubs.get("/v1.0/accounts/accountId/orders/101"){|env| [200, {}, Helper.xml['order']]}
42
- order = Order.get_order_response(client, "101")
43
- completed_number = order.completed_numbers[:telephone_number][:full_number]
44
- expect(completed_number).to eql("9194464166")
45
- end
46
- end
47
-
48
39
  describe '#list' do
49
40
  it 'should return orders' do
50
41
  client.stubs.get("/v1.0/accounts/accountId/orders"){|env| [200, {}, Helper.xml['orders']]}
@@ -20,11 +20,11 @@ describe BandwidthIris::TnReservation do
20
20
 
21
21
  describe '#create' do
22
22
  it 'should create a reservation' do
23
- number = "9198975719"
24
- client.stubs.post('/v1.0/accounts/accountId/tnreservation', client.build_xml({:reservation => {:reserved_tn => number } })) {|env| [200, {'Location' => '/v1.0/accounts/accountId/tnreservations/e34474d6-1d47-486d-af32-be9f2eefdff4'}, '']}
25
- client.stubs.get('/v1.0/accounts/accountId/tnreservation/e34474d6-1d47-486d-af32-be9f2eefdff4') {|env| [200, {}, Helper.xml['tn_reservation']]}
26
- item = TnReservation.create(client, number)
27
- expect(item[:id]).to eql("e34474d6-1d47-486d-af32-be9f2eefdff4")
23
+ data = {:account_id => "111", :reserved_tn => "000"}
24
+ client.stubs.post('/v1.0/accounts/accountId/tnreservation', client.build_xml({:tn_reservation => data})) {|env| [200, {'Location' => '/v1.0/accounts/accountId/tnreservations/1'}, '']}
25
+ client.stubs.get('/v1.0/accounts/accountId/tnreservation/1') {|env| [200, {}, Helper.xml['tn_reservation']]}
26
+ item = TnReservation.create(client, data)
27
+ expect(item[:id]).to eql(1)
28
28
  expect(item[:account_id]).to eql(111)
29
29
  end
30
30
  end
data/spec/xml.yml CHANGED
@@ -14,16 +14,16 @@
14
14
  tn_sites: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Site><Id>1435</Id><Name>Sales Training</Name></Site>"
15
15
  tn_sip_peers: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><SipPeer><Id>4064</Id><Name>Sales</Name></SipPeer>"
16
16
  tn_rate_center: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><TelephoneNumberResponse><TelephoneNumberDetails><State>CO</State><RateCenter>DENVER</RateCenter></TelephoneNumberDetails></TelephoneNumberResponse>"
17
- 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>"
17
+ tn_reservation: "<?xml version=\"1.0\" encoding=\"utf-8\"?><ReservationResponse><Reservation><Id>1</Id><ReservationId>1</ReservationId><AccountId>111</AccountId><ReservationExpires>0</ReservationExpires><ReservedTn>000</ReservedTn></Reservation></ReservationResponse>"
18
18
  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>"
19
19
  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>"
20
20
  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>"
21
21
  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>"
22
22
  file_metadata: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><FileMetaData><DocumentType>LOA</DocumentType></FileMetaData>"
23
23
  file_created: "<?xml version=\"1.0\" encoding=\"utf-8\"?><FileResult><filename>test.txt</filename></FileResult>"
24
+ order: "<?xml version=\"1.0\" encoding=\"utf-8\"?><OrderResponse><Order><id>101</id><Name>Test</Name><SiteId>10</SiteId><OrderCreateDate>2014-12-03T15:50:05.575549+03:00</OrderCreateDate><CustomerOrderId>11</CustomerOrderId></Order><CreatedByUser>test</CreatedByUser><CompletedQuantity>1</CompletedQuantity><FailedQuantity>0</FailedQuantity><PendingQuantity>0</PendingQuantity><OrderCompleteDate>0001-01-01T00:00:00</OrderCompleteDate></OrderResponse>"
24
25
  orders: "<?xml version=\"1.0\" encoding=\"utf-8\"?><OrderResponse><Orders><Order><id>101</id><Name>Test</Name><SiteId>10</SiteId><OrderCreateDate>2014-12-03T15:50:05.575549+03:00</OrderCreateDate><CustomerOrderId>11</CustomerOrderId></Order><CreatedByUser>test</CreatedByUser><CompletedQuantity>1</CompletedQuantity><FailedQuantity>0</FailedQuantity><PendingQuantity>0</PendingQuantity><OrderCompleteDate>0001-01-01T00:00:00</OrderCompleteDate></Orders></OrderResponse>"
25
- create_order_response: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><OrderResponse><Order><CustomerOrderId>123456789</CustomerOrderId><Name>Local Order</Name><OrderCreateDate>2020-05-19T00:40:38.093Z</OrderCreateDate><BackOrderRequested>false</BackOrderRequested><id>a7af704e-2ec0-4c4d-9dc5-1b77fa62c92a</id><CombinedSearchAndOrderType><AreaCode>919</AreaCode><EnableLCA>false</EnableLCA><Quantity>1</Quantity></CombinedSearchAndOrderType><PartialAllowed>true</PartialAllowed><SiteId>29976</SiteId></Order><OrderStatus>RECEIVED</OrderStatus></OrderResponse>"
26
- order: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><OrderResponse><CompletedQuantity>1</CompletedQuantity><CreatedByUser>test</CreatedByUser><LastModifiedDate>2020-05-18T15:31:07.069Z</LastModifiedDate><OrderCompleteDate>2020-05-18T15:31:07.069Z</OrderCompleteDate><Order><Name>Test</Name><OrderCreateDate>2020-05-18T15:31:05.435Z</OrderCreateDate><PeerId>577561</PeerId><BackOrderRequested>false</BackOrderRequested><AreaCodeSearchAndOrderType><AreaCode>919</AreaCode><Quantity>1</Quantity></AreaCodeSearchAndOrderType><PartialAllowed>true</PartialAllowed><SiteId>1234</SiteId></Order><OrderStatus>COMPLETE</OrderStatus><CompletedNumbers><TelephoneNumber><FullNumber>9194464166</FullNumber></TelephoneNumber></CompletedNumbers><Summary>1 number ordered in (919)</Summary><FailedQuantity>0</FailedQuantity></OrderResponse>"
26
+
27
27
  order_area_codes: "<TelephoneDetailsReports><TelephoneDetailsReport><AreaCode>888</AreaCode><Count>1</Count></TelephoneDetailsReport></TelephoneDetailsReports>"
28
28
  order_npa_nxx: "<?xml version=\"1.0\" encoding=\"utf-8\"?><TelephoneDetailsReports><TelephoneDetailsReport><NPA-NXX>888424</NPA-NXX><Count>1</Count></TelephoneDetailsReport></TelephoneDetailsReports>"
29
29
  order_totals: "<?xml version=\"1.0\" encoding=\"utf-8\"?><TelephoneDetailsReports><TelephoneDetailsReport><NPA-NXX>888424</NPA-NXX><Count>1</Count></TelephoneDetailsReport></TelephoneDetailsReports>"
@@ -47,28 +47,3 @@
47
47
  account: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><AccountResponse><Account><AccountId>14</AccountId><CompanyName>CWI Hosting</CompanyName><AccountType>Business</AccountType><NenaId></NenaId><Tiers><Tier>0</Tier></Tiers><Address><HouseNumber>60</HouseNumber><HouseSuffix></HouseSuffix><PreDirectional></PreDirectional><StreetName>Pine</StreetName><StreetSuffix>St</StreetSuffix><PostDirectional></PostDirectional><AddressLine2></AddressLine2><City>Denver</City><StateCode>CO</StateCode><Zip>80016</Zip><PlusFour></PlusFour><County></County><Country>United States</Country><AddressType>Service</AddressType></Address><Contact><FirstName>Sanjay</FirstName><LastName>Rao</LastName><Phone>9195441234</Phone><Email>srao@bandwidth.com</Email></Contact><ReservationAllowed>true</ReservationAllowed><LnpEnabled>true</LnpEnabled><AltSpid>X455</AltSpid><SPID>9999</SPID><PortCarrierType>WIRELINE</PortCarrierType></Account></AccountResponse>"
48
48
  import_tn_checker: '<?xml version="1.0" encoding="UTF-8"?><ImportTnCheckerPayload><TelephoneNumbers><TelephoneNumber>5554443333</TelephoneNumber><TelephoneNumber>5553334444</TelephoneNumber></TelephoneNumbers></ImportTnCheckerPayload>'
49
49
  csr: '<?xml version="1.0" encoding="UTF-8"?><CsrResponse><Status>RECEIVED</Status></CsrResponse>'
50
- application: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ApplicationProvisioningResponse><Application><ApplicationId>d1</ApplicationId></Application></ApplicationProvisioningResponse>'
51
- applicationList: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ApplicationProvisioningResponse><ApplicationList><Application><ApplicationId>d1</ApplicationId></Application><Application><ApplicationId>d2</ApplicationId></Application></ApplicationList></ApplicationProvisioningResponse>'
52
- applicationListOne: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ApplicationProvisioningResponse><ApplicationList><Application><ApplicationId>d1</ApplicationId></Application></ApplicationList></ApplicationProvisioningResponse>'
53
- applicationSippeers: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><AssociatedSipPeersResponse><AssociatedSipPeers><AssociatedSipPeer><SiteId>1</SiteId></AssociatedSipPeer><AssociatedSipPeer><SiteId>2</SiteId></AssociatedSipPeer></AssociatedSipPeers></AssociatedSipPeersResponse>'
54
- applicationSippeersOne: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><AssociatedSipPeersResponse><AssociatedSipPeers><AssociatedSipPeer><SiteId>1</SiteId></AssociatedSipPeer></AssociatedSipPeers></AssociatedSipPeersResponse>'
55
- sippeerOriginationSettings: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><SipPeerOriginationSettingsResponse><SipPeerOriginationSettings><VoiceProtocol>HTTP</VoiceProtocol><HttpSettings><HttpVoiceV2AppId>469ebbac-4459-4d98-bc19-a038960e787f</HttpVoiceV2AppId></HttpSettings></SipPeerOriginationSettings></SipPeerOriginationSettingsResponse>'
56
- sippeerTerminationSettings: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><SipPeerTerminationSettingsResponse><SipPeerTerminationSettings><VoiceProtocol>HTTP</VoiceProtocol><HttpSettings><HttpVoiceV2AppId>469ebbac-4459-4d98-bc19-a038960e787f</HttpVoiceV2AppId></HttpSettings></SipPeerTerminationSettings></SipPeerTerminationSettingsResponse>'
57
- sippeerSmsFeature: '<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?><SipPeerSmsFeatureResponse><SipPeerSmsFeature><SipPeerSmsFeatureSettings><TollFree>true</TollFree><ShortCode>true</ShortCode></SipPeerSmsFeatureSettings><SmppHosts><SmppHost><HostName>54.10.88.146</HostName></SmppHost></SmppHosts></SipPeerSmsFeature></SipPeerSmsFeatureResponse>'
58
- sippeerMmsFeature: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><MmsFeatureResponse><MmsFeature><MmsSettings><Protocol>MM4</Protocol></MmsSettings></MmsFeature></MmsFeatureResponse>'
59
- sippeerMmsFeatureMmsSettings: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><MmsFeatureMmsSettingsResponse><MmsSettings><Protocol>MM4</Protocol></MmsSettings></MmsFeatureMmsSettingsResponse>'
60
- messagingApplicationSettings: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ApplicationsSettingsResponse><ApplicationsSettings><HttpMessagingV2AppId>4a4ca6c1-156b-4fca-84e9-34e35e2afc32</HttpMessagingV2AppId></ApplicationsSettings></ApplicationsSettingsResponse>'
61
- sippeerMessageSettings: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><SipPeerMessagingSettingsResponse><SipPeerMessagingSettings><BreakOutCountries><Country>CAN</Country></BreakOutCountries></SipPeerMessagingSettings></SipPeerMessagingSettingsResponse>'
62
- emergencyNotificationEndpointOrders: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EmergencyNotificationEndpointOrderResponse><Links><first> -- link to first page of results -- </first> <next> -- link to next page of results -- </next> </Links> <EmergencyNotificationEndpointOrders> <EmergencyNotificationEndpointOrder> <OrderId>3e9a852e-2d1d-4e2d-84c3-87223a78cb70</OrderId> <OrderCreatedDate>2020-01-23T18:34:17.284Z</OrderCreatedDate> <CreatedBy>jgilmore</CreatedBy> <ProcessingStatus>COMPLETED</ProcessingStatus> <CustomerOrderId>ALG-31233884</CustomerOrderId> <EmergencyNotificationEndpointAssociations> <EmergencyNotificationGroup> <Identifier>3e9a852e-2d1d-4e2d-84c3-04595ba2eb93</Identifier> </EmergencyNotificationGroup> <AddedAssociations> <EepToEngAssociations> <EepTns> <TelephoneNumber>2248838829</TelephoneNumber> <TelephoneNumber>4052397735</TelephoneNumber> </EepTns> <EepAeuiIds> <Identifier>Fred992834</Identifier> <Identifier>Bob00359</Identifier> </EepAeuiIds> </EepToEngAssociations> <ErrorList /> </AddedAssociations> </EmergencyNotificationEndpointAssociations> </EmergencyNotificationEndpointOrder> <EmergencyNotificationEndpointOrder> <OrderId>3e9a852e-2d1d-4e2d-84c3-87223a78cb70</OrderId> <OrderCreatedDate>2020-01-23T18:34:17.284Z</OrderCreatedDate> <CreatedBy>jgilmore</CreatedBy> <ProcessingStatus>COMPLETED</ProcessingStatus> <CustomerOrderId>ALG-31233884</CustomerOrderId> <EmergencyNotificationEndpointAssociations> <EmergencyNotificationGroup> <Identifier>3e9a852e-2d1d-4e2d-84c3-04595ba2eb93</Identifier> </EmergencyNotificationGroup> <AddedAssociations> <EepToEngAssociations> <EepTns> <TelephoneNumber>2248838829</TelephoneNumber> <TelephoneNumber>4052397735</TelephoneNumber> </EepTns> <EepAeuiIds> <Identifier>Fred992834</Identifier> <Identifier>Bob00359</Identifier> </EepAeuiIds> </EepToEngAssociations> <ErrorList /> </AddedAssociations> </EmergencyNotificationEndpointAssociations> </EmergencyNotificationEndpointOrder> </EmergencyNotificationEndpointOrders></EmergencyNotificationEndpointOrderResponse>'
63
- emergencyNotificationEndpointOrder: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EmergencyNotificationEndpointOrderResponse> <EmergencyNotificationEndpointOrder> <OrderId>3e9a852e-2d1d-4e2d-84c3-87223a78cb70</OrderId> <OrderCreatedDate>2020-01-23T18:34:17.284Z</OrderCreatedDate> <CreatedBy>jgilmore</CreatedBy> <ProcessingStatus>COMPLETED</ProcessingStatus> <CustomerOrderId>ALG-31233884</CustomerOrderId> <EmergencyNotificationEndpointAssociations> <EmergencyNotificationGroup> <Identifier>3e9a852e-2d1d-4e2d-84c3-04595ba2eb93</Identifier> </EmergencyNotificationGroup> <AddedAssociations> <EepToEngAssociations> <EepTns> <TelephoneNumber>2248838829</TelephoneNumber> <TelephoneNumber>4052397735</TelephoneNumber> </EepTns> <EepAeuiIds> <Identifier>Fred992834</Identifier> <Identifier>Bob00359</Identifier> </EepAeuiIds> </EepToEngAssociations> <ErrorList /> </AddedAssociations> </EmergencyNotificationEndpointAssociations> </EmergencyNotificationEndpointOrder></EmergencyNotificationEndpointOrderResponse>'
64
- emergencyNotificationGroupOrders: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EmergencyNotificationGroupOrderResponse><Links><first>Link=&lt;http://localhost:8080/v1.0/accounts/12346371/emergencyNotificationGroupOrders&gt;;rel="first";</first> </Links> <EmergencyNotificationGroupOrders> <EmergencyNotificationGroupOrder><OrderId>092815dc-9ced-4d67-a070-a80eb243b914</OrderId><OrderCreatedDate>2020-04-29T15:40:01.449Z</OrderCreatedDate><CreatedBy>systemUser</CreatedBy><ProcessingStatus>COMPLETED</ProcessingStatus><CustomerOrderId>QTWeKMys</CustomerOrderId><AddedEmergencyNotificationGroup> <Identifier>6daa55e1-e499-4cf0-9f3d-9524215f1bee</Identifier> <Description>enr test description 3</Description> <AddedEmergencyNotificationRecipients> <EmergencyNotificationRecipient><Identifier>44f203915ca249b7b69bbc084af09a</Identifier><Description>TestDesc SEHsbDMM</Description><Type>SMS</Type><Sms> <TelephoneNumber>15638765448</TelephoneNumber></Sms> </EmergencyNotificationRecipient> </AddedEmergencyNotificationRecipients></AddedEmergencyNotificationGroup> </EmergencyNotificationGroupOrder> <EmergencyNotificationGroupOrder><OrderId>89b4e0a1-2789-43fb-b948-38d368159142</OrderId><OrderCreatedDate>2020-04-29T15:39:59.325Z</OrderCreatedDate><CreatedBy>systemUser</CreatedBy><ProcessingStatus>COMPLETED</ProcessingStatus><CustomerOrderId>SDWupQpf</CustomerOrderId><AddedEmergencyNotificationGroup> <Identifier>b49fa543-5bb3-4b9d-9213-96c8b63e77f5</Identifier> <Description>enr test description 2</Description> <AddedEmergencyNotificationRecipients> <EmergencyNotificationRecipient><Identifier>c719e060a6ba4212a2c0642b87a784</Identifier><Description>TestDesc zscxcAGG</Description><Type>SMS</Type><Sms> <TelephoneNumber>15678765448</TelephoneNumber></Sms> </EmergencyNotificationRecipient> <EmergencyNotificationRecipient><Identifier>93ad72dfe59c4992be6f8aa625466d</Identifier><Description>TestDesc RTflsKBz</Description><Type>TTS</Type><Tts> <TelephoneNumber>17678765449</TelephoneNumber></Tts> </EmergencyNotificationRecipient> </AddedEmergencyNotificationRecipients></AddedEmergencyNotificationGroup> </EmergencyNotificationGroupOrder> <EmergencyNotificationGroupOrder><OrderId>247d1425-4247-4b27-99d8-83ce30038b14</OrderId><OrderCreatedDate>2020-04-29T15:39:57.058Z</OrderCreatedDate><CreatedBy>systemUser</CreatedBy><ProcessingStatus>COMPLETED</ProcessingStatus><CustomerOrderId>vgshuNMB</CustomerOrderId><AddedEmergencyNotificationGroup> <Identifier>69a3d588-f314-42ca-8726-faa824bdf4be</Identifier> <Description>eng test description</Description> <AddedEmergencyNotificationRecipients> <EmergencyNotificationRecipient><Identifier>aab78f87074940f1aaaf1c9658be4b</Identifier><Description>enr test description</Description><Type>EMAIL</Type><EmailAddress>testEmail@gmail.com</EmailAddress> </EmergencyNotificationRecipient> <EmergencyNotificationRecipient><Identifier>852e9eee161b4da6823c91173b05c4</Identifier><Description>TestDesc WkHqpnNH</Description><Type>TTS</Type><Tts> <TelephoneNumber>15678765449</TelephoneNumber></Tts> </EmergencyNotificationRecipient> </AddedEmergencyNotificationRecipients></AddedEmergencyNotificationGroup> </EmergencyNotificationGroupOrder> </EmergencyNotificationGroupOrders></EmergencyNotificationGroupOrderResponse>'
65
- emergencyNotificationGroupOrder: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EmergencyNotificationGroupOrderResponse><EmergencyNotificationEndpointOrder><OrderId>900b3646-18df-4626-b237-3a8de648ebf6</OrderId> <OrderCreatedDate>2020-04-29T15:27:16.151</OrderCreatedDate> <CreatedBy>systemUser</CreatedBy> <ProcessingStatus>PROCESSING</ProcessingStatus> <CustomerOrderId>UbOxhMnp</CustomerOrderId> <AddedEmergencyNotificationGroup> <Identifier>52897b97-3592-43fe-aa3f-857cf96671ee</Identifier> <Description>JgHzUzIchD</Description> <AddedEmergencyNotificationRecipients> <EmergencyNotificationRecipient> <Identifier>c7f74671edd8410d9a4c0f8e985e0a</Identifier> </EmergencyNotificationRecipient> <EmergencyNotificationRecipient> <Identifier>74ac30535b414d29bc36d50572f553</Identifier> </EmergencyNotificationRecipient> <EmergencyNotificationRecipient> <Identifier>b910df3245ce4192aee052f583259f</Identifier> </EmergencyNotificationRecipient> </AddedEmergencyNotificationRecipients> </AddedEmergencyNotificationGroup></EmergencyNotificationEndpointOrder></EmergencyNotificationGroupOrderResponse>'
66
- emergencyNotificationGroups: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EmergencyNotificationGroupsResponse><Links><first> -- link to first page of results -- </first> <next> -- link to next page of results -- </next> </Links> <EmergencyNotificationGroups> <EmergencyNotificationGroup> <Identifier>63865500-0904-46b1-9b4f-7bd237a26363</Identifier> <CreatedDate>2020-01-23T18:34:17.284Z</CreatedDate> <ModifiedBy>jgilmore</ModifiedBy> <ModifiedDate>2020-01-23T18:34:17.284Z</ModifiedDate> <Description>This is a description of the emergency notification group.</Description> <EmergencyNotificationRecipients> <EmergencyNotificationRecipient> <Identifier>63865500-0904-46b1-9b4f-7bd237a26363</Identifier> </EmergencyNotificationRecipient> <EmergencyNotificationRecipient> <Identifier>ef47eb61-e3b1-449d-834b-0fbc5a11da30</Identifier> </EmergencyNotificationRecipient> </EmergencyNotificationRecipients> </EmergencyNotificationGroup> <EmergencyNotificationGroup> <Identifier>29477382-23947-23c-2349-aa8238b22743</Identifier> <CreatedDate>2020-01-23T18:36:51.987Z</CreatedDate> <ModifiedBy>jgilmore</ModifiedBy> <ModifiedDate>2020-01-23T18:36:51.987Z</ModifiedDate> <Description>This is a description of the emergency notification group.</Description> <EmergencyNotificationRecipients> <EmergencyNotificationRecipient> <Identifier>37742335-8722-3abc-8722-e2434f123a4d</Identifier> </EmergencyNotificationRecipient> </EmergencyNotificationRecipients> </EmergencyNotificationGroup> </EmergencyNotificationGroups></EmergencyNotificationGroupsResponse>'
67
- emergencyNotificationGroup: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EmergencyNotificationGroupsResponse><EmergencyNotificationGroup> <Identifier>63865500-0904-46b1-9b4f-7bd237a26363</Identifier> <CreatedDate>2020-01-23T18:34:17.284Z</CreatedDate> <ModifiedBy>jgilmore</ModifiedBy> <ModifiedDate>2020-01-23T18:34:17.284Z</ModifiedDate> <Description>This is a description of the emergency notification group.</Description> <EmergencyNotificationRecipients> <EmergencyNotificationRecipient> <Identifier>63865500-0904-46b1-9b4f-7bd237a26363</Identifier> </EmergencyNotificationRecipient> <EmergencyNotificationRecipient> <Identifier>ef47eb61-e3b1-449d-834b-0fbc5a11da30</Identifier> </EmergencyNotificationRecipient> </EmergencyNotificationRecipients> </EmergencyNotificationGroup></EmergencyNotificationGroupsResponse>'
68
- emergencyNotificationRecipients: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EmergencyNotificationRecipientsResponse> <Links> <first> -- link to first page of results -- </first> <next> -- link to next page of results -- </next> </Links> <EmergencyNotificationRecipients> <EmergencyNotificationRecipient> <Identifier> 63865500-0904-46b1-9b4f-7bd237a26363 </Identifier> <CreatedDate>2020-03-18T21:26:47.403Z</CreatedDate> <LastModifiedDate>2020-03-18T21:26:47.403Z</LastModifiedDate> <ModifiedByUser>jgilmore</ModifiedByUser> <Description> This is a description of the emergency notification recipient. </Description> <Type>CALLBACK</Type> <Callback> <Url>https://foo.bar/baz</Url> <Credentials> <Username>jgilmore</Username> <!-- CallbackPassword is omitted for security --> </Credentials> </Callback> </EmergencyNotificationRecipient> <EmergencyNotificationRecipient> <Identifier> 63865500-0904-46b1-9b4f-7bd237a26363 </Identifier> <CreatedDate>2020-03-22T12:13:25.782Z</CreatedDate> <LastModifiedDate>2020-03-22T12:13:25.782Z</LastModifiedDate> <ModifiedByUser>gfranklin</ModifiedByUser> <Description> This is a description of the emergency notification recipient. </Description> <Type>EMAIL</Type> <EmailAddress>fred@gmail.com</EmailAddress> </EmergencyNotificationRecipient> </EmergencyNotificationRecipients></EmergencyNotificationRecipientsResponse>'
69
- emergencyNotificationRecipient: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EmergencyNotificationRecipientsResponse> <EmergencyNotificationRecipient> <Identifier> 63865500-0904-46b1-9b4f-7bd237a26363 </Identifier> <CreatedDate>2020-03-18T21:26:47.403Z</CreatedDate> <LastModifiedDate>2020-03-18T21:26:47.403Z</LastModifiedDate> <ModifiedByUser>jgilmore</ModifiedByUser> <Description> This is a description of the emergency notification recipient. </Description> <Type>CALLBACK</Type> <Callback> <Url>https://foo.bar/baz</Url> <Credentials> <Username>jgilmore</Username> </Credentials> </Callback> </EmergencyNotificationRecipient></EmergencyNotificationRecipientsResponse>'
70
- aeuis: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><AlternateEndUserIdentifiersResponse> <TotalCount>2</TotalCount> <Links> <first>Link=&lt;http://localhost:8080/iris/accounts/14/aeuis?page=1&amp;size=500&gt;;rel="first";</first> </Links> <AlternateEndUserIdentifiers> <AlternateEndUserIdentifier> <Identifier>DavidAcid</Identifier> <CallbackNumber>8042105760</CallbackNumber> <EmergencyNotificationGroup> <Identifier>63865500-0904-46b1-9b4f-7bd237a26363</Identifier> <Description>Building 5, 5th Floor.</Description> </EmergencyNotificationGroup> </AlternateEndUserIdentifier> <AlternateEndUserIdentifier> <Identifier>JohnAcid</Identifier> <CallbackNumber>8042105618</CallbackNumber> </AlternateEndUserIdentifier> </AlternateEndUserIdentifiers></AlternateEndUserIdentifiersResponse>'
71
- aeui: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><AlternateEndUserIdentifierResponse><AlternateEndUserIdentifier> <Identifier>DavidAcid</Identifier> <CallbackNumber>8042105760</CallbackNumber> <E911> <CallerName>David</CallerName> <Address> <HouseNumber>900</HouseNumber> <HouseSuffix></HouseSuffix> <PreDirectional></PreDirectional> <StreetName>MAIN CAMPUS</StreetName> <StreetSuffix>DR</StreetSuffix> <AddressLine2></AddressLine2> <City>RALEIGH</City> <StateCode>NC</StateCode> <Zip>27606</Zip> <PlusFour>5214</PlusFour> <Country>United States</Country> <AddressType>Billing</AddressType> </Address> <EmergencyNotificationGroup> <Identifier>63865500-0904-46b1-9b4f-7bd237a26363</Identifier> <Description>Building 5, 5th Floor.</Description> </EmergencyNotificationGroup> </E911> </AlternateEndUserIdentifier></AlternateEndUserIdentifierResponse>'
72
- tnOptionOrder: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><TnOptionOrder> <OrderCreateDate>2016-01-15T11:22:58.789Z</OrderCreateDate> <AccountId>14</AccountId> <CreatedByUser>jbm</CreatedByUser> <OrderId>409033ee-88ec-43e3-85f3-538f30733963</OrderId> <LastModifiedDate>2016-01-15T11:22:58.969Z</LastModifiedDate> <ProcessingStatus>COMPLETE</ProcessingStatus> <TnOptionGroups> <TnOptionGroup> <CallingNameDisplay>on</CallingNameDisplay> <Sms>on</Sms> <TelephoneNumbers> <TelephoneNumber>2174101601</TelephoneNumber> </TelephoneNumbers> </TnOptionGroup> <TnOptionGroup> <CallingNameDisplay>off</CallingNameDisplay> <TelephoneNumbers> <TelephoneNumber>2174101602</TelephoneNumber> </TelephoneNumbers> </TnOptionGroup> <TnOptionGroup> <CallingNameDisplay>systemdefault</CallingNameDisplay> <FinalDestinationURI>sip:+12345678901@1.2.3.4:5060</FinalDestinationURI> <TelephoneNumbers> <TelephoneNumber>2174101603</TelephoneNumber> </TelephoneNumbers> </TnOptionGroup> </TnOptionGroups> <ErrorList/> <Warnings> <Warning> <TelephoneNumber>2174101601</TelephoneNumber> <Description>SMS is already Enabled or number is in processing.</Description> </Warning> </Warnings></TnOptionOrder>'
73
- tnOptionOrderResponse: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><TnOptionOrderResponse> <TnOptionOrder> <OrderCreateDate>2016-01-15T12:01:14.324Z</OrderCreateDate> <AccountId>14</AccountId> <CreatedByUser>jbm</CreatedByUser> <OrderId>ddbdc72e-dc27-490c-904e-d0c11291b095</OrderId> <LastModifiedDate>2016-01-15T12:01:14.324Z</LastModifiedDate> <ProcessingStatus>RECEIVED</ProcessingStatus> <TnOptionGroups> <TnOptionGroup> <NumberFormat>10digit</NumberFormat> <RPIDFormat>10digit</RPIDFormat> <RewriteUser>testUser1</RewriteUser> <CallForward>6042661720</CallForward> <CallingNameDisplay>on</CallingNameDisplay> <Protected>true</Protected> <Sms>on</Sms> <TelephoneNumbers> <TelephoneNumber>2018551020</TelephoneNumber> </TelephoneNumbers> </TnOptionGroup> <TnOptionGroup> <CallingNameDisplay>off</CallingNameDisplay> <Protected>false</Protected> <Sms>off</Sms> <TelephoneNumbers> <TelephoneNumber>2018551025</TelephoneNumber> </TelephoneNumbers> </TnOptionGroup> </TnOptionGroups> <ErrorList/> </TnOptionOrder></TnOptionOrderResponse>'
74
- tnOptionOrders: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><TnOptionOrders> <TotalCount>2</TotalCount> <TnOptionOrderSummary> <accountId>14</accountId> <CountOfTNs>2</CountOfTNs> <userId>jbm</userId> <lastModifiedDate>2016-01-15T12:01:14.363Z</lastModifiedDate> <OrderDate>2016-01-15T12:01:14.324Z</OrderDate> <OrderType>tn_option</OrderType> <OrderStatus>FAILED</OrderStatus> <OrderId>ddbdc72e-dc27-490c-904e-d0c11291b095</OrderId> </TnOptionOrderSummary> <TnOptionOrderSummary> <accountId>14</accountId> <CountOfTNs>3</CountOfTNs> <userId>jbm</userId> <lastModifiedDate>2016-01-15T11:22:58.969Z</lastModifiedDate> <OrderDate>2016-01-15T11:22:58.789Z</OrderDate> <OrderType>tn_option</OrderType> <OrderStatus>COMPLETE</OrderStatus> <OrderId>409033ee-88ec-43e3-85f3-538f30733963</OrderId> </TnOptionOrderSummary></TnOptionOrders>'
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: 2.7.2
4
+ version: 3.0.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Belchikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-28 00:00:00.000000000 Z
11
+ date: 2020-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -157,18 +157,14 @@ files:
157
157
  - examples/city.rb
158
158
  - examples/config.yml.example
159
159
  - examples/covered-rate-center.rb
160
- - examples/create_reservation_and_order.rb
161
160
  - examples/loa.pdf
162
161
  - examples/order.rb
163
- - examples/order_number.rb
164
162
  - examples/port-in.rb
165
163
  - examples/sip_peer.rb
166
164
  - examples/site.rb
167
165
  - examples/tn.rb
168
166
  - lib/bandwidth-iris/account.rb
169
- - lib/bandwidth-iris/aeui.rb
170
167
  - lib/bandwidth-iris/api_item.rb
171
- - lib/bandwidth-iris/applications.rb
172
168
  - lib/bandwidth-iris/available_npa_nxx.rb
173
169
  - lib/bandwidth-iris/available_number.rb
174
170
  - lib/bandwidth-iris/city.rb
@@ -179,9 +175,6 @@ files:
179
175
  - lib/bandwidth-iris/disc_number.rb
180
176
  - lib/bandwidth-iris/disconnect.rb
181
177
  - lib/bandwidth-iris/dlda.rb
182
- - lib/bandwidth-iris/emergency_notification_endpoints.rb
183
- - lib/bandwidth-iris/emergency_notification_groups.rb
184
- - lib/bandwidth-iris/emergency_notification_recipients.rb
185
178
  - lib/bandwidth-iris/errors.rb
186
179
  - lib/bandwidth-iris/import_tn_checker.rb
187
180
  - lib/bandwidth-iris/import_tn_orders.rb
@@ -196,19 +189,15 @@ files:
196
189
  - lib/bandwidth-iris/rate_center.rb
197
190
  - lib/bandwidth-iris/remove_imported_tn_orders.rb
198
191
  - lib/bandwidth-iris/sip_peer.rb
199
- - lib/bandwidth-iris/sip_peer_products.rb
200
192
  - lib/bandwidth-iris/site.rb
201
193
  - lib/bandwidth-iris/subscription.rb
202
194
  - lib/bandwidth-iris/tn.rb
203
- - lib/bandwidth-iris/tn_options.rb
204
195
  - lib/bandwidth-iris/tn_reservation.rb
205
196
  - lib/bandwidth-iris/user.rb
206
197
  - lib/bandwidth-iris/version.rb
207
198
  - lib/ruby-bandwidth-iris.rb
208
199
  - ruby-bandwidth-iris.gemspec
209
200
  - spec/bandwidth-iris/account_spec.rb
210
- - spec/bandwidth-iris/aeui_spec.rb
211
- - spec/bandwidth-iris/application_spec.rb
212
201
  - spec/bandwidth-iris/available_npa_nxx_spec.rb
213
202
  - spec/bandwidth-iris/available_number_spec.rb
214
203
  - spec/bandwidth-iris/city_spec.rb
@@ -218,9 +207,6 @@ files:
218
207
  - spec/bandwidth-iris/disc_number_spec.rb
219
208
  - spec/bandwidth-iris/disconnect_spec.rb
220
209
  - spec/bandwidth-iris/dlda_spec.rb
221
- - spec/bandwidth-iris/emergency_notification_endpoints_spec.rb
222
- - spec/bandwidth-iris/emergency_notification_groups_spec.rb
223
- - spec/bandwidth-iris/emergency_notification_recipients_spec.rb
224
210
  - spec/bandwidth-iris/import_tn_checker_spec.rb
225
211
  - spec/bandwidth-iris/import_tn_orders_spec.rb
226
212
  - spec/bandwidth-iris/import_to_account_spec.rb
@@ -233,11 +219,9 @@ files:
233
219
  - spec/bandwidth-iris/port_out_spec.rb
234
220
  - spec/bandwidth-iris/rate_center_spec.rb
235
221
  - spec/bandwidth-iris/remove_imported_tn_orders_spec.rb
236
- - spec/bandwidth-iris/sip_peer_products_spec.rb
237
222
  - spec/bandwidth-iris/sip_peer_spec.rb
238
223
  - spec/bandwidth-iris/site_spec.rb
239
224
  - spec/bandwidth-iris/subscription_spec.rb
240
- - spec/bandwidth-iris/tn_options_spec.rb
241
225
  - spec/bandwidth-iris/tn_reservation_spec.rb
242
226
  - spec/bandwidth-iris/tn_spec.rb
243
227
  - spec/bandwidth-iris/user_spec.rb
@@ -258,9 +242,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
258
242
  version: '0'
259
243
  required_rubygems_version: !ruby/object:Gem::Requirement
260
244
  requirements:
261
- - - ">="
245
+ - - ">"
262
246
  - !ruby/object:Gem::Version
263
- version: '0'
247
+ version: 1.3.1
264
248
  requirements: []
265
249
  rubygems_version: 3.0.6
266
250
  signing_key:
@@ -268,8 +252,6 @@ specification_version: 4
268
252
  summary: Gem for integrating to Bandwidth's Iris API
269
253
  test_files:
270
254
  - spec/bandwidth-iris/account_spec.rb
271
- - spec/bandwidth-iris/aeui_spec.rb
272
- - spec/bandwidth-iris/application_spec.rb
273
255
  - spec/bandwidth-iris/available_npa_nxx_spec.rb
274
256
  - spec/bandwidth-iris/available_number_spec.rb
275
257
  - spec/bandwidth-iris/city_spec.rb
@@ -279,9 +261,6 @@ test_files:
279
261
  - spec/bandwidth-iris/disc_number_spec.rb
280
262
  - spec/bandwidth-iris/disconnect_spec.rb
281
263
  - spec/bandwidth-iris/dlda_spec.rb
282
- - spec/bandwidth-iris/emergency_notification_endpoints_spec.rb
283
- - spec/bandwidth-iris/emergency_notification_groups_spec.rb
284
- - spec/bandwidth-iris/emergency_notification_recipients_spec.rb
285
264
  - spec/bandwidth-iris/import_tn_checker_spec.rb
286
265
  - spec/bandwidth-iris/import_tn_orders_spec.rb
287
266
  - spec/bandwidth-iris/import_to_account_spec.rb
@@ -294,11 +273,9 @@ test_files:
294
273
  - spec/bandwidth-iris/port_out_spec.rb
295
274
  - spec/bandwidth-iris/rate_center_spec.rb
296
275
  - spec/bandwidth-iris/remove_imported_tn_orders_spec.rb
297
- - spec/bandwidth-iris/sip_peer_products_spec.rb
298
276
  - spec/bandwidth-iris/sip_peer_spec.rb
299
277
  - spec/bandwidth-iris/site_spec.rb
300
278
  - spec/bandwidth-iris/subscription_spec.rb
301
- - spec/bandwidth-iris/tn_options_spec.rb
302
279
  - spec/bandwidth-iris/tn_reservation_spec.rb
303
280
  - spec/bandwidth-iris/tn_spec.rb
304
281
  - spec/bandwidth-iris/user_spec.rb
@@ -1,79 +0,0 @@
1
- lib = File.expand_path("../../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
-
4
- require 'ruby-bandwidth-iris'
5
-
6
- $bandwidth_account_id = ENV['BANDWIDTH_ACCOUNT_ID']
7
- $bandwidth_user_name = ENV['BANDWIDTH_API_USER']
8
- $bandwidth_password = ENV['BANDWIDTH_API_PASSWORD']
9
- ## Fill these in
10
- $bandwidth_site_id = ENV['BANDWIDTH_SITE_ID']
11
- $bandwidth_to_sippeer_id = ENV['BANDWIDTH_SIPPEER_ID']
12
-
13
-
14
- def get_order_by_id(client, order_id:, attempts: 0)
15
- begin
16
- order_result = BandwidthIris::Order.get(client, order_id)
17
- return order_result
18
- rescue Exception => e
19
- if attempts > 3
20
- puts("Completely Failed fetching Order")
21
- raise StandardError.new e
22
- end
23
- puts("Error Message: #{e.message}")
24
- attempts = attempts+1
25
- sleep(1)
26
- return get_order_by_id(client, order_id: order_id, attempts: attempts)
27
- end
28
- end
29
-
30
- def get_numbers_from_order_id(client, order_id:)
31
- order = BandwidthIris::Order.new({:id => order_id}, client)
32
- numbers_result = order.get_tns
33
- return numbers_result
34
- end
35
-
36
- def order_numbers_with_reservation_id(client, reservation_id:, number:)
37
- order_data = {
38
- :name => "Reservation Test",
39
- :site_id => $bandwidth_site_id,
40
- :existing_telephone_number_order_type => {
41
- :telephone_number_list => [
42
- :telephone_number => number
43
- ],
44
- :reservation_id_list => [
45
- :reservation_id => reservation_id
46
- ]
47
- }
48
- }
49
- order_result = BandwidthIris::Order.create(client, order_data)
50
- return order_result
51
- end
52
-
53
- def reserve_numbers(client, number:)
54
- reservation = BandwidthIris::TnReservation.create(client, number)
55
- return reservation
56
- end
57
-
58
- def search_numbers(client, area_code: 919)
59
- list = BandwidthIris::AvailableNumber.list(client, {:area_code => area_code, :quantity => 5})
60
- return list
61
- end
62
-
63
- def main()
64
- client = BandwidthIris::Client.new($bandwidth_account_id, $bandwidth_user_name, $bandwidth_password)
65
- available_numbers = search_numbers(client)
66
- number = available_numbers[0]
67
- reservation = reserve_numbers(client, number: number)
68
- reservation_id = reservation.id
69
- order = order_numbers_with_reservation_id(client, reservation_id: reservation_id, number: number)
70
- order_id = order.id
71
- puts(order_id)
72
- my_order = get_order_by_id(client, order_id: order_id)
73
- my_numbers = get_numbers_from_order_id(client, order_id:order_id)
74
- puts(my_numbers)
75
- end
76
-
77
- if __FILE__ == $0
78
- main
79
- end