Skip to content

Commit

Permalink
Add message number pool resource (#84)
Browse files Browse the repository at this point in the history
Co-authored-by: ADandyGuyInSpace <[email protected]>
  • Loading branch information
alepore and ADandyGuyInSpace authored Feb 27, 2024
1 parent 7767a7d commit 814e90a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/telnyx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
require "telnyx/ip_connection"
require "telnyx/ip"
require "telnyx/message"
require "telnyx/message_number_pool"
require "telnyx/messaging_phone_number"
require "telnyx/messaging_profile"
require "telnyx/mobile_operator_network"
Expand Down
9 changes: 9 additions & 0 deletions lib/telnyx/message_number_pool.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Telnyx
class MessageNumberPool < APIResource
extend Telnyx::APIOperations::Create

RESOURCE_PATH = "messages/number_pool"
end
end
18 changes: 18 additions & 0 deletions test/telnyx/message_number_pool_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

require_relative "../test_helper"

module Telnyx
class MessageNumberPoolTest < Test::Unit::TestCase
should "be creatable" do
message = Telnyx::MessageNumberPool.create(
to: "+18005554000",
from: "+18005559000",
text: "Hello, World!",
messaging_profile_id: "PROFILE_ID"
)
assert_requested :post, "#{Telnyx.api_base}/v2/messages/number_pool"
assert message.is_a?(Telnyx::Message)
end
end
end

0 comments on commit 814e90a

Please sign in to comment.