ruby-bandwidth-iris 2.6.0 → 2.7.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: fd0a2a83930a907b646fd60cd8a9022a112f57639316cfb5f72f8779620dd8cb
4
- data.tar.gz: 7ec3e412315f790aa7dfc91fec9bed550d9df9c1b782ef4dbfa60ab54348dada
3
+ metadata.gz: fbe7fbc5dcefe17806397fdf31f547dca15ca31abe404cfd89916531885ca901
4
+ data.tar.gz: 21618c8c74f583fab7e9ddb7c5d6d689128fbcfc853d450e215972deca18e9f3
5
5
  SHA512:
6
- metadata.gz: 8de965b470519e1855a25aaeaa212725e95c12e798805858f2a1d2256f3d666bd225b477a6e900f4c01c3037e18cf245d256cae41bb5b5cea095797750f41697
7
- data.tar.gz: f581771fb98683cc909c7feef6dc598e6d427d8dbfd5f38a87798507406a0b5fcd5fcc81664cbc09d1d0d6b848bc15c1501bc6ca8a305bdbfbd32992f2a9423b
6
+ metadata.gz: 1df9daf8667a8b098a0fb4fff416d9b3529364f9d7eee08c342297c2489142bc465f5efbac7d8f0e1d386c04c7e742073aeed8601314e7e1a412f8d25f3ce681
7
+ data.tar.gz: 2c2359325581abc5d177334bf3e5f463973f1e2055fb3b433c8150f474fb024164b427843478910c6a019cf4d93ebfd2664b89794be647441b811d6c71fc965c
data/README.md CHANGED
@@ -17,6 +17,7 @@ Ruby Client library for IRIS / BBS API
17
17
  | 2.4.0.pre | Added application management and sippeer products endpoints |
18
18
  | 2.5.0 | Added `get_order_response` to pull full `<OrderResponse>` object from API, added `id` back to order object on get requests. Fixed TN Reservation and updated tests to match reality |
19
19
  | 2.6.0 | Added Emergency Calling Notification, Emergeny Notification Group, Emergency Notification Endpoint, and Alternate End User Identity methods |
20
+ | 2.7.0 | Added TNOptions endpoints |
20
21
 
21
22
  ## Install
22
23
 
@@ -1236,3 +1237,94 @@ puts aeuis
1236
1237
  aeui = AlternateEndUserIdentity.get_alternate_caller_information("id")
1237
1238
  puts aeui
1238
1239
  ```
1240
+
1241
+ ## TN Option Orders
1242
+
1243
+ ### Get TN Option Orders
1244
+
1245
+ ```ruby
1246
+ orders = BandwidthIris::TnOptions.get_tn_option_orders()
1247
+ puts orders
1248
+ ```
1249
+
1250
+ ### Get TN Option Order
1251
+
1252
+ ```ruby
1253
+ order = BandwidthIris::TnOptions.get_tn_option_order("order_id")
1254
+ puts order
1255
+ ```
1256
+
1257
+ ### Get TN Option Order (error)
1258
+
1259
+ ```ruby
1260
+ begin
1261
+ order = BandwidthIris::TnOptions.get_tn_option_order("error_id")
1262
+ rescue BandwidthIris::Errors::GenericError => e
1263
+ puts e
1264
+ end
1265
+ ```
1266
+
1267
+ ### Create PortOut Passcode
1268
+
1269
+ ```ruby
1270
+ data = {
1271
+ :customer_order_id => "custom order",
1272
+ :tn_option_groups => {
1273
+ :tn_option_group => [
1274
+ {
1275
+ :port_out_passcode => "12abd38",
1276
+ :telephone_numbers => {
1277
+ :telephone_number => ["2018551020"]
1278
+ }
1279
+ }
1280
+ ]
1281
+ }
1282
+ }
1283
+
1284
+
1285
+ order = BandwidthIris::TnOptions.create_tn_option_order(data)
1286
+ puts order
1287
+ ```
1288
+
1289
+ ### Create Call Forward Number
1290
+
1291
+ ```ruby
1292
+ data = {
1293
+ :customer_order_id => "custom order",
1294
+ :tn_option_groups => {
1295
+ :tn_option_group => [
1296
+ {
1297
+ :call_forward => "2018551022",
1298
+ :telephone_numbers => {
1299
+ :telephone_number => ["2018551020"]
1300
+ }
1301
+ }
1302
+ ]
1303
+ }
1304
+ }
1305
+
1306
+
1307
+ order = BandwidthIris::TnOptions.create_tn_option_order(data)
1308
+ puts order
1309
+ ```
1310
+ ### Enable SMS
1311
+
1312
+ ```ruby
1313
+ data = {
1314
+ :customer_order_id => "custom order",
1315
+ :tn_option_groups => {
1316
+ :tn_option_group => [
1317
+ {
1318
+ :sms => "on",
1319
+ :telephone_numbers => {
1320
+ :telephone_number => ["2018551020"]
1321
+ }
1322
+ }
1323
+ ]
1324
+ }
1325
+ }
1326
+
1327
+
1328
+ order = BandwidthIris::TnOptions.create_tn_option_order(data)
1329
+ puts order
1330
+ ```
@@ -32,6 +32,7 @@ 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'
35
36
  faraday.use FaradayMiddleware::FollowRedirects
36
37
  @set_adapter.call(faraday)
37
38
  }
@@ -0,0 +1,26 @@
1
+ module BandwidthIris
2
+ TN_OPTIONS_PATH = 'tnoptions'
3
+
4
+ class TnOptions
5
+ extend ClientWrapper
6
+ include ApiItem
7
+
8
+ def self.get_tn_option_orders(client, query = nil)
9
+ response = client.make_request(:get, "#{client.concat_account_path(TN_OPTIONS_PATH)}", query)
10
+ return response[0]
11
+ end
12
+ wrap_client_arg :get_tn_option_orders
13
+
14
+ def self.create_tn_option_order(client, data)
15
+ response = client.make_request(:post, "#{client.concat_account_path(TN_OPTIONS_PATH)}", {:tn_option_order => data})
16
+ return response[0][:tn_option_order]
17
+ end
18
+ wrap_client_arg :create_tn_option_order
19
+
20
+ def self.get_tn_option_order(client, order_id)
21
+ response = client.make_request(:get, "#{client.concat_account_path(TN_OPTIONS_PATH)}/#{order_id}")
22
+ return response[0]
23
+ end
24
+ wrap_client_arg :get_tn_option_order
25
+ end
26
+ end
@@ -1,4 +1,4 @@
1
1
  module BandwidthIris
2
2
  # Version of this gem
3
- VERSION = "2.6.0"
3
+ VERSION = "2.7.0"
4
4
  end
@@ -36,5 +36,6 @@ require 'bandwidth-iris/emergency_notification_endpoints'
36
36
  require 'bandwidth-iris/emergency_notification_groups'
37
37
  require 'bandwidth-iris/emergency_notification_recipients'
38
38
  require 'bandwidth-iris/aeui'
39
+ require 'bandwidth-iris/tn_options'
39
40
 
40
41
  require 'bandwidth-iris/version'
@@ -0,0 +1,42 @@
1
+ describe BandwidthIris::TnOptions 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 "#tnOptionOrders" do
13
+ it "should get tn option orders" do
14
+ client.stubs.get("/v1.0/accounts/accountId/tnoptions"){|env| [200, {}, Helper.xml['tnOptionOrders']]}
15
+ orders = TnOptions.get_tn_option_orders(client)
16
+ expect(orders[:tn_option_order_summary][0][:account_id]).to eql(14)
17
+ end
18
+
19
+ it "should create tn option order" do
20
+ data = {
21
+ :customer_order_id => "12345",
22
+ :tn_option_groups => {
23
+ :tn_option_group => [
24
+ {
25
+ :number_format => "10digit",
26
+ :RPIDFormat => "10digit"
27
+ }
28
+ ]
29
+ }
30
+ }
31
+ client.stubs.post("/v1.0/accounts/accountId/tnoptions", client.build_xml({:tn_option_order => data})){|env| [200, {}, Helper.xml['tnOptionOrderResponse']]}
32
+ order = TnOptions.create_tn_option_order(client, data)
33
+ expect(order[:account_id]).to eql(14)
34
+ end
35
+
36
+ it "should get tn option order" do
37
+ client.stubs.get("/v1.0/accounts/accountId/tnoptions/id"){|env| [200, {}, Helper.xml['tnOptionOrder']]}
38
+ order = TnOptions.get_tn_option_order(client, "id")
39
+ expect(order[:account_id]).to eql(14)
40
+ end
41
+ end
42
+ end
@@ -69,3 +69,6 @@
69
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
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
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.6.0
4
+ version: 2.7.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-06-09 00:00:00.000000000 Z
11
+ date: 2020-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -200,6 +200,7 @@ files:
200
200
  - lib/bandwidth-iris/site.rb
201
201
  - lib/bandwidth-iris/subscription.rb
202
202
  - lib/bandwidth-iris/tn.rb
203
+ - lib/bandwidth-iris/tn_options.rb
203
204
  - lib/bandwidth-iris/tn_reservation.rb
204
205
  - lib/bandwidth-iris/user.rb
205
206
  - lib/bandwidth-iris/version.rb
@@ -236,6 +237,7 @@ files:
236
237
  - spec/bandwidth-iris/sip_peer_spec.rb
237
238
  - spec/bandwidth-iris/site_spec.rb
238
239
  - spec/bandwidth-iris/subscription_spec.rb
240
+ - spec/bandwidth-iris/tn_options_spec.rb
239
241
  - spec/bandwidth-iris/tn_reservation_spec.rb
240
242
  - spec/bandwidth-iris/tn_spec.rb
241
243
  - spec/bandwidth-iris/user_spec.rb
@@ -296,6 +298,7 @@ test_files:
296
298
  - spec/bandwidth-iris/sip_peer_spec.rb
297
299
  - spec/bandwidth-iris/site_spec.rb
298
300
  - spec/bandwidth-iris/subscription_spec.rb
301
+ - spec/bandwidth-iris/tn_options_spec.rb
299
302
  - spec/bandwidth-iris/tn_reservation_spec.rb
300
303
  - spec/bandwidth-iris/tn_spec.rb
301
304
  - spec/bandwidth-iris/user_spec.rb