ruby-bandwidth-iris 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c3d3a94981e3e3ec40dad3670799281a661d200e80614973326c4cb059a8adb
4
- data.tar.gz: d986dd6e52fc04e7f1f648c3a9e45560326da65a5c91208c89f33d09b1eda811
3
+ metadata.gz: 7b1159ee27c2a2ee423bdd0ce54a1b0943749127da435a611eeb113dec178ad0
4
+ data.tar.gz: a7e09992b64e938a9dc1c3943ee8be92dc9d6b8a1ed9d3b722268879a35779bd
5
5
  SHA512:
6
- metadata.gz: 4b0429508a83ff431fc0b29708a78fd64e280650677d1421a08c30e9773224f82f2dc902205c75ceefc46df861104c5d665c0f385c5fdf70d4db79d3f74bb4c0
7
- data.tar.gz: 93e9df992af04de3221534fda2c8dac0d74f0e6472322b05e75f8685a313734f9851f157d068bd6f69113d1ce3cc796c02d3efac8ab151f538e5fd16d2887385
6
+ metadata.gz: bc146c9252add1af25853dd70416d790ba9bb5ad8b74adb6f1575e95b754cd6dcf5d5875112060b643493fcc4b970df156c8d8072db1d054c8f68a6c49faaf87
7
+ data.tar.gz: 33db19d5c8f58b4632206a82333fd526b708726b8fbed3d71ba8efe6841708a19d29e66e2a9f1357f7a3caab668c2ff132422e34116e45bbdc33b3c7aee79516
data/README.md CHANGED
@@ -11,6 +11,7 @@ Ruby Client library for IRIS / BBS API
11
11
  | 1.0.5 | Fixed incorrect generation of XML for a Disconnect request |
12
12
  | 2.0.0 | Added `importTnOrders`, `removeImportedTnOrders`, `inserviceNumbers`, and `importTnChecker` endpoints. This release also changed the response body of `BandwidthIris::InServiceNumber.list()`. Please make sure to update your code to include this change. |
13
13
  | 2.0.1 | Updated gem dependencies to be less restrictive |
14
+ | 2.1.0 | Added `csrs` endpoints |
14
15
 
15
16
  ## Install
16
17
 
@@ -694,3 +695,65 @@ remove_imported_tn_order = {
694
695
  response = BandwidthIris::RemoveImportedTnOrders.create_remove_imported_tn_order(remove_imported_tn_order)
695
696
  puts response
696
697
  ```
698
+
699
+ ## CSR
700
+
701
+ ### Create CSR Order
702
+
703
+ ```ruby
704
+ csr_data = {
705
+ :customer_order_id => "order id",
706
+ :working_or_billing_telephone_number => "5554443333"
707
+ }
708
+
709
+ response = BandwidthIris::Csr.create(csr_data)
710
+ puts response[0][:order_id]
711
+ ```
712
+
713
+ ### Replace CSR Order
714
+
715
+ ```ruby
716
+ csr_data = {
717
+ :customer_order_id => "order id",
718
+ :working_or_billing_telephone_number => "5554443333"
719
+ }
720
+
721
+ response = BandwidthIris::Csr.replace("csr_id", csr_data)
722
+ puts response[0][:order_id]
723
+ ```
724
+
725
+ ### Get CSR Order
726
+
727
+ ```ruby
728
+ response = BandwidthIris::Csr.get("csr_id")
729
+ puts response[0][:order_id]
730
+ ```
731
+
732
+ ### Get CSR Order Notes
733
+
734
+ ```ruby
735
+ response = BandwidthIris::Csr.get_notes("csr_id")
736
+ puts response[0][:note][0][:id]
737
+ ```
738
+
739
+ ### Add CSR Order Note
740
+
741
+ ```ruby
742
+ note_data = {
743
+ :user_id => "id",
744
+ :description => "description"
745
+ }
746
+
747
+ BandwidthIris::Csr.add_note("csr_id", note_data)
748
+ ```
749
+
750
+ ### Update CSR Order Note
751
+
752
+ ```ruby
753
+ note_data = {
754
+ :user_id => "id",
755
+ :description => "description"
756
+ }
757
+
758
+ BandwidthIris::Csr.update_note("csr_id", "note_id", note_data)
759
+ ```
@@ -0,0 +1,44 @@
1
+ module BandwidthIris
2
+ CSR_PATH = 'csrs'
3
+
4
+ class Csr
5
+ extend ClientWrapper
6
+ include ApiItem
7
+
8
+ def self.create(client, csr_data)
9
+ data = client.make_request(:post, client.concat_account_path("#{CSR_PATH}"), {:csr => csr_data})
10
+ return data
11
+ end
12
+ wrap_client_arg :create
13
+
14
+ def self.get(client, csr_id)
15
+ data = client.make_request(:get, client.concat_account_path("#{CSR_PATH}/#{csr_id}"))
16
+ return data
17
+ end
18
+ wrap_client_arg :get
19
+
20
+ def self.replace(client, csr_id, csr_data)
21
+ data = client.make_request(:put, client.concat_account_path("#{CSR_PATH}/#{csr_id}"), {:csr => csr_data})
22
+ return data
23
+ end
24
+ wrap_client_arg :replace
25
+
26
+ def self.get_notes(client, csr_id)
27
+ data = client.make_request(:get, client.concat_account_path("#{CSR_PATH}/#{csr_id}/notes"))
28
+ return data
29
+ end
30
+ wrap_client_arg :get_notes
31
+
32
+ def self.add_note(client, csr_id, note_data)
33
+ data = client.make_request(:post, client.concat_account_path("#{CSR_PATH}/#{csr_id}/notes"), {:note => note_data})
34
+ return data
35
+ end
36
+ wrap_client_arg :add_note
37
+
38
+ def self.update_note(client, csr_id, note_id, note_data)
39
+ data = client.make_request(:put, client.concat_account_path("#{CSR_PATH}/#{csr_id}/notes/#{note_id}"), {:note => note_data})
40
+ return data
41
+ end
42
+ wrap_client_arg :update_note
43
+ end
44
+ end
@@ -1,4 +1,4 @@
1
1
  module BandwidthIris
2
2
  # Version of this gem
3
- VERSION = "2.0.1"
3
+ VERSION = "2.1.0"
4
4
  end
@@ -29,5 +29,6 @@ require 'bandwidth-iris/user'
29
29
  require 'bandwidth-iris/import_tn_orders'
30
30
  require 'bandwidth-iris/import_tn_checker'
31
31
  require 'bandwidth-iris/remove_imported_tn_orders'
32
+ require 'bandwidth-iris/csr'
32
33
 
33
34
  require 'bandwidth-iris/version'
@@ -0,0 +1,73 @@
1
+ describe BandwidthIris::Csr do
2
+ client = nil
3
+
4
+ before :each do
5
+ client = Helper.get_client()
6
+ end
7
+
8
+ after :each do
9
+ client.stubs.verify_stubbed_calls()
10
+ end
11
+
12
+ describe '#create' do
13
+ it 'should create a csr' do
14
+ data = {
15
+ :customer_order_id => "123",
16
+ :working_or_billing_telephone_number => "5554443333"
17
+ }
18
+ client.stubs.post("/v1.0/accounts/accountId/csrs", client.build_xml({:csr => data})) {|env| [200, {}, Helper.xml['csr']]}
19
+ item = BandwidthIris::Csr.create(client, data)
20
+ expect(item[0][:status]).to eql("RECEIVED")
21
+ end
22
+ end
23
+
24
+ describe '#get' do
25
+ it 'should get a csr' do
26
+ client.stubs.get("/v1.0/accounts/accountId/csrs/123") {|env| [200, {}, Helper.xml['csr']]}
27
+ item = BandwidthIris::Csr.get(client, "123")
28
+ expect(item[0][:status]).to eql("RECEIVED")
29
+ end
30
+ end
31
+
32
+ describe '#replace' do
33
+ it 'should replace a csr' do
34
+ data = {
35
+ :customer_order_id => "123",
36
+ :working_or_billing_telephone_number => "5554443333"
37
+ }
38
+ client.stubs.put("/v1.0/accounts/accountId/csrs/123", client.build_xml({:csr => data})) {|env| [200, {}, Helper.xml['csr']]}
39
+ item = BandwidthIris::Csr.replace(client, "123", data)
40
+ expect(item[0][:status]).to eql("RECEIVED")
41
+ end
42
+ end
43
+
44
+ describe '#getnotes' do
45
+ it 'should get csr notes' do
46
+ client.stubs.get("/v1.0/accounts/accountId/csrs/123/notes") {|env| [200, {}, Helper.xml['notes']]}
47
+ item = BandwidthIris::Csr.get_notes(client, "123")
48
+ expect(item[0][:note][0][:id]).to eql(11299)
49
+ end
50
+ end
51
+
52
+ describe '#addnote' do
53
+ it 'should add csr note' do
54
+ data = {
55
+ :user_id => "id",
56
+ :description => "description"
57
+ }
58
+ client.stubs.post("/v1.0/accounts/accountId/csrs/123/notes", client.build_xml({:note => data})) {|env| [200, {}, ""]}
59
+ BandwidthIris::Csr.add_note(client, "123", data)
60
+ end
61
+ end
62
+
63
+ describe '#updatenote' do
64
+ it 'should update csr note' do
65
+ data = {
66
+ :user_id => "id",
67
+ :description => "description"
68
+ }
69
+ client.stubs.put("/v1.0/accounts/accountId/csrs/123/notes/456", client.build_xml({:note => data})) {|env| [200, {}, ""]}
70
+ BandwidthIris::Csr.update_note(client, "123", "456", data)
71
+ end
72
+ end
73
+ end
data/spec/xml.yml CHANGED
@@ -46,3 +46,4 @@
46
46
  lsr_orders: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><LsrOrders><TotalCount>5</TotalCount><LsrOrderSummary><accountId>9999999</accountId><CountOfTNs>2</CountOfTNs><CustomerOrderId>FineCustomerid</CustomerOrderId><userId>team_ua</userId><lastModifiedDate>2015-03-02T09:10:16.193Z</lastModifiedDate><OrderType>lsr</OrderType><OrderDate>2015-03-25T11:44:42.941Z</OrderDate><OrderStatus>PENDING</OrderStatus><ActualFocDate>2015-03-25</ActualFocDate><BillingTelephoneNumber>2526795000</BillingTelephoneNumber><CreatedByUser>lsrOnlyUser</CreatedByUser><OrderId>7d644c88-ef23-4307-96ab-20253666d0c7</OrderId><Pon>ATT-011515-324234</Pon><PonVersion>0</PonVersion><RequestedFocDate>2015-11-15</RequestedFocDate></LsrOrderSummary><!-- SNIP --><LsrOrderSummary><accountId>9999999</accountId><CountOfTNs>2</CountOfTNs><CustomerOrderId>MyId5</CustomerOrderId><lastModifiedDate>2015-03-03T14:07:19.926Z</lastModifiedDate><OrderType>lsr</OrderType><OrderDate>2015-03-25T11:44:42.941Z</OrderDate><OrderStatus>NEW</OrderStatus><ActualFocDate>2015-03-25</ActualFocDate><BillingTelephoneNumber>2526795000</BillingTelephoneNumber><CreatedByUser>lsrOnlyUser</CreatedByUser><OrderId>00cf7e08-cab0-4515-9a77-2d0a7da09415</OrderId><Pon>testpon1002</Pon><PonVersion>0</PonVersion><RequestedFocDate>2015-11-15</RequestedFocDate></LsrOrderSummary></LsrOrders>"
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
+ csr: '<?xml version="1.0" encoding="UTF-8"?><CsrResponse><Status>RECEIVED</Status></CsrResponse>'
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.0.1
4
+ version: 2.1.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: 2020-02-26 00:00:00.000000000 Z
11
+ date: 2020-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -171,6 +171,7 @@ files:
171
171
  - lib/bandwidth-iris/client.rb
172
172
  - lib/bandwidth-iris/client_wrapper.rb
173
173
  - lib/bandwidth-iris/covered_rate_center.rb
174
+ - lib/bandwidth-iris/csr.rb
174
175
  - lib/bandwidth-iris/disc_number.rb
175
176
  - lib/bandwidth-iris/disconnect.rb
176
177
  - lib/bandwidth-iris/dlda.rb
@@ -202,6 +203,7 @@ files:
202
203
  - spec/bandwidth-iris/city_spec.rb
203
204
  - spec/bandwidth-iris/client_spec.rb
204
205
  - spec/bandwidth-iris/covered_rate_center_spec.rb
206
+ - spec/bandwidth-iris/csr_spec.rb
205
207
  - spec/bandwidth-iris/disc_number_spec.rb
206
208
  - spec/bandwidth-iris/disconnect_spec.rb
207
209
  - spec/bandwidth-iris/dlda_spec.rb
@@ -255,6 +257,7 @@ test_files:
255
257
  - spec/bandwidth-iris/city_spec.rb
256
258
  - spec/bandwidth-iris/client_spec.rb
257
259
  - spec/bandwidth-iris/covered_rate_center_spec.rb
260
+ - spec/bandwidth-iris/csr_spec.rb
258
261
  - spec/bandwidth-iris/disc_number_spec.rb
259
262
  - spec/bandwidth-iris/disconnect_spec.rb
260
263
  - spec/bandwidth-iris/dlda_spec.rb