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,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class MdrUsageReport < APIResource
|
|
5
|
+
extend APIOperations::List
|
|
6
|
+
extend APIOperations::Create
|
|
7
|
+
include APIOperations::Delete
|
|
8
|
+
def self.resource_path(id = nil)
|
|
9
|
+
return "reports/mdr_usage_reports/#{CGI.escape(id)}" if id
|
|
10
|
+
|
|
11
|
+
"reports/mdr_usage_reports"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.sync(params = {}, opts = {})
|
|
15
|
+
opts = Util.normalize_opts(opts)
|
|
16
|
+
resp, opts = request(:get, "/v2/reports/cdr_usage_reports/sync", params, opts)
|
|
17
|
+
ListObject.construct_from(resp.data, opts)
|
|
18
|
+
end
|
|
19
|
+
OBJECT_NAME = "/reports/mdr_usage_report".freeze
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/telnyx/media.rb
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class Media < APIResource
|
|
5
|
+
extend APIOperations::List
|
|
6
|
+
extend APIOperations::Create
|
|
7
|
+
extend APIOperations::NestedResource
|
|
8
|
+
include APIOperations::Delete
|
|
9
|
+
include APIOperations::Save
|
|
10
|
+
|
|
11
|
+
ACTIONS = %w[download].freeze
|
|
12
|
+
ACTIONS.each do |action|
|
|
13
|
+
nested_resource_class_methods action,
|
|
14
|
+
path: %W[#{action}],
|
|
15
|
+
operations: [:create],
|
|
16
|
+
instance_methods: { create: action }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
OBJECT_NAME = "media".freeze
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class MessagingHostedNumberOrder < APIResource
|
|
5
|
+
extend Telnyx::APIOperations::List
|
|
6
|
+
extend Telnyx::APIOperations::Create
|
|
7
|
+
include Telnyx::APIOperations::Delete
|
|
8
|
+
include Telnyx::APIOperations::Save
|
|
9
|
+
extend APIOperations::NestedResource
|
|
10
|
+
|
|
11
|
+
ACTIONS = %w[file_upload].freeze
|
|
12
|
+
ACTIONS.each do |action|
|
|
13
|
+
nested_resource_class_methods action,
|
|
14
|
+
path: %W[action #{action}],
|
|
15
|
+
operations: [:create],
|
|
16
|
+
instance_methods: { create: action }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
OBJECT_NAME = "messaging_hosted_number_order".freeze
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -6,10 +6,22 @@ module Telnyx
|
|
|
6
6
|
include Telnyx::APIOperations::Delete
|
|
7
7
|
extend Telnyx::APIOperations::List
|
|
8
8
|
extend Telnyx::APIOperations::Create
|
|
9
|
-
extend
|
|
10
|
-
|
|
9
|
+
extend APIOperations::NestedResource
|
|
10
|
+
ACTIONS = %w[autoresp_configs].freeze
|
|
11
|
+
ACTIONS.each do |action|
|
|
12
|
+
nested_resource_class_methods action,
|
|
13
|
+
path: %W[#{action}],
|
|
14
|
+
operations: [:list],
|
|
15
|
+
instance_methods: { list: action }
|
|
16
|
+
end
|
|
11
17
|
OBJECT_NAME = "messaging_profile".freeze
|
|
12
18
|
|
|
19
|
+
nested_resource_class_methods :messaging_profile_metric,
|
|
20
|
+
operations: %i[list],
|
|
21
|
+
instance_methods: { list: "messaging_profile_metrics" }
|
|
22
|
+
nested_resource_class_methods :metric,
|
|
23
|
+
operations: %i[list],
|
|
24
|
+
instance_methods: { list: "metrics" }
|
|
13
25
|
nested_resource_class_methods :phone_number,
|
|
14
26
|
operations: %i[list],
|
|
15
27
|
instance_methods: { list: "phone_numbers" }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class MessagingTollfreeVerification < APIResource
|
|
5
|
+
extend APIOperations::List
|
|
6
|
+
extend APIOperations::Create
|
|
7
|
+
include APIOperations::Delete
|
|
8
|
+
include APIOperations::Save
|
|
9
|
+
|
|
10
|
+
OBJECT_NAME = "messaging_tollfree/verification/request".freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class MobilePushCredential < APIResource
|
|
5
|
+
include Telnyx::APIOperations::Delete
|
|
6
|
+
extend Telnyx::APIOperations::List
|
|
7
|
+
extend Telnyx::APIOperations::Create
|
|
8
|
+
|
|
9
|
+
OBJECT_NAME = "mobile_push_credential".freeze
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class Network < APIResource
|
|
5
|
+
include Telnyx::APIOperations::Save
|
|
6
|
+
include Telnyx::APIOperations::Delete
|
|
7
|
+
extend Telnyx::APIOperations::List
|
|
8
|
+
extend Telnyx::APIOperations::Create
|
|
9
|
+
extend APIOperations::NestedResource
|
|
10
|
+
ACTIONS = %w[network_interfaces].freeze
|
|
11
|
+
ACTIONS.each do |action|
|
|
12
|
+
nested_resource_class_methods action,
|
|
13
|
+
path: %W[#{action}],
|
|
14
|
+
operations: [:list],
|
|
15
|
+
instance_methods: { list: action }
|
|
16
|
+
end
|
|
17
|
+
OBJECT_NAME = "network".freeze
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class NotificationChannel < APIResource
|
|
5
|
+
extend Telnyx::APIOperations::List
|
|
6
|
+
extend Telnyx::APIOperations::Create
|
|
7
|
+
include Telnyx::APIOperations::Delete
|
|
8
|
+
include Telnyx::APIOperations::Save
|
|
9
|
+
|
|
10
|
+
OBJECT_NAME = "notification_channel".freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class NotificationProfile < APIResource
|
|
5
|
+
extend Telnyx::APIOperations::List
|
|
6
|
+
extend Telnyx::APIOperations::Create
|
|
7
|
+
include Telnyx::APIOperations::Delete
|
|
8
|
+
include Telnyx::APIOperations::Save
|
|
9
|
+
|
|
10
|
+
OBJECT_NAME = "notification_profile".freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class NotificationSetting < APIResource
|
|
5
|
+
extend Telnyx::APIOperations::List
|
|
6
|
+
extend Telnyx::APIOperations::Create
|
|
7
|
+
include Telnyx::APIOperations::Delete
|
|
8
|
+
include Telnyx::APIOperations::Save
|
|
9
|
+
|
|
10
|
+
OBJECT_NAME = "notification_setting".freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
data/lib/telnyx/phone_number.rb
CHANGED
|
@@ -18,6 +18,9 @@ module Telnyx
|
|
|
18
18
|
nested_resource_class_methods "inbound_channel",
|
|
19
19
|
path: ["inbound_channels"],
|
|
20
20
|
operations: %i[update list]
|
|
21
|
+
nested_resource_class_methods "job",
|
|
22
|
+
path: ["jobs"],
|
|
23
|
+
operations: %i[update list delete]
|
|
21
24
|
|
|
22
25
|
def update_messaging(opts)
|
|
23
26
|
self.class.update_messaging(id, nil, opts)
|
|
@@ -43,6 +46,9 @@ module Telnyx
|
|
|
43
46
|
list_messagings(nil)
|
|
44
47
|
end
|
|
45
48
|
|
|
49
|
+
def update_jobs=(_val)
|
|
50
|
+
self.class.update_job(nil, nil, value)
|
|
51
|
+
end
|
|
46
52
|
OBJECT_NAME = "phone_number".freeze
|
|
47
53
|
end
|
|
48
54
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class PhoneNumberBlockJob < APIResource
|
|
5
|
+
extend Telnyx::APIOperations::List
|
|
6
|
+
|
|
7
|
+
def self.delete_phone_number_block(params = {}, opts = {})
|
|
8
|
+
resp, opts = request(:post, "/v2/phone_number_blocks/jobs/delete_phone_number_block", params, opts)
|
|
9
|
+
Util.convert_to_telnyx_object(resp.data, opts)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
OBJECT_NAME = "phone_number_blocks/job".freeze
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class PhoneNumberCampaign < APIResource
|
|
5
|
+
extend APIOperations::List
|
|
6
|
+
extend APIOperations::Create
|
|
7
|
+
include APIOperations::Delete
|
|
8
|
+
include APIOperations::Save
|
|
9
|
+
|
|
10
|
+
OBJECT_NAME = "10dlc/phoneNumberCampaign".freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
data/lib/telnyx/porting_order.rb
CHANGED
|
@@ -7,7 +7,13 @@ module Telnyx
|
|
|
7
7
|
extend APIOperations::NestedResource
|
|
8
8
|
include APIOperations::Delete
|
|
9
9
|
include Telnyx::APIOperations::Save
|
|
10
|
-
|
|
10
|
+
ACTIONS = %w[activate].freeze
|
|
11
|
+
ACTIONS.each do |action|
|
|
12
|
+
nested_resource_class_methods action,
|
|
13
|
+
path: %W[actions #{action}],
|
|
14
|
+
operations: [:create],
|
|
15
|
+
instance_methods: { create: action }
|
|
16
|
+
end
|
|
11
17
|
nested_resource_class_methods :loa_template,
|
|
12
18
|
path: ["loa_template"],
|
|
13
19
|
operations: %i[list],
|
|
@@ -16,6 +22,38 @@ module Telnyx
|
|
|
16
22
|
path: ["porting_phone_numbers"],
|
|
17
23
|
operations: %i[list],
|
|
18
24
|
instance_methods: { list: "porting_phone_numbers" }
|
|
25
|
+
nested_resource_class_methods :exception_types,
|
|
26
|
+
path: ["exception_types"],
|
|
27
|
+
operations: %i[list],
|
|
28
|
+
instance_methods: { list: "exception_types" }
|
|
29
|
+
nested_resource_class_methods :allowed_foc_windows,
|
|
30
|
+
path: ["allowed_foc_windows"],
|
|
31
|
+
operations: %i[list],
|
|
32
|
+
instance_methods: { list: "allowed_foc_windows" }
|
|
33
|
+
nested_resource_class_methods :activation_job,
|
|
34
|
+
path: ["activiation_jobs"],
|
|
35
|
+
operations: %i[list],
|
|
36
|
+
instance_methods: { list: "activation_jobs" }
|
|
37
|
+
nested_resource_class_methods :confirm,
|
|
38
|
+
path: ["confirm"],
|
|
39
|
+
operations: %i[create],
|
|
40
|
+
instance_methods: { create: "confirm" }
|
|
41
|
+
nested_resource_class_methods :cancel,
|
|
42
|
+
path: ["cancel"],
|
|
43
|
+
operations: %i[create],
|
|
44
|
+
instance_methods: { create: "cancel" }
|
|
45
|
+
nested_resource_class_methods :sub_request,
|
|
46
|
+
path: ["sub_request"],
|
|
47
|
+
operations: %i[list],
|
|
48
|
+
instance_methods: { list: "sub_request" }
|
|
49
|
+
nested_resource_class_methods :requirements,
|
|
50
|
+
path: ["requirements"],
|
|
51
|
+
operations: %i[list],
|
|
52
|
+
instance_methods: { list: "requirements" }
|
|
53
|
+
nested_resource_class_methods :comments,
|
|
54
|
+
path: ["comments"],
|
|
55
|
+
operations: %i[list],
|
|
56
|
+
instance_methods: { list: "comments" }
|
|
19
57
|
OBJECT_NAME = "porting_order"
|
|
20
58
|
end
|
|
21
59
|
end
|
data/lib/telnyx/portout.rb
CHANGED
|
@@ -6,6 +6,15 @@ module Telnyx
|
|
|
6
6
|
extend APIOperations::Create
|
|
7
7
|
include APIOperations::Delete
|
|
8
8
|
include APIOperations::Save
|
|
9
|
+
extend APIOperations::NestedResource
|
|
10
|
+
|
|
11
|
+
ACTIONS = %w[status comments supporting_documents].freeze
|
|
12
|
+
ACTIONS.each do |action|
|
|
13
|
+
nested_resource_class_methods action,
|
|
14
|
+
path: %W[#{action}],
|
|
15
|
+
operations: [:create],
|
|
16
|
+
instance_methods: { create: action }
|
|
17
|
+
end
|
|
9
18
|
|
|
10
19
|
OBJECT_NAME = "portout".freeze
|
|
11
20
|
end
|
data/lib/telnyx/room.rb
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class Room < APIResource
|
|
5
|
+
include APIOperations::Delete
|
|
6
|
+
include APIOperations::Save
|
|
7
|
+
extend APIOperations::List
|
|
8
|
+
extend APIOperations::Create
|
|
9
|
+
extend APIOperations::NestedResource
|
|
10
|
+
ACTIONS = %w[generate_join_client_token refresh_client_token].freeze
|
|
11
|
+
ACTIONS.each do |action|
|
|
12
|
+
nested_resource_class_methods action,
|
|
13
|
+
path: %W[actions #{action}],
|
|
14
|
+
operations: [:create],
|
|
15
|
+
instance_methods: { create: action }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
OBJECT_NAME = "room".freeze
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class RoomSession < APIResource
|
|
5
|
+
extend APIOperations::List
|
|
6
|
+
extend APIOperations::Create
|
|
7
|
+
extend APIOperations::NestedResource
|
|
8
|
+
ACTIONS = %w[kick mute unmute end].freeze
|
|
9
|
+
ACTIONS.each do |action|
|
|
10
|
+
nested_resource_class_methods action,
|
|
11
|
+
path: %W[actions #{action}],
|
|
12
|
+
operations: [:create],
|
|
13
|
+
instance_methods: { create: action }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
OBJECT_NAME = "room_session".freeze
|
|
17
|
+
end
|
|
18
|
+
end
|
data/lib/telnyx/sim_card.rb
CHANGED
|
@@ -6,20 +6,45 @@ module Telnyx
|
|
|
6
6
|
extend APIOperations::NestedResource
|
|
7
7
|
extend APIOperations::List
|
|
8
8
|
|
|
9
|
-
ACTIONS = %w[enable disable].freeze
|
|
9
|
+
ACTIONS = %w[enable disable set_standby public_ip wireless_connectivity_logs device_details set_public_ip set_network_preferences remove_public_ip delete_network_preferences].freeze
|
|
10
10
|
ACTIONS.each do |action|
|
|
11
11
|
nested_resource_class_methods action,
|
|
12
12
|
path: %W[actions #{action}],
|
|
13
13
|
operations: [:create],
|
|
14
14
|
instance_methods: { create: action }
|
|
15
15
|
end
|
|
16
|
+
nested_resource_class_methods :device_details,
|
|
17
|
+
path: ["device_details"],
|
|
18
|
+
operations: %i[list],
|
|
19
|
+
instance_methods: { list: "device_details" }
|
|
20
|
+
nested_resource_class_methods :activation_code,
|
|
21
|
+
path: ["activation_code"],
|
|
22
|
+
operations: %i[list],
|
|
23
|
+
instance_methods: { list: "activation_code" }
|
|
16
24
|
|
|
17
25
|
def self.register(params = {}, opts = {})
|
|
18
26
|
resp, opts = request(:post, "/v2/actions/register/sim_cards", params, opts)
|
|
19
27
|
Util.convert_to_telnyx_object(resp.data, opts)
|
|
20
28
|
end
|
|
21
29
|
|
|
22
|
-
|
|
30
|
+
# Additional action to validate registration codes
|
|
31
|
+
def self.validate_registration_codes(params = {}, opts = {})
|
|
32
|
+
opts = Util.normalize_opts(opts)
|
|
33
|
+
resp, opts = request(:post, "/v2/sim_cards/actions/validate_registration_codes", params, opts)
|
|
34
|
+
Util.convert_to_telnyx_object(resp.data, opts)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Additional action to bulk_set_public_ips
|
|
38
|
+
def self.bulk_set_public_ips(params = {}, opts = {})
|
|
39
|
+
opts = Util.normalize_opts(opts)
|
|
40
|
+
resp, opts = request(:post, "/v2/sim_cards/actions/bulk_set_public_ips", params, opts)
|
|
41
|
+
Util.convert_to_telnyx_object(resp.data, opts)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def self.network_preferences(params = {}, opts = {})
|
|
45
|
+
resp, opts = request(:put, "/v2/actions/network_preferences/sim_cards", params, opts)
|
|
46
|
+
Util.convert_to_telnyx_object(resp.data, opts)
|
|
47
|
+
end
|
|
23
48
|
|
|
24
49
|
# depreciated api
|
|
25
50
|
def activate
|
|
@@ -31,5 +56,6 @@ module Telnyx
|
|
|
31
56
|
warn "[DEPRECATION] SimCard#deactivate is deprecated, use enable instead."
|
|
32
57
|
disable
|
|
33
58
|
end
|
|
59
|
+
OBJECT_NAME = "sim_card".freeze
|
|
34
60
|
end
|
|
35
61
|
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class SimCardAction < APIResource
|
|
5
|
+
extend APIOperations::List
|
|
6
|
+
extend APIOperations::Create
|
|
7
|
+
include APIOperations::Delete
|
|
8
|
+
include APIOperations::Save
|
|
9
|
+
|
|
10
|
+
OBJECT_NAME = "sim_card_actions".freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class SimCardDataUsageNotification < APIResource
|
|
5
|
+
extend APIOperations::List
|
|
6
|
+
extend APIOperations::Create
|
|
7
|
+
include APIOperations::Delete
|
|
8
|
+
include APIOperations::Save
|
|
9
|
+
|
|
10
|
+
OBJECT_NAME = "sim_card_data_usage_notification".freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
class SimCardGroup < APIResource
|
|
5
|
+
extend APIOperations::List
|
|
6
|
+
extend APIOperations::Create
|
|
7
|
+
include APIOperations::Delete
|
|
8
|
+
include APIOperations::Save
|
|
9
|
+
extend APIOperations::NestedResource
|
|
10
|
+
|
|
11
|
+
ACTIONS = %w[set_private_wireless_gateway remove_private_wireless_gateway].freeze
|
|
12
|
+
ACTIONS.each do |action|
|
|
13
|
+
nested_resource_class_methods action,
|
|
14
|
+
path: %W[actions #{action}],
|
|
15
|
+
operations: [:create],
|
|
16
|
+
instance_methods: { create: action }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
OBJECT_NAME = "sim_card_group".freeze
|
|
20
|
+
end
|
|
21
|
+
end
|