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.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/.github/scripts/before_install.sh +10 -9
  3. data/.github/workflows/publish-gem-on-release.yml +6 -6
  4. data/.github/workflows/ruby.yml +4 -4
  5. data/.rubocop.yml +1 -1
  6. data/Gemfile +7 -8
  7. data/README.md +1 -1
  8. data/Spec3.json +77839 -0
  9. data/VERSION +1 -1
  10. data/lib/telnyx/access_control_ip.rb +13 -0
  11. data/lib/telnyx/access_ip_range.rb +12 -0
  12. data/lib/telnyx/address.rb +9 -0
  13. data/lib/telnyx/api_operations/delete.rb +1 -1
  14. data/lib/telnyx/api_resource.rb +4 -1
  15. data/lib/telnyx/authentication_providers.rb +12 -0
  16. data/lib/telnyx/available_phone_number.rb +5 -0
  17. data/lib/telnyx/balance.rb +12 -0
  18. data/lib/telnyx/batch_mdr_report.rb +15 -0
  19. data/lib/telnyx/brand.rb +13 -0
  20. data/lib/telnyx/bulk_creation.rb +21 -0
  21. data/lib/telnyx/bulk_credential.rb +16 -0
  22. data/lib/telnyx/bulk_sim_card_action.rb +9 -0
  23. data/lib/telnyx/business_identitie.rb +9 -0
  24. data/lib/telnyx/call.rb +2 -2
  25. data/lib/telnyx/call_event.rb +9 -0
  26. data/lib/telnyx/call_recording.rb +12 -0
  27. data/lib/telnyx/campaign.rb +34 -0
  28. data/lib/telnyx/cdr_usage_report.rb +13 -0
  29. data/lib/telnyx/channel_zone.rb +10 -0
  30. data/lib/telnyx/comment.rb +20 -0
  31. data/lib/telnyx/conference.rb +1 -1
  32. data/lib/telnyx/connection.rb +5 -0
  33. data/lib/telnyx/csv_download.rb +10 -0
  34. data/lib/telnyx/custom_storage_credential.rb +7 -0
  35. data/lib/telnyx/detail_record.rb +9 -0
  36. data/lib/telnyx/dialogflow_connection.rb +20 -0
  37. data/lib/telnyx/document.rb +20 -0
  38. data/lib/telnyx/dynamic_emergency_address.rb +12 -0
  39. data/lib/telnyx/dynamic_emergency_endpoint.rb +12 -0
  40. data/lib/telnyx/embedding.rb +14 -0
  41. data/lib/telnyx/enum.rb +15 -0
  42. data/lib/telnyx/fax.rb +14 -0
  43. data/lib/telnyx/global_ip.rb +10 -0
  44. data/lib/telnyx/global_ip_allowed_port.rb +8 -0
  45. data/lib/telnyx/global_ip_assignment.rb +12 -0
  46. data/lib/telnyx/global_ip_assignment_health.rb +8 -0
  47. data/lib/telnyx/global_ip_assignment_usage.rb +8 -0
  48. data/lib/telnyx/global_ip_latency.rb +8 -0
  49. data/lib/telnyx/global_ip_protocol.rb +8 -0
  50. data/lib/telnyx/global_ip_usage.rb +8 -0
  51. data/lib/telnyx/inference.rb +9 -0
  52. data/lib/telnyx/inventory_coverage.rb +9 -0
  53. data/lib/telnyx/ledger_billing_group_report.rb +9 -0
  54. data/lib/telnyx/managed_account.rb +32 -0
  55. data/lib/telnyx/mdr_usage_report.rb +21 -0
  56. data/lib/telnyx/media.rb +21 -0
  57. data/lib/telnyx/message_number_pool.rb +9 -0
  58. data/lib/telnyx/messaging_hosted_number_order.rb +21 -0
  59. data/lib/telnyx/messaging_profile.rb +14 -2
  60. data/lib/telnyx/messaging_tollfree_verification.rb +12 -0
  61. data/lib/telnyx/messaging_url_domain.rb +9 -0
  62. data/lib/telnyx/mobile_operator_network.rb +9 -0
  63. data/lib/telnyx/mobile_push_credential.rb +11 -0
  64. data/lib/telnyx/network.rb +19 -0
  65. data/lib/telnyx/notification_channel.rb +12 -0
  66. data/lib/telnyx/notification_event.rb +9 -0
  67. data/lib/telnyx/notification_event_condition.rb +9 -0
  68. data/lib/telnyx/notification_profile.rb +12 -0
  69. data/lib/telnyx/notification_setting.rb +12 -0
  70. data/lib/telnyx/number_block_order.rb +10 -0
  71. data/lib/telnyx/ota_update.rb +9 -0
  72. data/lib/telnyx/phone_number.rb +6 -0
  73. data/lib/telnyx/phone_number_block_job.rb +14 -0
  74. data/lib/telnyx/phone_number_campaigns.rb +12 -0
  75. data/lib/telnyx/portability_check.rb +9 -0
  76. data/lib/telnyx/porting_order.rb +39 -1
  77. data/lib/telnyx/portout.rb +9 -0
  78. data/lib/telnyx/private_wireless_gateway.rb +11 -0
  79. data/lib/telnyx/public_internet_gateway.rb +11 -0
  80. data/lib/telnyx/region.rb +9 -0
  81. data/lib/telnyx/requirement.rb +8 -0
  82. data/lib/telnyx/requirement_type.rb +8 -0
  83. data/lib/telnyx/room.rb +20 -0
  84. data/lib/telnyx/room_composition.rb +11 -0
  85. data/lib/telnyx/room_participant.rb +9 -0
  86. data/lib/telnyx/room_recording.rb +10 -0
  87. data/lib/telnyx/room_session.rb +18 -0
  88. data/lib/telnyx/short_code.rb +10 -0
  89. data/lib/telnyx/sim_card.rb +28 -2
  90. data/lib/telnyx/sim_card_action.rb +12 -0
  91. data/lib/telnyx/sim_card_data_usage_notification.rb +12 -0
  92. data/lib/telnyx/sim_card_group.rb +21 -0
  93. data/lib/telnyx/sim_card_group_action.rb +8 -0
  94. data/lib/telnyx/sim_card_order.rb +10 -0
  95. data/lib/telnyx/summary.rb +9 -0
  96. data/lib/telnyx/telephony_credential.rb +22 -0
  97. data/lib/telnyx/telnyx_client.rb +1 -2
  98. data/lib/telnyx/texml_application.rb +9 -0
  99. data/lib/telnyx/verification.rb +3 -3
  100. data/lib/telnyx/verified_calls_display_profile.rb +17 -0
  101. data/lib/telnyx/verify_profile.rb +1 -0
  102. data/lib/telnyx/version.rb +1 -1
  103. data/lib/telnyx/virtual_cross_connect.rb +20 -0
  104. data/lib/telnyx/virtual_cross_connect_region.rb +9 -0
  105. data/lib/telnyx/wdr.rb +13 -0
  106. data/lib/telnyx/webhook_deliverie.rb +9 -0
  107. data/lib/telnyx/wireguard_interface.rb +11 -0
  108. data/lib/telnyx/wireguard_peer.rb +21 -0
  109. data/lib/telnyx.rb +67 -3
  110. data/server.js +31 -0
  111. data/telnyx.gemspec +4 -2
  112. data/test/telnyx/api_resource_test.rb +25 -21
  113. data/test/telnyx/available_phone_number_test.rb +6 -0
  114. data/test/telnyx/batch_mdr_report_test.rb +35 -0
  115. data/test/telnyx/billing_group_test.rb +12 -8
  116. data/test/telnyx/bulk_credential_test.rb +20 -0
  117. data/test/telnyx/bulk_sim_card_action_test.rb +22 -0
  118. data/test/telnyx/business_identitie_test.rb +25 -0
  119. data/test/telnyx/call_control_application_test.rb +13 -9
  120. data/test/telnyx/call_control_test.rb +24 -23
  121. data/test/telnyx/call_event_test.rb +14 -0
  122. data/test/telnyx/call_recording_test.rb +28 -0
  123. data/test/telnyx/call_test.rb +29 -0
  124. data/test/telnyx/campaign_test.rb +32 -0
  125. data/test/telnyx/cdr_usage_report_test.rb +15 -0
  126. data/test/telnyx/channel_zone_test.rb +14 -0
  127. data/test/telnyx/comment_test.rb +32 -0
  128. data/test/telnyx/conference_test.rb +27 -16
  129. data/test/telnyx/connection_test.rb +8 -1
  130. data/test/telnyx/credential_connection_test.rb +5 -4
  131. data/test/telnyx/csv_download_test.rb +33 -0
  132. data/test/telnyx/custom_storage_credential_test.rb +17 -0
  133. data/test/telnyx/detail_record_test.rb +15 -0
  134. data/test/telnyx/dialogflow_connection_test.rb +32 -0
  135. data/test/telnyx/embedding_test.rb +27 -0
  136. data/test/telnyx/enum_test.rb +15 -0
  137. data/test/telnyx/fax_application_test.rb +5 -4
  138. data/test/telnyx/fax_test.rb +13 -4
  139. data/test/telnyx/fqdn_connection_test.rb +5 -5
  140. data/test/telnyx/fqdn_test.rb +12 -7
  141. data/test/telnyx/global_ip_allowed_port_test.rb +14 -0
  142. data/test/telnyx/global_ip_assignment_health_test.rb +14 -0
  143. data/test/telnyx/global_ip_assignment_test.rb +44 -0
  144. data/test/telnyx/global_ip_latency_test.rb +14 -0
  145. data/test/telnyx/global_ip_protocol_test.rb +14 -0
  146. data/test/telnyx/global_ip_test.rb +35 -0
  147. data/test/telnyx/global_ip_usage_test.rb +14 -0
  148. data/test/telnyx/inference_test.rb +12 -0
  149. data/test/telnyx/ip_connection_test.rb +12 -8
  150. data/test/telnyx/ip_test.rb +12 -8
  151. data/test/telnyx/ledger_billing_group_report_test.rb +18 -0
  152. data/test/telnyx/managed_account_test.rb +42 -0
  153. data/test/telnyx/mdr_usage_report_test.rb +47 -0
  154. data/test/telnyx/message_number_pool_test.rb +18 -0
  155. data/test/telnyx/message_test.rb +2 -2
  156. data/test/telnyx/messaging_phone_number_test.rb +2 -1
  157. data/test/telnyx/messaging_profile_test.rb +26 -14
  158. data/test/telnyx/messaging_tollfree_verification_test.rb +71 -0
  159. data/test/telnyx/messaging_url_domain_test.rb +14 -0
  160. data/test/telnyx/mobile_operator_network_test.rb +15 -0
  161. data/test/telnyx/mobile_push_credential_test.rb +33 -0
  162. data/test/telnyx/network_test.rb +49 -0
  163. data/test/telnyx/number_block_order_test.rb +28 -0
  164. data/test/telnyx/number_order_document_test.rb +4 -3
  165. data/test/telnyx/number_order_test.rb +3 -2
  166. data/test/telnyx/number_reservation_test.rb +2 -2
  167. data/test/telnyx/ota_update_test.rb +20 -0
  168. data/test/telnyx/phone_number_block_job_test.rb +25 -0
  169. data/test/telnyx/phone_number_regulatory_requirement_test.rb +2 -1
  170. data/test/telnyx/phone_number_test.rb +8 -6
  171. data/test/telnyx/porting_order_test.rb +45 -10
  172. data/test/telnyx/private_wireless_gateway_test.rb +32 -0
  173. data/test/telnyx/public_internet_gateway_test.rb +32 -0
  174. data/test/telnyx/queue_test.rb +9 -6
  175. data/test/telnyx/region_test.rb +14 -0
  176. data/test/telnyx/regulatory_requirement_test.rb +6 -3
  177. data/test/telnyx/requirement_test.rb +22 -0
  178. data/test/telnyx/requirement_type_test.rb +22 -0
  179. data/test/telnyx/room_composition_test.rb +32 -0
  180. data/test/telnyx/room_participant_test.rb +19 -0
  181. data/test/telnyx/room_recording_test.rb +27 -0
  182. data/test/telnyx/room_session_test.rb +47 -0
  183. data/test/telnyx/room_test.rb +52 -0
  184. data/test/telnyx/short_code_test.rb +30 -0
  185. data/test/telnyx/sim_card_data_usage_notification_test.rb +42 -0
  186. data/test/telnyx/sim_card_group_action_test.rb +22 -0
  187. data/test/telnyx/sim_card_group_test.rb +59 -0
  188. data/test/telnyx/sim_card_order_test.rb +27 -0
  189. data/test/telnyx/sim_card_test.rb +75 -10
  190. data/test/telnyx/summary_test.rb +12 -0
  191. data/test/telnyx/telephony_credential_test.rb +35 -6
  192. data/test/telnyx/texml_application_test.rb +25 -0
  193. data/test/telnyx/verification_test.rb +4 -4
  194. data/test/telnyx/verified_calls_display_profile_test.rb +33 -0
  195. data/test/telnyx/verify_profile_test.rb +16 -7
  196. data/test/telnyx/virtual_cross_connect_region_test.rb +22 -0
  197. data/test/telnyx/virtual_cross_connect_test.rb +49 -0
  198. data/test/telnyx/wdr_test.rb +14 -0
  199. data/test/telnyx/webhook_deliverie_test.rb +23 -0
  200. data/test/telnyx/wireguard_interface_test.rb +32 -0
  201. data/test/telnyx/wireguard_peer_test.rb +48 -0
  202. data/test/test_helper.rb +10 -26
  203. metadata +235 -37
  204. data/examples/2 factor authentication/Gemfile +0 -7
  205. data/examples/2 factor authentication/main.rb +0 -67
  206. data/examples/2 factor authentication/readme.md +0 -5
  207. 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
@@ -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,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class MessageNumberPool < APIResource
5
+ extend Telnyx::APIOperations::Create
6
+
7
+ RESOURCE_PATH = "messages/number_pool"
8
+ end
9
+ 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 Telnyx::APIOperations::NestedResource
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,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class MessagingUrlDomain < APIResource
5
+ extend APIOperations::List
6
+
7
+ OBJECT_NAME = "messaging_url_domain".freeze
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class MobileOperatorNetwork < APIResource
5
+ extend APIOperations::List
6
+
7
+ OBJECT_NAME = "mobile_operator_network".freeze
8
+ end
9
+ 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,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class NotificationEvent < APIResource
5
+ extend Telnyx::APIOperations::List
6
+
7
+ OBJECT_NAME = "notification_event".freeze
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class NotificationEventCondition < APIResource
5
+ extend Telnyx::APIOperations::List
6
+
7
+ OBJECT_NAME = "notificaiton_event_condition".freeze
8
+ end
9
+ 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,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class NumberBlockOrder < APIResource
5
+ extend Telnyx::APIOperations::List
6
+ extend Telnyx::APIOperations::Create
7
+
8
+ OBJECT_NAME = "number_block_order".freeze
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class OtaUpdate < APIResource
5
+ extend APIOperations::List
6
+
7
+ OBJECT_NAME = "ota_update".freeze
8
+ end
9
+ end
@@ -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
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class PortabilityCheck < APIResource
5
+ extend APIOperations::Create
6
+
7
+ OBJECT_NAME = "portability_check".freeze
8
+ end
9
+ end
@@ -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
@@ -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
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class PrivateWirelessGateway < APIResource
5
+ extend APIOperations::List
6
+ extend APIOperations::Create
7
+ include APIOperations::Delete
8
+
9
+ OBJECT_NAME = "private_wireless_gateway".freeze
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class PublicInternetGateway < APIResource
5
+ extend APIOperations::List
6
+ extend APIOperations::Create
7
+ include APIOperations::Delete
8
+
9
+ OBJECT_NAME = "public_internet_gateway".freeze
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class Region < APIResource
5
+ extend Telnyx::APIOperations::List
6
+
7
+ OBJECT_NAME = "region".freeze
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class Requirement < APIResource
5
+ extend APIOperations::List
6
+ OBJECT_NAME = "requirement".freeze
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class RequirementType < APIResource
5
+ extend APIOperations::List
6
+ OBJECT_NAME = "requirement_type".freeze
7
+ end
8
+ end
@@ -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,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class RoomComposition < APIResource
5
+ include APIOperations::Delete
6
+ extend APIOperations::List
7
+ extend APIOperations::Create
8
+
9
+ OBJECT_NAME = "room_composition".freeze
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class RoomParticipant < APIResource
5
+ extend APIOperations::List
6
+
7
+ OBJECT_NAME = "room_participant".freeze
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class RoomRecording < APIResource
5
+ include APIOperations::Delete
6
+ extend APIOperations::List
7
+
8
+ OBJECT_NAME = "room_recording".freeze
9
+ end
10
+ 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
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class ShortCode < APIResource
5
+ include APIOperations::Save
6
+ extend APIOperations::List
7
+
8
+ OBJECT_NAME = "short_code".freeze
9
+ end
10
+ end
@@ -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
- OBJECT_NAME = "sim_card".freeze
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
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class SimCardGroupAction < APIResource
5
+ extend APIOperations::List
6
+ OBJECT_NAME = "sim_card_group_action".freeze
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ class SimCardOrder < APIResource
5
+ extend APIOperations::List
6
+ extend APIOperations::Create
7
+
8
+ OBJECT_NAME = "sim_card_order".freeze
9
+ end
10
+ end