ruby-bandwidth-iris 2.7.2 → 3.0.0.pre
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 +4 -4
- data/.gitignore +0 -1
- data/README.md +36 -515
- data/lib/bandwidth-iris/client.rb +4 -25
- data/lib/bandwidth-iris/order.rb +0 -15
- data/lib/bandwidth-iris/tn_reservation.rb +2 -4
- data/lib/bandwidth-iris/version.rb +1 -1
- data/lib/ruby-bandwidth-iris.rb +0 -7
- data/spec/bandwidth-iris/client_spec.rb +0 -35
- data/spec/bandwidth-iris/order_spec.rb +9 -18
- data/spec/bandwidth-iris/tn_reservation_spec.rb +5 -5
- data/spec/xml.yml +3 -28
- metadata +4 -27
- data/examples/create_reservation_and_order.rb +0 -79
- data/examples/order_number.rb +0 -83
- data/lib/bandwidth-iris/aeui.rb +0 -20
- data/lib/bandwidth-iris/applications.rb +0 -61
- data/lib/bandwidth-iris/emergency_notification_endpoints.rb +0 -26
- data/lib/bandwidth-iris/emergency_notification_groups.rb +0 -39
- data/lib/bandwidth-iris/emergency_notification_recipients.rb +0 -37
- data/lib/bandwidth-iris/sip_peer_products.rb +0 -118
- data/lib/bandwidth-iris/tn_options.rb +0 -26
- data/spec/bandwidth-iris/aeui_spec.rb +0 -25
- data/spec/bandwidth-iris/application_spec.rb +0 -90
- data/spec/bandwidth-iris/emergency_notification_endpoints_spec.rb +0 -35
- data/spec/bandwidth-iris/emergency_notification_groups_spec.rb +0 -48
- data/spec/bandwidth-iris/emergency_notification_recipients_spec.rb +0 -48
- data/spec/bandwidth-iris/sip_peer_products_spec.rb +0 -162
- data/spec/bandwidth-iris/tn_options_spec.rb +0 -42
data/examples/order_number.rb
DELETED
@@ -1,83 +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
|
-
def order_numbers_in_area_code(client, site_id:, sippeer_id:, area_code: 919, quantity: 1)
|
7
|
-
order_data = {
|
8
|
-
:name => "Test",
|
9
|
-
:site_id => site_id,
|
10
|
-
:area_code_search_and_order_type => {
|
11
|
-
:area_code => area_code,
|
12
|
-
:quantity => quantity
|
13
|
-
}
|
14
|
-
}
|
15
|
-
order_result = BandwidthIris::Order.create(client, order_data)
|
16
|
-
order_id = order_result.to_data[:id]
|
17
|
-
return order_id
|
18
|
-
end
|
19
|
-
|
20
|
-
def get_order_by_id(client, order_id:, attempts: 0)
|
21
|
-
begin
|
22
|
-
order_result = BandwidthIris::Order.get(client, order_id)
|
23
|
-
return order_result
|
24
|
-
rescue Exception => e
|
25
|
-
if attempts > 3
|
26
|
-
puts("Completely Failed fetching Order")
|
27
|
-
raise StandardError.new e
|
28
|
-
end
|
29
|
-
puts("Error Message: #{e.message}\nCode:#{e.code}")
|
30
|
-
attempts = attempts+1
|
31
|
-
sleep(1)
|
32
|
-
return get_order_by_id(client, order_id: order_id, attempts: attempts)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def get_order_response_by_id(client, order_id:, attempts: 0)
|
37
|
-
begin
|
38
|
-
order_response = BandwidthIris::Order.get_order_response(client, order_id)
|
39
|
-
order_data = order_response.to_data
|
40
|
-
numbers = order_response.completed_numbers
|
41
|
-
completed_number = order_data[:completed_numbers][:telephone_number][:full_number]
|
42
|
-
return order_data
|
43
|
-
rescue Exception => e
|
44
|
-
if attempts > 3
|
45
|
-
puts("Completely Failed fetching Order")
|
46
|
-
raise StandardError.new e
|
47
|
-
end
|
48
|
-
puts("Error Message: #{e.message}\nCode:#{e.code}")
|
49
|
-
attempts = attempts+1
|
50
|
-
sleep(1)
|
51
|
-
return get_order_response(client, order_id: order_id, attempts: attempts)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
|
56
|
-
def get_numbers_from_order_id(client, order_id:)
|
57
|
-
order = BandwidthIris::Order.new({:id => order_id}, client)
|
58
|
-
numbers_result = order.get_tns
|
59
|
-
return numbers_result
|
60
|
-
end
|
61
|
-
|
62
|
-
def get_numbers_from_order(order)
|
63
|
-
numbers_result = order.get_tns
|
64
|
-
return numbers_result
|
65
|
-
end
|
66
|
-
|
67
|
-
def main
|
68
|
-
bandwidth_account_id = ENV["BANDWIDTH_ACCOUNT_ID"]
|
69
|
-
bandwidth_user_name = ENV["BANDWIDTH_API_USER"]
|
70
|
-
bandwidth_password = ENV["BANDWIDTH_API_PASSWORD"]
|
71
|
-
bandwidth_site_id = ENV["BANDWIDTH_SITE_ID"]
|
72
|
-
bandwidth_to_sippeer_id = ENV["BANDWIDTH_SIPPEER_ID"]
|
73
|
-
client = BandwidthIris::Client.new(bandwidth_account_id, bandwidth_user_name, bandwidth_password)
|
74
|
-
order_id = order_numbers_in_area_code(client, site_id: bandwidth_site_id, sippeer_id: bandwidth_to_sippeer_id)
|
75
|
-
my_order = get_order_by_id(client, order_id: order_id)
|
76
|
-
my_order_response = get_order_response_by_id(client, order_id: order_id)
|
77
|
-
my_numbers = get_numbers_from_order_id(client, order_id:order_id)
|
78
|
-
my_numbers = get_numbers_from_order(my_order)
|
79
|
-
end
|
80
|
-
|
81
|
-
if __FILE__ == $0
|
82
|
-
main
|
83
|
-
end
|
data/lib/bandwidth-iris/aeui.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
module BandwidthIris
|
2
|
-
AEUI_PATH = 'aeuis'
|
3
|
-
|
4
|
-
class AlternateEndUserIdentity
|
5
|
-
extend ClientWrapper
|
6
|
-
include ApiItem
|
7
|
-
|
8
|
-
def self.get_alternate_end_user_information(client, query=nil)
|
9
|
-
response = client.make_request(:get, "#{client.concat_account_path(AEUI_PATH)}", query)
|
10
|
-
return response[0]
|
11
|
-
end
|
12
|
-
wrap_client_arg :get_alternate_end_user_information
|
13
|
-
|
14
|
-
def self.get_alternate_caller_information(client, acid)
|
15
|
-
response = client.make_request(:get, "#{client.concat_account_path(AEUI_PATH)}/#{acid}")
|
16
|
-
return response[0][:alternate_end_user_identifier]
|
17
|
-
end
|
18
|
-
wrap_client_arg :get_alternate_caller_information
|
19
|
-
end
|
20
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
module BandwidthIris
|
2
|
-
APPLICATIONS_PATH = "applications"
|
3
|
-
|
4
|
-
class Applications
|
5
|
-
extend ClientWrapper
|
6
|
-
include ApiItem
|
7
|
-
|
8
|
-
def self.get_applications(client)
|
9
|
-
data = client.make_request(:get, client.concat_account_path(APPLICATIONS_PATH))
|
10
|
-
list = data[0][:application_list][:application]
|
11
|
-
return [] if !list
|
12
|
-
if list.is_a?(Array) then
|
13
|
-
return list
|
14
|
-
else
|
15
|
-
return [list]
|
16
|
-
end
|
17
|
-
end
|
18
|
-
wrap_client_arg :get_applications
|
19
|
-
|
20
|
-
def self.create_application(client, application_data)
|
21
|
-
data = client.make_request(:post, client.concat_account_path(APPLICATIONS_PATH), {:application => application_data})
|
22
|
-
return data[0][:application]
|
23
|
-
end
|
24
|
-
wrap_client_arg :create_application
|
25
|
-
|
26
|
-
def self.get_application(client, application_id)
|
27
|
-
data = client.make_request(:get, client.concat_account_path("#{APPLICATIONS_PATH}/#{application_id}"))
|
28
|
-
return data[0][:application]
|
29
|
-
end
|
30
|
-
wrap_client_arg :get_application
|
31
|
-
|
32
|
-
def self.partial_update_application(client, application_id, application_data)
|
33
|
-
data = client.make_request(:patch, client.concat_account_path("#{APPLICATIONS_PATH}/#{application_id}"), {:application => application_data})
|
34
|
-
return data[0][:application]
|
35
|
-
end
|
36
|
-
wrap_client_arg :partial_update_application
|
37
|
-
|
38
|
-
def self.complete_update_application(client, application_id, application_data)
|
39
|
-
data = client.make_request(:put, client.concat_account_path("#{APPLICATIONS_PATH}/#{application_id}"), {:application => application_data})
|
40
|
-
return data[0][:application]
|
41
|
-
end
|
42
|
-
wrap_client_arg :complete_update_application
|
43
|
-
|
44
|
-
def self.delete_application(client, application_id)
|
45
|
-
client.make_request(:delete, client.concat_account_path("#{APPLICATIONS_PATH}/#{application_id}"))
|
46
|
-
end
|
47
|
-
wrap_client_arg :delete_application
|
48
|
-
|
49
|
-
def self.get_application_sippeers(client, application_id)
|
50
|
-
data = client.make_request(:get, client.concat_account_path("#{APPLICATIONS_PATH}/#{application_id}/associatedsippeers"))
|
51
|
-
list = data[0][:associated_sip_peers][:associated_sip_peer]
|
52
|
-
return [] if !list
|
53
|
-
if list.is_a?(Array) then
|
54
|
-
return list
|
55
|
-
else
|
56
|
-
return [list]
|
57
|
-
end
|
58
|
-
end
|
59
|
-
wrap_client_arg :get_application_sippeers
|
60
|
-
end
|
61
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module BandwidthIris
|
2
|
-
ENE_ORDERS_PATH = 'emergencyNotificationEndpointOrders'
|
3
|
-
|
4
|
-
class EmergencyNotificationEndpoints
|
5
|
-
extend ClientWrapper
|
6
|
-
include ApiItem
|
7
|
-
|
8
|
-
def self.create_emergency_notification_endpoint_order(client, data)
|
9
|
-
response = client.make_request(:post, "#{client.concat_account_path(ENE_ORDERS_PATH)}", {:emergency_notification_endpoint_order => data})
|
10
|
-
return response[0][:emergency_notification_endpoint_order]
|
11
|
-
end
|
12
|
-
wrap_client_arg :create_emergency_notification_endpoint_order
|
13
|
-
|
14
|
-
def self.get_emergency_notification_endpoint_orders(client, query=nil)
|
15
|
-
response = client.make_request(:get, "#{client.concat_account_path(ENE_ORDERS_PATH)}", query)
|
16
|
-
return response[0]
|
17
|
-
end
|
18
|
-
wrap_client_arg :get_emergency_notification_endpoint_orders
|
19
|
-
|
20
|
-
def self.get_emergency_notification_endpoint_order(client, order_id)
|
21
|
-
response = client.make_request(:get, "#{client.concat_account_path(ENE_ORDERS_PATH)}/#{order_id}")
|
22
|
-
return response[0][:emergency_notification_endpoint_order]
|
23
|
-
end
|
24
|
-
wrap_client_arg :get_emergency_notification_endpoint_order
|
25
|
-
end
|
26
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module BandwidthIris
|
2
|
-
ENG_ORDERS_PATH = 'emergencyNotificationGroupOrders'
|
3
|
-
ENG_PATH = 'emergencyNotificationGroups'
|
4
|
-
|
5
|
-
class EmergencyNotificationGroups
|
6
|
-
extend ClientWrapper
|
7
|
-
include ApiItem
|
8
|
-
|
9
|
-
def self.create_emergency_notification_group_order(client, data)
|
10
|
-
response = client.make_request(:post, "#{client.concat_account_path(ENG_ORDERS_PATH)}", {:emergency_notification_group_order => data})
|
11
|
-
return response[0][:emergency_notification_endpoint_order]
|
12
|
-
end
|
13
|
-
wrap_client_arg :create_emergency_notification_group_order
|
14
|
-
|
15
|
-
def self.get_emergency_notification_group_orders(client, query=nil)
|
16
|
-
response = client.make_request(:get, "#{client.concat_account_path(ENG_ORDERS_PATH)}", query)
|
17
|
-
return response[0]
|
18
|
-
end
|
19
|
-
wrap_client_arg :get_emergency_notification_group_orders
|
20
|
-
|
21
|
-
def self.get_emergency_notification_group_order(client, order_id)
|
22
|
-
response = client.make_request(:get, "#{client.concat_account_path(ENG_ORDERS_PATH)}/#{order_id}")
|
23
|
-
return response[0][:emergency_notification_endpoint_order]
|
24
|
-
end
|
25
|
-
wrap_client_arg :get_emergency_notification_group_order
|
26
|
-
|
27
|
-
def self.get_emergency_notification_group(client, eng_id)
|
28
|
-
response = client.make_request(:get, "#{client.concat_account_path(ENG_PATH)}/#{eng_id}")
|
29
|
-
return response[0][:emergency_notification_group]
|
30
|
-
end
|
31
|
-
wrap_client_arg :get_emergency_notification_group
|
32
|
-
|
33
|
-
def self.get_emergency_notification_groups(client, query=nil)
|
34
|
-
response = client.make_request(:get, "#{client.concat_account_path(ENG_PATH)}", query)
|
35
|
-
return response[0]
|
36
|
-
end
|
37
|
-
wrap_client_arg :get_emergency_notification_groups
|
38
|
-
end
|
39
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module BandwidthIris
|
2
|
-
ENR_PATH = 'emergencyNotificationRecipients'
|
3
|
-
|
4
|
-
class EmergencyNotificationRecipients
|
5
|
-
extend ClientWrapper
|
6
|
-
include ApiItem
|
7
|
-
|
8
|
-
def self.create_emergency_notification_recipient(client, data)
|
9
|
-
response = client.make_request(:post, "#{client.concat_account_path(ENR_PATH)}", {:emergency_notification_recipient => data})
|
10
|
-
return response[0][:emergency_notification_recipient]
|
11
|
-
end
|
12
|
-
wrap_client_arg :create_emergency_notification_recipient
|
13
|
-
|
14
|
-
def self.get_emergency_notification_recipients(client, query=nil)
|
15
|
-
response = client.make_request(:get, "#{client.concat_account_path(ENR_PATH)}", query)
|
16
|
-
return response[0]
|
17
|
-
end
|
18
|
-
wrap_client_arg :get_emergency_notification_recipients
|
19
|
-
|
20
|
-
def self.get_emergency_notification_recipient(client, enr_id)
|
21
|
-
response = client.make_request(:get, "#{client.concat_account_path(ENR_PATH)}/#{enr_id}")
|
22
|
-
return response[0][:emergency_notification_recipient]
|
23
|
-
end
|
24
|
-
wrap_client_arg :get_emergency_notification_recipient
|
25
|
-
|
26
|
-
def self.replace_emergency_notification_recipient(client, enr_id, data)
|
27
|
-
response = client.make_request(:put, "#{client.concat_account_path(ENR_PATH)}/#{enr_id}", {:emergency_notification_recipient => data})
|
28
|
-
return response[0][:emergency_notification_recipient]
|
29
|
-
end
|
30
|
-
wrap_client_arg :replace_emergency_notification_recipient
|
31
|
-
|
32
|
-
def self.delete_emergency_notification_recipient(client, enr_id)
|
33
|
-
client.make_request(:delete, "#{client.concat_account_path(ENR_PATH)}/#{enr_id}")
|
34
|
-
end
|
35
|
-
wrap_client_arg :delete_emergency_notification_recipient
|
36
|
-
end
|
37
|
-
end
|
@@ -1,118 +0,0 @@
|
|
1
|
-
module BandwidthIris
|
2
|
-
SIPPEER_PRODUCTS_PATH = 'products'
|
3
|
-
|
4
|
-
class SipPeerProducts
|
5
|
-
extend ClientWrapper
|
6
|
-
include ApiItem
|
7
|
-
|
8
|
-
def self.get_origination_settings(client, site_id, sippeer_id)
|
9
|
-
response = client.make_request(:get, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/origination/settings")
|
10
|
-
return response[0][:sip_peer_origination_settings]
|
11
|
-
end
|
12
|
-
wrap_client_arg :get_origination_settings
|
13
|
-
|
14
|
-
def self.create_origination_settings(client, site_id, sippeer_id, data)
|
15
|
-
response = client.make_request(:post, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/origination/settings", {:sip_peer_origination_settings => data})
|
16
|
-
return response[0][:sip_peer_origination_settings]
|
17
|
-
end
|
18
|
-
wrap_client_arg :create_origination_settings
|
19
|
-
|
20
|
-
def self.update_origination_settings(client, site_id, sippeer_id, data)
|
21
|
-
client.make_request(:put, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/origination/settings", {:sip_peer_origination_settings => data})
|
22
|
-
end
|
23
|
-
wrap_client_arg :update_origination_settings
|
24
|
-
|
25
|
-
def self.get_termination_settings(client, site_id, sippeer_id)
|
26
|
-
response = client.make_request(:get, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/termination/settings")
|
27
|
-
return response[0][:sip_peer_termination_settings]
|
28
|
-
end
|
29
|
-
wrap_client_arg :get_termination_settings
|
30
|
-
|
31
|
-
def self.create_termination_settings(client, site_id, sippeer_id, data)
|
32
|
-
response = client.make_request(:post, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/termination/settings", {:sip_peer_termination_settings => data})
|
33
|
-
return response[0][:sip_peer_termination_settings]
|
34
|
-
end
|
35
|
-
wrap_client_arg :create_termination_settings
|
36
|
-
|
37
|
-
def self.update_termination_settings(client, site_id, sippeer_id, data)
|
38
|
-
client.make_request(:put, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/termination/settings", {:sip_peer_termination_settings => data})
|
39
|
-
end
|
40
|
-
wrap_client_arg :update_termination_settings
|
41
|
-
|
42
|
-
def self.get_sms_feature_settings(client, site_id, sippeer_id)
|
43
|
-
response = client.make_request(:get, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/features/sms")
|
44
|
-
return response[0][:sip_peer_sms_feature]
|
45
|
-
end
|
46
|
-
wrap_client_arg :get_sms_feature_settings
|
47
|
-
|
48
|
-
def self.create_sms_feature_settings(client, site_id, sippeer_id, data)
|
49
|
-
response = client.make_request(:post, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/features/sms", {:sip_peer_sms_feature => data})
|
50
|
-
return response[0][:sip_peer_sms_feature]
|
51
|
-
end
|
52
|
-
wrap_client_arg :create_sms_feature_settings
|
53
|
-
|
54
|
-
def self.update_sms_feature_settings(client, site_id, sippeer_id, data)
|
55
|
-
response = client.make_request(:put, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/features/sms", {:sip_peer_sms_feature => data})
|
56
|
-
return response[0][:sip_peer_sms_feature]
|
57
|
-
end
|
58
|
-
wrap_client_arg :update_sms_feature_settings
|
59
|
-
|
60
|
-
def self.delete_sms_feature_settings(client, site_id, sippeer_id)
|
61
|
-
response = client.make_request(:delete, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/features/sms")
|
62
|
-
return response
|
63
|
-
end
|
64
|
-
wrap_client_arg :delete_sms_feature_settings
|
65
|
-
|
66
|
-
def self.get_mms_feature_settings(client, site_id, sippeer_id)
|
67
|
-
response = client.make_request(:get, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/features/mms")
|
68
|
-
return response[0][:mms_feature]
|
69
|
-
end
|
70
|
-
wrap_client_arg :get_mms_feature_settings
|
71
|
-
|
72
|
-
def self.create_mms_feature_settings(client, site_id, sippeer_id, data)
|
73
|
-
response = client.make_request(:post, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/features/mms", {:mms_feature => data})
|
74
|
-
return response[0][:mms_feature]
|
75
|
-
end
|
76
|
-
wrap_client_arg :create_mms_feature_settings
|
77
|
-
|
78
|
-
def self.update_mms_feature_settings(client, site_id, sippeer_id, data)
|
79
|
-
client.make_request(:put, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/features/mms", {:mms_feature => data})
|
80
|
-
end
|
81
|
-
wrap_client_arg :update_mms_feature_settings
|
82
|
-
|
83
|
-
def self.delete_mms_feature_settings(client, site_id, sippeer_id)
|
84
|
-
client.make_request(:delete, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/features/mms")
|
85
|
-
end
|
86
|
-
wrap_client_arg :delete_mms_feature_settings
|
87
|
-
|
88
|
-
def self.get_mms_feature_mms_settings(client, site_id, sippeer_id)
|
89
|
-
response = client.make_request(:get, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/features/mms/settings")
|
90
|
-
return response[0][:mms_settings]
|
91
|
-
end
|
92
|
-
wrap_client_arg :get_mms_feature_mms_settings
|
93
|
-
|
94
|
-
def self.get_messaging_application_settings(client, site_id, sippeer_id)
|
95
|
-
response = client.make_request(:get, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/applicationSettings")
|
96
|
-
return response[0][:applications_settings]
|
97
|
-
end
|
98
|
-
wrap_client_arg :get_messaging_application_settings
|
99
|
-
|
100
|
-
def self.update_messaging_application_settings(client, site_id, sippeer_id, data)
|
101
|
-
response = client.make_request(:put, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/applicationSettings", {:applications_settings => data})
|
102
|
-
return response[0][:applications_settings]
|
103
|
-
end
|
104
|
-
wrap_client_arg :update_messaging_application_settings
|
105
|
-
|
106
|
-
def self.get_messaging_settings(client, site_id, sippeer_id)
|
107
|
-
response = client.make_request(:get, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/settings")
|
108
|
-
return response[0][:sip_peer_messaging_settings]
|
109
|
-
end
|
110
|
-
wrap_client_arg :get_messaging_settings
|
111
|
-
|
112
|
-
def self.update_messaging_settings(client, site_id, sippeer_id, data)
|
113
|
-
response = client.make_request(:put, "#{client.concat_account_path(SITE_PATH)}/#{site_id}/#{SIPPEER_PATH}/#{sippeer_id}/#{SIPPEER_PRODUCTS_PATH}/messaging/settings", {:sip_peer_messaging_settings => data})
|
114
|
-
return response[0][:sip_peer_messaging_settings]
|
115
|
-
end
|
116
|
-
wrap_client_arg :update_messaging_settings
|
117
|
-
end
|
118
|
-
end
|
@@ -1,26 +0,0 @@
|
|
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,25 +0,0 @@
|
|
1
|
-
describe BandwidthIris::AlternateEndUserIdentity 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 '#aeui' do
|
13
|
-
it 'should get aeuis' do
|
14
|
-
client.stubs.get("/v1.0/accounts/accountId/aeuis") {|env| [200, {}, Helper.xml['aeuis']]}
|
15
|
-
aeuis = AlternateEndUserIdentity.get_alternate_end_user_information(client)
|
16
|
-
expect(aeuis[:alternate_end_user_identifiers][:alternate_end_user_identifier][0][:identifier]).to eql("DavidAcid")
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should get aeui' do
|
20
|
-
client.stubs.get("/v1.0/accounts/accountId/aeuis/id") {|env| [200, {}, Helper.xml['aeui']]}
|
21
|
-
aeui = AlternateEndUserIdentity.get_alternate_caller_information(client, "id")
|
22
|
-
expect(aeui[:identifier]).to eql("DavidAcid")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|