telnyx 2.9.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/scripts/before_install.sh +10 -9
- data/.github/workflows/publish-gem-on-release.yml +6 -6
- data/.github/workflows/ruby.yml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile +7 -8
- data/README.md +1 -1
- data/Spec3.json +77839 -0
- data/VERSION +1 -1
- data/lib/telnyx/access_control_ip.rb +13 -0
- data/lib/telnyx/access_ip_range.rb +12 -0
- data/lib/telnyx/address.rb +9 -0
- data/lib/telnyx/api_operations/delete.rb +1 -1
- data/lib/telnyx/api_resource.rb +4 -1
- data/lib/telnyx/authentication_providers.rb +12 -0
- data/lib/telnyx/available_phone_number.rb +5 -0
- data/lib/telnyx/balance.rb +12 -0
- data/lib/telnyx/batch_mdr_report.rb +15 -0
- data/lib/telnyx/brand.rb +13 -0
- data/lib/telnyx/bulk_creation.rb +21 -0
- data/lib/telnyx/bulk_credential.rb +16 -0
- data/lib/telnyx/bulk_sim_card_action.rb +9 -0
- data/lib/telnyx/business_identitie.rb +9 -0
- data/lib/telnyx/call.rb +2 -2
- data/lib/telnyx/call_event.rb +9 -0
- data/lib/telnyx/call_recording.rb +12 -0
- data/lib/telnyx/campaign.rb +34 -0
- data/lib/telnyx/cdr_usage_report.rb +13 -0
- data/lib/telnyx/channel_zone.rb +10 -0
- data/lib/telnyx/comment.rb +20 -0
- data/lib/telnyx/conference.rb +1 -1
- data/lib/telnyx/connection.rb +5 -0
- data/lib/telnyx/csv_download.rb +10 -0
- data/lib/telnyx/custom_storage_credential.rb +7 -0
- data/lib/telnyx/detail_record.rb +9 -0
- data/lib/telnyx/dialogflow_connection.rb +20 -0
- data/lib/telnyx/document.rb +20 -0
- data/lib/telnyx/dynamic_emergency_address.rb +12 -0
- data/lib/telnyx/dynamic_emergency_endpoint.rb +12 -0
- data/lib/telnyx/embedding.rb +14 -0
- data/lib/telnyx/enum.rb +15 -0
- data/lib/telnyx/fax.rb +14 -0
- data/lib/telnyx/global_ip.rb +10 -0
- data/lib/telnyx/global_ip_allowed_port.rb +8 -0
- data/lib/telnyx/global_ip_assignment.rb +12 -0
- data/lib/telnyx/global_ip_assignment_health.rb +8 -0
- data/lib/telnyx/global_ip_assignment_usage.rb +8 -0
- data/lib/telnyx/global_ip_latency.rb +8 -0
- data/lib/telnyx/global_ip_protocol.rb +8 -0
- data/lib/telnyx/global_ip_usage.rb +8 -0
- data/lib/telnyx/inference.rb +9 -0
- data/lib/telnyx/inventory_coverage.rb +9 -0
- data/lib/telnyx/ledger_billing_group_report.rb +9 -0
- data/lib/telnyx/managed_account.rb +32 -0
- data/lib/telnyx/mdr_usage_report.rb +21 -0
- data/lib/telnyx/media.rb +21 -0
- data/lib/telnyx/message_number_pool.rb +9 -0
- data/lib/telnyx/messaging_hosted_number_order.rb +21 -0
- data/lib/telnyx/messaging_profile.rb +14 -2
- data/lib/telnyx/messaging_tollfree_verification.rb +12 -0
- data/lib/telnyx/messaging_url_domain.rb +9 -0
- data/lib/telnyx/mobile_operator_network.rb +9 -0
- data/lib/telnyx/mobile_push_credential.rb +11 -0
- data/lib/telnyx/network.rb +19 -0
- data/lib/telnyx/notification_channel.rb +12 -0
- data/lib/telnyx/notification_event.rb +9 -0
- data/lib/telnyx/notification_event_condition.rb +9 -0
- data/lib/telnyx/notification_profile.rb +12 -0
- data/lib/telnyx/notification_setting.rb +12 -0
- data/lib/telnyx/number_block_order.rb +10 -0
- data/lib/telnyx/ota_update.rb +9 -0
- data/lib/telnyx/phone_number.rb +6 -0
- data/lib/telnyx/phone_number_block_job.rb +14 -0
- data/lib/telnyx/phone_number_campaigns.rb +12 -0
- data/lib/telnyx/portability_check.rb +9 -0
- data/lib/telnyx/porting_order.rb +39 -1
- data/lib/telnyx/portout.rb +9 -0
- data/lib/telnyx/private_wireless_gateway.rb +11 -0
- data/lib/telnyx/public_internet_gateway.rb +11 -0
- data/lib/telnyx/region.rb +9 -0
- data/lib/telnyx/requirement.rb +8 -0
- data/lib/telnyx/requirement_type.rb +8 -0
- data/lib/telnyx/room.rb +20 -0
- data/lib/telnyx/room_composition.rb +11 -0
- data/lib/telnyx/room_participant.rb +9 -0
- data/lib/telnyx/room_recording.rb +10 -0
- data/lib/telnyx/room_session.rb +18 -0
- data/lib/telnyx/short_code.rb +10 -0
- data/lib/telnyx/sim_card.rb +28 -2
- data/lib/telnyx/sim_card_action.rb +12 -0
- data/lib/telnyx/sim_card_data_usage_notification.rb +12 -0
- data/lib/telnyx/sim_card_group.rb +21 -0
- data/lib/telnyx/sim_card_group_action.rb +8 -0
- data/lib/telnyx/sim_card_order.rb +10 -0
- data/lib/telnyx/summary.rb +9 -0
- data/lib/telnyx/telephony_credential.rb +22 -0
- data/lib/telnyx/telnyx_client.rb +1 -2
- data/lib/telnyx/texml_application.rb +9 -0
- data/lib/telnyx/verification.rb +3 -3
- data/lib/telnyx/verified_calls_display_profile.rb +17 -0
- data/lib/telnyx/verify_profile.rb +1 -0
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx/virtual_cross_connect.rb +20 -0
- data/lib/telnyx/virtual_cross_connect_region.rb +9 -0
- data/lib/telnyx/wdr.rb +13 -0
- data/lib/telnyx/webhook_deliverie.rb +9 -0
- data/lib/telnyx/wireguard_interface.rb +11 -0
- data/lib/telnyx/wireguard_peer.rb +21 -0
- data/lib/telnyx.rb +67 -3
- data/server.js +31 -0
- data/telnyx.gemspec +4 -2
- data/test/telnyx/api_resource_test.rb +25 -21
- data/test/telnyx/available_phone_number_test.rb +6 -0
- data/test/telnyx/batch_mdr_report_test.rb +35 -0
- data/test/telnyx/billing_group_test.rb +12 -8
- data/test/telnyx/bulk_credential_test.rb +20 -0
- data/test/telnyx/bulk_sim_card_action_test.rb +22 -0
- data/test/telnyx/business_identitie_test.rb +25 -0
- data/test/telnyx/call_control_application_test.rb +13 -9
- data/test/telnyx/call_control_test.rb +24 -23
- data/test/telnyx/call_event_test.rb +14 -0
- data/test/telnyx/call_recording_test.rb +28 -0
- data/test/telnyx/call_test.rb +29 -0
- data/test/telnyx/campaign_test.rb +32 -0
- data/test/telnyx/cdr_usage_report_test.rb +15 -0
- data/test/telnyx/channel_zone_test.rb +14 -0
- data/test/telnyx/comment_test.rb +32 -0
- data/test/telnyx/conference_test.rb +27 -16
- data/test/telnyx/connection_test.rb +8 -1
- data/test/telnyx/credential_connection_test.rb +5 -4
- data/test/telnyx/csv_download_test.rb +33 -0
- data/test/telnyx/custom_storage_credential_test.rb +17 -0
- data/test/telnyx/detail_record_test.rb +15 -0
- data/test/telnyx/dialogflow_connection_test.rb +32 -0
- data/test/telnyx/embedding_test.rb +27 -0
- data/test/telnyx/enum_test.rb +15 -0
- data/test/telnyx/fax_application_test.rb +5 -4
- data/test/telnyx/fax_test.rb +13 -4
- data/test/telnyx/fqdn_connection_test.rb +5 -5
- data/test/telnyx/fqdn_test.rb +12 -7
- data/test/telnyx/global_ip_allowed_port_test.rb +14 -0
- data/test/telnyx/global_ip_assignment_health_test.rb +14 -0
- data/test/telnyx/global_ip_assignment_test.rb +44 -0
- data/test/telnyx/global_ip_latency_test.rb +14 -0
- data/test/telnyx/global_ip_protocol_test.rb +14 -0
- data/test/telnyx/global_ip_test.rb +35 -0
- data/test/telnyx/global_ip_usage_test.rb +14 -0
- data/test/telnyx/inference_test.rb +12 -0
- data/test/telnyx/ip_connection_test.rb +12 -8
- data/test/telnyx/ip_test.rb +12 -8
- data/test/telnyx/ledger_billing_group_report_test.rb +18 -0
- data/test/telnyx/managed_account_test.rb +42 -0
- data/test/telnyx/mdr_usage_report_test.rb +47 -0
- data/test/telnyx/message_number_pool_test.rb +18 -0
- data/test/telnyx/message_test.rb +2 -2
- data/test/telnyx/messaging_phone_number_test.rb +2 -1
- data/test/telnyx/messaging_profile_test.rb +26 -14
- data/test/telnyx/messaging_tollfree_verification_test.rb +71 -0
- data/test/telnyx/messaging_url_domain_test.rb +14 -0
- data/test/telnyx/mobile_operator_network_test.rb +15 -0
- data/test/telnyx/mobile_push_credential_test.rb +33 -0
- data/test/telnyx/network_test.rb +49 -0
- data/test/telnyx/number_block_order_test.rb +28 -0
- data/test/telnyx/number_order_document_test.rb +4 -3
- data/test/telnyx/number_order_test.rb +3 -2
- data/test/telnyx/number_reservation_test.rb +2 -2
- data/test/telnyx/ota_update_test.rb +20 -0
- data/test/telnyx/phone_number_block_job_test.rb +25 -0
- data/test/telnyx/phone_number_regulatory_requirement_test.rb +2 -1
- data/test/telnyx/phone_number_test.rb +8 -6
- data/test/telnyx/porting_order_test.rb +45 -10
- data/test/telnyx/private_wireless_gateway_test.rb +32 -0
- data/test/telnyx/public_internet_gateway_test.rb +32 -0
- data/test/telnyx/queue_test.rb +9 -6
- data/test/telnyx/region_test.rb +14 -0
- data/test/telnyx/regulatory_requirement_test.rb +6 -3
- data/test/telnyx/requirement_test.rb +22 -0
- data/test/telnyx/requirement_type_test.rb +22 -0
- data/test/telnyx/room_composition_test.rb +32 -0
- data/test/telnyx/room_participant_test.rb +19 -0
- data/test/telnyx/room_recording_test.rb +27 -0
- data/test/telnyx/room_session_test.rb +47 -0
- data/test/telnyx/room_test.rb +52 -0
- data/test/telnyx/short_code_test.rb +30 -0
- data/test/telnyx/sim_card_data_usage_notification_test.rb +42 -0
- data/test/telnyx/sim_card_group_action_test.rb +22 -0
- data/test/telnyx/sim_card_group_test.rb +59 -0
- data/test/telnyx/sim_card_order_test.rb +27 -0
- data/test/telnyx/sim_card_test.rb +75 -10
- data/test/telnyx/summary_test.rb +12 -0
- data/test/telnyx/telephony_credential_test.rb +35 -6
- data/test/telnyx/texml_application_test.rb +25 -0
- data/test/telnyx/verification_test.rb +4 -4
- data/test/telnyx/verified_calls_display_profile_test.rb +33 -0
- data/test/telnyx/verify_profile_test.rb +16 -7
- data/test/telnyx/virtual_cross_connect_region_test.rb +22 -0
- data/test/telnyx/virtual_cross_connect_test.rb +49 -0
- data/test/telnyx/wdr_test.rb +14 -0
- data/test/telnyx/webhook_deliverie_test.rb +23 -0
- data/test/telnyx/wireguard_interface_test.rb +32 -0
- data/test/telnyx/wireguard_peer_test.rb +48 -0
- data/test/test_helper.rb +10 -26
- metadata +235 -37
- data/examples/2 factor authentication/Gemfile +0 -7
- data/examples/2 factor authentication/main.rb +0 -67
- data/examples/2 factor authentication/readme.md +0 -5
- data/test/telnyx_mock.rb +0 -78
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class EmbeddingTest < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
@embedding = Embedding.create(bucket_name: "Foo")
|
|
9
|
+
@task_id = @embedding[:data][:task_id].freeze
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
should "be creatable" do
|
|
13
|
+
assert_requested :post, "#{Telnyx.api_base}/v2/ai/embeddings"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
should "be lists of buckets" do
|
|
17
|
+
buckets = Embedding.buckets
|
|
18
|
+
assert buckets.is_a?(TelnyxObject)
|
|
19
|
+
assert buckets[:data][:buckets].is_a?(Array)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
should "be retrievable task" do
|
|
23
|
+
Embedding.retrieve(@task_id)
|
|
24
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/ai/embeddings/#{@task_id}"
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class EnumTest < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
omit "enum value passing 200, not liking Telnyx Object"
|
|
9
|
+
end
|
|
10
|
+
should "retrieve enum endpoint" do
|
|
11
|
+
enum = Enum.endpoint(endpoint: "laudantium")
|
|
12
|
+
assert enum.is_a?(TelnyxObject)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -8,25 +8,26 @@ module Telnyx
|
|
|
8
8
|
fax_applications = FaxApplication.list
|
|
9
9
|
assert_requested :get, "#{Telnyx.api_base}/v2/fax_applications"
|
|
10
10
|
assert_kind_of ListObject, fax_applications
|
|
11
|
-
assert_kind_of
|
|
11
|
+
assert_kind_of TelnyxObject, fax_applications.first
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
should "create" do
|
|
15
15
|
fax_application = FaxApplication.create application_name: "foo", webhook_event_url: "https://foo.bar.com"
|
|
16
16
|
assert_requested :post, "#{Telnyx.api_base}/v2/fax_applications"
|
|
17
|
-
assert_kind_of
|
|
17
|
+
assert_kind_of TelnyxObject, fax_application
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
should "retrieve" do
|
|
21
21
|
fax_application = FaxApplication.retrieve "foo"
|
|
22
22
|
assert_requested :get, "#{Telnyx.api_base}/v2/fax_applications/foo"
|
|
23
|
-
assert_kind_of
|
|
23
|
+
assert_kind_of TelnyxObject, fax_application
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
should "delete" do
|
|
27
27
|
fax_application = FaxApplication.retrieve "foo"
|
|
28
|
+
id = fax_application.id.gsub(/\s+/, "+").freeze
|
|
28
29
|
fax_application.delete
|
|
29
|
-
assert_requested :delete, "#{Telnyx.api_base}/v2/fax_applications
|
|
30
|
+
assert_requested :delete, "#{Telnyx.api_base}/v2/fax_applications/#{id}"
|
|
30
31
|
end
|
|
31
32
|
end
|
|
32
33
|
end
|
data/test/telnyx/fax_test.rb
CHANGED
|
@@ -18,16 +18,25 @@ module Telnyx
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
should "view fax" do
|
|
21
|
-
fax = Fax.retrieve
|
|
22
|
-
assert_requested :get, "#{Telnyx.api_base}/v2/faxes/
|
|
21
|
+
fax = Fax.retrieve("3ae112cb-d72c-99c7-f765-fbcbfe4bca51")
|
|
22
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/faxes/3ae112cb-d72c-99c7-f765-fbcbfe4bca51"
|
|
23
23
|
assert_kind_of Fax, fax
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
should "delete fax" do
|
|
27
27
|
omit "!!waiting for mock!!"
|
|
28
|
-
fax = Fax.retrieve "
|
|
28
|
+
fax = Fax.retrieve "3ae112cb-d72c-99c7-f765-fbcbfe4bca51"
|
|
29
29
|
fax.delete
|
|
30
|
-
assert_requested :delete, "#{Telnyx.api_base}/v2/faxes/
|
|
30
|
+
assert_requested :delete, "#{Telnyx.api_base}/v2/faxes/3ae112cb-d72c-99c7-f765-fbcbfe4bca51"
|
|
31
|
+
end
|
|
32
|
+
context "actions" do
|
|
33
|
+
should "cancel" do
|
|
34
|
+
omit "ID req mismatch"
|
|
35
|
+
fax = Fax.retrieve "3ae112cb-d72c-99c7-f765-fbcbfe4bca51"
|
|
36
|
+
id = fax.id.freeze
|
|
37
|
+
fax.cancel
|
|
38
|
+
assert_requested :post, "#{Telnyx.api_base}/v2/faxes/#{id}/actions/cancel"
|
|
39
|
+
end
|
|
31
40
|
end
|
|
32
41
|
end
|
|
33
42
|
end
|
|
@@ -8,7 +8,7 @@ module Telnyx
|
|
|
8
8
|
fqdn_connections = FQDNConnection.list
|
|
9
9
|
assert_requested :get, "#{Telnyx.api_base}/v2/fqdn_connections"
|
|
10
10
|
assert_kind_of ListObject, fqdn_connections
|
|
11
|
-
assert_kind_of
|
|
11
|
+
assert_kind_of TelnyxObject, fqdn_connections.first
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
should "create fqdn connection" do
|
|
@@ -24,17 +24,17 @@ module Telnyx
|
|
|
24
24
|
|
|
25
25
|
should "delete fqdn connection" do
|
|
26
26
|
fqdn_connection = FQDNConnection.retrieve("id")
|
|
27
|
-
|
|
27
|
+
id = fqdn_connection.id.gsub(/\s+/, "+").freeze
|
|
28
28
|
fqdn_connection.delete
|
|
29
|
-
assert_requested :delete, "#{Telnyx.api_base}/v2/fqdn_connections
|
|
29
|
+
assert_requested :delete, "#{Telnyx.api_base}/v2/fqdn_connections/#{id}"
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
should "update fqdn connection" do
|
|
33
33
|
fqdn_connection = FQDNConnection.retrieve("id")
|
|
34
|
-
|
|
34
|
+
id = fqdn_connection.id.gsub(/\s+/, "+").freeze
|
|
35
35
|
fqdn_connection.active = false
|
|
36
36
|
fqdn_connection.save
|
|
37
|
-
assert_requested :patch, "#{Telnyx.api_base}/v2/fqdn_connections
|
|
37
|
+
assert_requested :patch, "#{Telnyx.api_base}/v2/fqdn_connections/#{id}"
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
end
|
data/test/telnyx/fqdn_test.rb
CHANGED
|
@@ -4,11 +4,14 @@ require_relative "../test_helper"
|
|
|
4
4
|
|
|
5
5
|
module Telnyx
|
|
6
6
|
class FQDNTest < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
@id = "labore"
|
|
9
|
+
end
|
|
7
10
|
should "list fqdns" do
|
|
8
11
|
fqdn = FQDN.list
|
|
9
12
|
assert_requested :get, "#{Telnyx.api_base}/v2/fqdns"
|
|
10
13
|
assert_kind_of ListObject, fqdn
|
|
11
|
-
assert_kind_of
|
|
14
|
+
assert_kind_of TelnyxObject, fqdn.first
|
|
12
15
|
end
|
|
13
16
|
|
|
14
17
|
should "create fqdn" do
|
|
@@ -17,24 +20,26 @@ module Telnyx
|
|
|
17
20
|
end
|
|
18
21
|
|
|
19
22
|
should "retrieve fqdn" do
|
|
20
|
-
fqdn = FQDN.retrieve(
|
|
21
|
-
assert_requested :get, "#{Telnyx.api_base}/v2/fqdns
|
|
23
|
+
fqdn = FQDN.retrieve(@id)
|
|
24
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/fqdns/#{@id}"
|
|
22
25
|
assert_kind_of FQDN, fqdn
|
|
23
26
|
end
|
|
24
27
|
|
|
25
28
|
should "delete fqdn" do
|
|
26
|
-
fqdn = FQDN.retrieve(
|
|
29
|
+
fqdn = FQDN.retrieve(@id)
|
|
30
|
+
id = fqdn.id.gsub(/\s+/, "+").freeze
|
|
27
31
|
|
|
28
32
|
fqdn.delete
|
|
29
|
-
assert_requested :delete, "#{Telnyx.api_base}/v2/fqdns
|
|
33
|
+
assert_requested :delete, "#{Telnyx.api_base}/v2/fqdns/#{id}"
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
should "update fqdn" do
|
|
33
|
-
fqdn = FQDN.retrieve(
|
|
37
|
+
fqdn = FQDN.retrieve(@id)
|
|
34
38
|
|
|
35
39
|
fqdn.fqdn = "example.com"
|
|
40
|
+
id = fqdn.id.gsub(/\s+/, "+").freeze
|
|
36
41
|
fqdn.save
|
|
37
|
-
assert_requested :patch, "#{Telnyx.api_base}/v2/fqdns
|
|
42
|
+
assert_requested :patch, "#{Telnyx.api_base}/v2/fqdns/#{id}"
|
|
38
43
|
end
|
|
39
44
|
end
|
|
40
45
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class GlobalIpAllowedPortTest < Test::Unit::TestCase
|
|
7
|
+
should "list ip usage" do
|
|
8
|
+
ports = GlobalIpAllowedPort.list
|
|
9
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/global_ip_allowed_ports"
|
|
10
|
+
assert_kind_of ListObject, ports
|
|
11
|
+
assert_kind_of TelnyxObject, ports.first
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class GlobalIpAssignmentHealthTest < Test::Unit::TestCase
|
|
7
|
+
should "list ip health" do
|
|
8
|
+
assignment_health = GlobalIpAssignmentHealth.list
|
|
9
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/global_ip_assignment_health"
|
|
10
|
+
assert_kind_of ListObject, assignment_health
|
|
11
|
+
assert_kind_of TelnyxObject, assignment_health.first
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class GlobalIpAssignmentTest < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
@id = "8a2088fd-efec-3c9b-b5b5-a0924b842fbb"
|
|
9
|
+
end
|
|
10
|
+
should "list ip connections" do
|
|
11
|
+
global_ip_assignments = GlobalIpAssignment.list
|
|
12
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/global_ip_assignments"
|
|
13
|
+
assert_kind_of ListObject, global_ip_assignments
|
|
14
|
+
assert_kind_of TelnyxObject, global_ip_assignments.first
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
should "create ip connection" do
|
|
18
|
+
GlobalIpAssignment.create
|
|
19
|
+
assert_requested :post, "#{Telnyx.api_base}/v2/global_ip_assignments"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
should "retrieve ip connection" do
|
|
23
|
+
ip_ass = GlobalIpAssignment.retrieve(@id)
|
|
24
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/global_ip_assignments/#{@id}"
|
|
25
|
+
assert_kind_of GlobalIpAssignment, ip_ass
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
should "delete ip connection" do
|
|
29
|
+
ip_ass = GlobalIpAssignment.retrieve(@id)
|
|
30
|
+
id = ip_ass.id.gsub(/\s+/, "+").freeze
|
|
31
|
+
ip_ass.delete
|
|
32
|
+
assert_requested :delete, "#{Telnyx.api_base}/v2/global_ip_assignments/#{id}"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
should "update ip connection" do
|
|
36
|
+
ip_ass = GlobalIpAssignment.retrieve(@id)
|
|
37
|
+
|
|
38
|
+
ip_ass.active = false
|
|
39
|
+
id = ip_ass.id.gsub(/\s+/, "+").freeze
|
|
40
|
+
ip_ass.save
|
|
41
|
+
assert_requested :patch, "#{Telnyx.api_base}/v2/global_ip_assignments/#{id}"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class GlobalIpLatencyTest < Test::Unit::TestCase
|
|
7
|
+
should "list ip usage" do
|
|
8
|
+
latency = GlobalIpLatency.list
|
|
9
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/global_ip_latency"
|
|
10
|
+
assert_kind_of ListObject, latency
|
|
11
|
+
assert_kind_of TelnyxObject, latency.first
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class GlobalIpProtocolTest < Test::Unit::TestCase
|
|
7
|
+
should "list ip usage" do
|
|
8
|
+
protocols = GlobalIpProtocol.list
|
|
9
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/global_ip_protocols"
|
|
10
|
+
assert_kind_of ListObject, protocols
|
|
11
|
+
assert_kind_of TelnyxObject, protocols.first
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class GlobalIpTest < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
@id = "70308070-fb3c-32ee-0a59-ce012cd4840d"
|
|
9
|
+
end
|
|
10
|
+
should "list ips" do
|
|
11
|
+
global_ip = GlobalIp.list
|
|
12
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/global_ips"
|
|
13
|
+
assert_kind_of ListObject, global_ip
|
|
14
|
+
assert_kind_of TelnyxObject, global_ip.first
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
should "create global_ip" do
|
|
18
|
+
GlobalIp.create global_ip_address: "0.0.0.0"
|
|
19
|
+
assert_requested :post, "#{Telnyx.api_base}/v2/global_ips"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
should "retrieve global_ip" do
|
|
23
|
+
global_ip = GlobalIp.retrieve(@id)
|
|
24
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/global_ips/#{@id}"
|
|
25
|
+
assert_kind_of GlobalIp, global_ip
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
should "delete global_ip" do
|
|
29
|
+
global_ip = GlobalIp.retrieve(@id)
|
|
30
|
+
id = global_ip.id.freeze
|
|
31
|
+
global_ip.delete
|
|
32
|
+
assert_requested :delete, "#{Telnyx.api_base}/v2/global_ips/#{id}"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class GlobalIpUsageTest < Test::Unit::TestCase
|
|
7
|
+
should "list ip usage" do
|
|
8
|
+
global_ip_usage = GlobalIpUsage.list
|
|
9
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/global_ip_usage"
|
|
10
|
+
assert_kind_of ListObject, global_ip_usage
|
|
11
|
+
assert_kind_of TelnyxObject, global_ip_usage.first
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class InferenceTest < Test::Unit::TestCase
|
|
7
|
+
should "be creatable" do
|
|
8
|
+
Telnyx::Inference.create(text: ["Foo"])
|
|
9
|
+
assert_requested :post, "#{Telnyx.api_base}/v2/ai/generate"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -4,11 +4,14 @@ require_relative "../test_helper"
|
|
|
4
4
|
|
|
5
5
|
module Telnyx
|
|
6
6
|
class IPConnectionTest < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
@id = "qui"
|
|
9
|
+
end
|
|
7
10
|
should "list ip connections" do
|
|
8
11
|
ip_connections = IPConnection.list
|
|
9
12
|
assert_requested :get, "#{Telnyx.api_base}/v2/ip_connections"
|
|
10
13
|
assert_kind_of ListObject, ip_connections
|
|
11
|
-
assert_kind_of
|
|
14
|
+
assert_kind_of TelnyxObject, ip_connections.first
|
|
12
15
|
end
|
|
13
16
|
|
|
14
17
|
should "create ip connection" do
|
|
@@ -17,24 +20,25 @@ module Telnyx
|
|
|
17
20
|
end
|
|
18
21
|
|
|
19
22
|
should "retrieve ip connection" do
|
|
20
|
-
ip_connection = IPConnection.retrieve(
|
|
21
|
-
assert_requested :get, "#{Telnyx.api_base}/v2/ip_connections
|
|
23
|
+
ip_connection = IPConnection.retrieve(@id)
|
|
24
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/ip_connections/#{@id}"
|
|
22
25
|
assert_kind_of IPConnection, ip_connection
|
|
23
26
|
end
|
|
24
27
|
|
|
25
28
|
should "delete ip connection" do
|
|
26
|
-
ip_connection = IPConnection.retrieve(
|
|
27
|
-
|
|
29
|
+
ip_connection = IPConnection.retrieve(@id)
|
|
30
|
+
id = ip_connection.id.gsub(/\s+/, "+").freeze
|
|
28
31
|
ip_connection.delete
|
|
29
|
-
assert_requested :delete, "#{Telnyx.api_base}/v2/ip_connections
|
|
32
|
+
assert_requested :delete, "#{Telnyx.api_base}/v2/ip_connections/#{id}"
|
|
30
33
|
end
|
|
31
34
|
|
|
32
35
|
should "update ip connection" do
|
|
33
|
-
ip_connection = IPConnection.retrieve(
|
|
36
|
+
ip_connection = IPConnection.retrieve(@id)
|
|
34
37
|
|
|
35
38
|
ip_connection.active = false
|
|
39
|
+
id = ip_connection.id.gsub(/\s+/, "+").freeze
|
|
36
40
|
ip_connection.save
|
|
37
|
-
assert_requested :patch, "#{Telnyx.api_base}/v2/ip_connections
|
|
41
|
+
assert_requested :patch, "#{Telnyx.api_base}/v2/ip_connections/#{id}"
|
|
38
42
|
end
|
|
39
43
|
end
|
|
40
44
|
end
|
data/test/telnyx/ip_test.rb
CHANGED
|
@@ -4,11 +4,14 @@ require_relative "../test_helper"
|
|
|
4
4
|
|
|
5
5
|
module Telnyx
|
|
6
6
|
class IPTest < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
@id = "70308070-fb3c-32ee-0a59-ce012cd4840d"
|
|
9
|
+
end
|
|
7
10
|
should "list ips" do
|
|
8
11
|
ip = IP.list
|
|
9
12
|
assert_requested :get, "#{Telnyx.api_base}/v2/ips"
|
|
10
13
|
assert_kind_of ListObject, ip
|
|
11
|
-
assert_kind_of
|
|
14
|
+
assert_kind_of TelnyxObject, ip.first
|
|
12
15
|
end
|
|
13
16
|
|
|
14
17
|
should "create ip" do
|
|
@@ -17,24 +20,25 @@ module Telnyx
|
|
|
17
20
|
end
|
|
18
21
|
|
|
19
22
|
should "retrieve ip" do
|
|
20
|
-
ip = IP.retrieve(
|
|
21
|
-
assert_requested :get, "#{Telnyx.api_base}/v2/ips
|
|
23
|
+
ip = IP.retrieve(@id)
|
|
24
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/ips/#{@id}"
|
|
22
25
|
assert_kind_of IP, ip
|
|
23
26
|
end
|
|
24
27
|
|
|
25
28
|
should "delete ip" do
|
|
26
|
-
ip = IP.retrieve(
|
|
27
|
-
|
|
29
|
+
ip = IP.retrieve(@id)
|
|
30
|
+
id = ip.id.freeze
|
|
28
31
|
ip.delete
|
|
29
|
-
assert_requested :delete, "#{Telnyx.api_base}/v2/ips
|
|
32
|
+
assert_requested :delete, "#{Telnyx.api_base}/v2/ips/#{id}"
|
|
30
33
|
end
|
|
31
34
|
|
|
32
35
|
should "update ip" do
|
|
33
|
-
ip = IP.retrieve(
|
|
36
|
+
ip = IP.retrieve(@id)
|
|
34
37
|
|
|
35
38
|
ip.ip_address = "0.0.0.0"
|
|
39
|
+
id = ip.id.freeze
|
|
36
40
|
ip.save
|
|
37
|
-
assert_requested :patch, "#{Telnyx.api_base}/v2/ips
|
|
41
|
+
assert_requested :patch, "#{Telnyx.api_base}/v2/ips/#{id}"
|
|
38
42
|
end
|
|
39
43
|
end
|
|
40
44
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class LedgerBillingGroupReportTest < Test::Unit::TestCase
|
|
7
|
+
should "create ledger_billing_group_reports" do
|
|
8
|
+
LedgerBillingGroupReport.create
|
|
9
|
+
assert_requested :post, "#{Telnyx.api_base}/v2/ledger_billing_group_reports"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
should "retrieve ledger_billing_group_reports" do
|
|
13
|
+
ledger = LedgerBillingGroupReport.retrieve("70308070-fb3c-32ee-0a59-ce012cd4840d")
|
|
14
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/ledger_billing_group_reports/70308070-fb3c-32ee-0a59-ce012cd4840d"
|
|
15
|
+
assert_kind_of LedgerBillingGroupReport, ledger
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class ManagedAccountTest < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
@id = "d5cced2b-b3c2-7c43-4d8e-0d834c87f7e8"
|
|
9
|
+
end
|
|
10
|
+
should "list managed_accounts" do
|
|
11
|
+
managed_account = ManagedAccount.list
|
|
12
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/managed_accounts"
|
|
13
|
+
assert_kind_of ListObject, managed_account
|
|
14
|
+
assert_kind_of TelnyxObject, managed_account.first
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
should "create managed_account" do
|
|
18
|
+
ManagedAccount.create(
|
|
19
|
+
business_name: "Telnyx"
|
|
20
|
+
)
|
|
21
|
+
assert_requested :post, "#{Telnyx.api_base}/v2/managed_accounts"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
should "retrieve managed_account" do
|
|
25
|
+
managed_account = ManagedAccount.retrieve(@id)
|
|
26
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/managed_accounts/#{@id}"
|
|
27
|
+
assert_kind_of TelnyxObject, managed_account
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
should "list of allocatable_global_outbound_channels" do
|
|
31
|
+
ManagedAccount.allocatable_global_outbound_channels
|
|
32
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/managed_accounts/allocatable_global_outbound_channels"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
should "update_global_channel_limit" do
|
|
36
|
+
managed_account = ManagedAccount.retrieve(@id)
|
|
37
|
+
id = managed_account.id.gsub(/\s+/, "+").freeze
|
|
38
|
+
managed_account.update_global_channel_limit(api_user: "test")
|
|
39
|
+
assert_requested :patch, "#{Telnyx.api_base}/v2/managed_accounts/#{id}/update_global_channel_limit"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class MdrUsageReportTest < Test::Unit::TestCase
|
|
7
|
+
setup do
|
|
8
|
+
@id = "d5cced2b-b3c2-7c43-4d8e-0d834c87f7e8"
|
|
9
|
+
end
|
|
10
|
+
should "list mdr usage reports" do
|
|
11
|
+
mdr_usage_reports = MdrUsageReport.list
|
|
12
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/reports/mdr_usage_reports"
|
|
13
|
+
assert_kind_of ListObject, mdr_usage_reports
|
|
14
|
+
assert_kind_of TelnyxObject, mdr_usage_reports.first
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
should "create mdr usage report" do
|
|
18
|
+
MdrUsageReport.create(
|
|
19
|
+
end_date: "2024-12-02T00:00:00-06:00",
|
|
20
|
+
start_date: "2024-12-01T00:00:00-06:00",
|
|
21
|
+
aggregation_type: "PROFILE"
|
|
22
|
+
)
|
|
23
|
+
assert_requested :post, "#{Telnyx.api_base}/v2/reports/mdr_usage_reports"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
should "retrieve mdr usage report" do
|
|
27
|
+
mdr_usage_report = MdrUsageReport.retrieve(@id)
|
|
28
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/reports/mdr_usage_reports/#{@id}"
|
|
29
|
+
assert_kind_of TelnyxObject, mdr_usage_report
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
should "delete mdr usage report" do
|
|
33
|
+
mdr_usage_report = MdrUsageReport.retrieve(@id)
|
|
34
|
+
id = mdr_usage_report.id.gsub(/\s+/, "+").freeze
|
|
35
|
+
mdr_usage_report.delete
|
|
36
|
+
assert_requested :delete, "#{Telnyx.api_base}/v2/reports/mdr_usage_reports/#{id}"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
should "list of sync mdr_usage_reports" do
|
|
40
|
+
omit "Object mismatch"
|
|
41
|
+
mdr_usage_report = MdrUsageReport.sync
|
|
42
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/reports/cdr_usage_reports/sync"
|
|
43
|
+
|
|
44
|
+
assert_kind_of ListObject, mdr_usage_report
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../test_helper"
|
|
4
|
+
|
|
5
|
+
module Telnyx
|
|
6
|
+
class MessageNumberPoolTest < Test::Unit::TestCase
|
|
7
|
+
should "be creatable" do
|
|
8
|
+
message = Telnyx::MessageNumberPool.create(
|
|
9
|
+
to: "+18005554000",
|
|
10
|
+
from: "+18005559000",
|
|
11
|
+
text: "Hello, World!",
|
|
12
|
+
messaging_profile_id: "PROFILE_ID"
|
|
13
|
+
)
|
|
14
|
+
assert_requested :post, "#{Telnyx.api_base}/v2/messages/number_pool"
|
|
15
|
+
assert message.is_a?(Telnyx::Message)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
data/test/telnyx/message_test.rb
CHANGED
|
@@ -5,8 +5,8 @@ require_relative "../test_helper"
|
|
|
5
5
|
module Telnyx
|
|
6
6
|
class MessageTest < Test::Unit::TestCase
|
|
7
7
|
should "be retrievable" do
|
|
8
|
-
message = Telnyx::Message.retrieve("
|
|
9
|
-
assert_requested :get, "#{Telnyx.api_base}/v2/messages/
|
|
8
|
+
message = Telnyx::Message.retrieve("24b1cc47-fd1e-848b-feb7-65f9d18cca13")
|
|
9
|
+
assert_requested :get, "#{Telnyx.api_base}/v2/messages/24b1cc47-fd1e-848b-feb7-65f9d18cca13"
|
|
10
10
|
assert message.is_a?(Telnyx::Message)
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -22,9 +22,10 @@ module Telnyx
|
|
|
22
22
|
should "be saveable" do
|
|
23
23
|
messaging_phone_number = Telnyx::MessagingPhoneNumber.retrieve("123")
|
|
24
24
|
messaging_phone_number.messaging_profile_id = "value"
|
|
25
|
+
id = messaging_phone_number.id.gsub(/\s+/, "+").freeze
|
|
25
26
|
messaging_phone_number.save
|
|
26
27
|
# assert_requested :patch, "#{Telnyx.api_base}/v2/messaging_phone_numbers/#{messaging_phone_number.id}"
|
|
27
|
-
assert_requested :patch, "#{Telnyx.api_base}/v2/phone_numbers/#{
|
|
28
|
+
assert_requested :patch, "#{Telnyx.api_base}/v2/phone_numbers/#{id}/messaging"
|
|
28
29
|
end
|
|
29
30
|
|
|
30
31
|
should "be updateable" do
|