lib/twilio-ruby/rest/verify/v2.rb in twilio-ruby-5.71.0 vs lib/twilio-ruby/rest/verify/v2.rb in twilio-ruby-5.72.0
- old
+ new
@@ -14,10 +14,11 @@
# Initialize the V2 version of Verify
def initialize(domain)
super
@version = 'v2'
@forms = nil
+ @safelist = nil
@services = nil
@verification_attempts = nil
@verification_attempts_summary = nil
@templates = nil
end
@@ -33,9 +34,26 @@
end
if form_type == :unset
@forms ||= FormList.new self
else
FormContext.new(self, form_type)
+ end
+ end
+
+ ##
+ # @param [String] phone_number The phone number to be fetched from SafeList. Phone
+ # numbers must be in {E.164
+ # format}[https://www.twilio.com/docs/glossary/what-e164].
+ # @return [Twilio::REST::Verify::V2::SafelistContext] if phone_number was passed.
+ # @return [Twilio::REST::Verify::V2::SafelistList]
+ def safelist(phone_number=:unset)
+ if phone_number.nil?
+ raise ArgumentError, 'phone_number cannot be nil'
+ end
+ if phone_number == :unset
+ @safelist ||= SafelistList.new self
+ else
+ SafelistContext.new(self, phone_number)
end
end
##
# @param [String] sid The Twilio-provided string that uniquely identifies the
\ No newline at end of file