lib/telnyx/verification.rb in telnyx-2.6.0 vs lib/telnyx/verification.rb in telnyx-2.7.0
- old
+ new
@@ -6,10 +6,14 @@
class Response < TelnyxObject; end
extend APIOperations::Create
extend APIOperations::NestedResource
+ class << self
+ private :create
+ end
+
nested_resource_class_methods "by_telephone",
path: "by_tn",
operations: [:retrieve],
instance_methods: {
retrieve: "by_telephone",
@@ -17,9 +21,14 @@
def self.submit_code(phone_number: nil, code: nil)
url = "#{resource_url}/by_phone_number/#{CGI.escape phone_number}/actions/verify"
resp, _opts = request(:post, url, code: code)
Response.construct_from resp.data[:data]
+ end
+
+ # Trigger a call verification
+ def self.call(params = {}, opts = {})
+ create(params, { **opts, resource_url: "#{resource_url}/call" })
end
OBJECT_NAME = "verify_verification".freeze
RESOURCE_PATH = "verifications".freeze
end