From 0597666d6c0291bbfc6d48c783b57159ec2f6a09 Mon Sep 17 00:00:00 2001 From: lunarfyre7 <15057106+lunarfyre7@users.noreply.github.com> Date: Tue, 17 Aug 2021 14:39:30 -0700 Subject: [PATCH] add new wireless endpoints (#78) * add new wireless endpoints added: * ota_updates * mobile_operator_networks * replace coveralls with coveralls_reborn --- Gemfile | 2 +- lib/telnyx.rb | 8 +++++--- lib/telnyx/mobile_operator_network.rb | 9 +++++++++ lib/telnyx/ota_update.rb | 9 +++++++++ test/telnyx/mobile_operator_network_test.rb | 14 ++++++++++++++ test/telnyx/ota_update_test.rb | 20 ++++++++++++++++++++ 6 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 lib/telnyx/mobile_operator_network.rb create mode 100644 lib/telnyx/ota_update.rb create mode 100644 test/telnyx/mobile_operator_network_test.rb create mode 100644 test/telnyx/ota_update_test.rb diff --git a/Gemfile b/Gemfile index cb78711..0ca6235 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ source "https://rubygems.org" gemspec group :development do - gem "coveralls", require: false + gem "coveralls_reborn", require: false gem "faraday", "~> 1.0" gem "mocha", "~> 0.13.2" gem "rake" diff --git a/lib/telnyx.rb b/lib/telnyx.rb index 129cb22..0164ea7 100644 --- a/lib/telnyx.rb +++ b/lib/telnyx.rb @@ -46,8 +46,8 @@ require "telnyx/connection" require "telnyx/credential_connection" require "telnyx/event" -require "telnyx/fax" require "telnyx/fax_application" +require "telnyx/fax" require "telnyx/fqdn_connection" require "telnyx/fqdn" require "telnyx/ip_connection" @@ -55,18 +55,20 @@ require "telnyx/message" require "telnyx/messaging_phone_number" require "telnyx/messaging_profile" +require "telnyx/mobile_operator_network" require "telnyx/number_lookup" require "telnyx/number_order_document" require "telnyx/number_order" require "telnyx/number_reservation" +require "telnyx/ota_update" require "telnyx/outbound_voice_profile" require "telnyx/phone_number_regulatory_requirement" require "telnyx/phone_number" -require "telnyx/portout" require "telnyx/porting_order" +require "telnyx/portout" require "telnyx/public_key" -require "telnyx/queue" require "telnyx/queue_call" +require "telnyx/queue" require "telnyx/regulatory_requirement" require "telnyx/sim_card" require "telnyx/telephony_credential" diff --git a/lib/telnyx/mobile_operator_network.rb b/lib/telnyx/mobile_operator_network.rb new file mode 100644 index 0000000..81aed0e --- /dev/null +++ b/lib/telnyx/mobile_operator_network.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Telnyx + class MobileOperatorNetwork < APIResource + extend APIOperations::List + + OBJECT_NAME = "mobile_operator_network".freeze + end +end diff --git a/lib/telnyx/ota_update.rb b/lib/telnyx/ota_update.rb new file mode 100644 index 0000000..ec09727 --- /dev/null +++ b/lib/telnyx/ota_update.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Telnyx + class OtaUpdate < APIResource + extend APIOperations::List + + OBJECT_NAME = "ota_update".freeze + end +end diff --git a/test/telnyx/mobile_operator_network_test.rb b/test/telnyx/mobile_operator_network_test.rb new file mode 100644 index 0000000..90122b9 --- /dev/null +++ b/test/telnyx/mobile_operator_network_test.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +module Telnyx + class MobileOperatorNetworkTest < Test::Unit::TestCase + should "be listable" do + mobile_ops = MobileOperatorNetwork.list + assert_requested :get, "#{Telnyx.api_base}/v2/mobile_operator_networks" + assert_kind_of ListObject, mobile_ops + assert_kind_of MobileOperatorNetwork, mobile_ops.first + end + end +end diff --git a/test/telnyx/ota_update_test.rb b/test/telnyx/ota_update_test.rb new file mode 100644 index 0000000..f150570 --- /dev/null +++ b/test/telnyx/ota_update_test.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +module Telnyx + class OtaUpdateTest < Test::Unit::TestCase + should "be retrievable" do + ota_update = OtaUpdate.retrieve "12345" + assert_requested :get, "#{Telnyx.api_base}/v2/ota_updates/12345" + assert_kind_of OtaUpdate, ota_update + end + + should "be listable" do + ota_updates = OtaUpdate.list + assert_requested :get, "#{Telnyx.api_base}/v2/ota_updates" + assert_kind_of ListObject, ota_updates + assert_kind_of OtaUpdate, ota_updates.first + end + end +end