telnyx 2.9.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 +30 -9
- 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 +20 -0
- data/lib/telnyx/bulk_creation.rb +21 -0
- data/lib/telnyx/bulk_credential.rb +16 -0
- data/lib/telnyx/bulk_phone_number_campaign.rb +23 -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 +42 -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 +22 -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/partner_campaign.rb +32 -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 +19 -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/openapi/README.md +31 -4
- data/test/telnyx/api_resource_test.rb +28 -22
- data/test/telnyx/available_phone_number_test.rb +6 -0
- data/test/telnyx/batch_mdr_report_test.rb +39 -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 +13 -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 +27 -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 +13 -0
- data/test/telnyx/telephony_credential_test.rb +35 -6
- data/test/telnyx/telnyx_client_test.rb +1 -0
- data/test/telnyx/texml_application_test.rb +25 -0
- data/test/telnyx/verification_test.rb +6 -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 +237 -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,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telnyx
|
4
|
+
class ManagedAccount < 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[enable disable].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
|
+
nested_resource_class_methods "update_global_channel_limit",
|
19
|
+
path: "update_global_channel_limit",
|
20
|
+
operations: [:update],
|
21
|
+
instance_methods: { update: "update_global_channel_limit" }
|
22
|
+
def self.allocatable_global_outbound_channels(params = {}, opts = {})
|
23
|
+
resp, opts = request(:get, "/v2/managed_accounts/allocatable_global_outbound_channels", params, opts)
|
24
|
+
Util.convert_to_telnyx_object(resp.data, opts)
|
25
|
+
end
|
26
|
+
|
27
|
+
def update_global_channel_limit(opts)
|
28
|
+
self.class.update_update_global_channel_limit(id, nil, opts)
|
29
|
+
end
|
30
|
+
OBJECT_NAME = "managed_account".freeze
|
31
|
+
end
|
32
|
+
end
|
@@ -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
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telnyx
|
4
|
+
class PartnerCampaign < 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[mnoMetadata operationStatus].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
|
+
def sharing(params = {}, opts = {})
|
19
|
+
resp, opts = request(:post, "/10dlc/campaign/sharing/#{campaignId.gsub(/\s+/, '+')}", params, opts)
|
20
|
+
Util.convert_to_telnyx_object(resp.data, opts)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.resource_url(inner_id = nil)
|
24
|
+
path_prefix = "/10dlc"
|
25
|
+
object_path = "partnerCampaign"
|
26
|
+
|
27
|
+
inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}"
|
28
|
+
end
|
29
|
+
|
30
|
+
OBJECT_NAME = "partnerCampaign".freeze
|
31
|
+
end
|
32
|
+
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,19 @@
|
|
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
|
+
def self.resource_url(inner_id = nil)
|
11
|
+
path_prefix = "/10dlc"
|
12
|
+
object_path = "campaign"
|
13
|
+
|
14
|
+
inner_id.nil? ? "#{path_prefix}/#{object_path}" : "#{path_prefix}/#{object_path}/#{CGI.escape(inner_id)}"
|
15
|
+
end
|
16
|
+
|
17
|
+
OBJECT_NAME = "10dlc/phoneNumberCampaign".freeze
|
18
|
+
end
|
19
|
+
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
|