class Twilio::REST::Verify::V2::ServiceContext::VerificationInstance

Public Class Methods

new(version, payload, service_sid: nil, sid: nil) click to toggle source

Initialize the VerificationInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] service_sid The SID of the

{Service}[https://www.twilio.com/docs/verify/api/service] the resource is
associated with.

@param [String] sid The Twilio-provided string that uniquely identifies the

Verification resource to fetch.

@return [VerificationInstance] VerificationInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
201 def initialize(version, payload, service_sid: nil, sid: nil)
202   super(version)
203 
204   # Marshaled Properties
205   @properties = {
206       'sid' => payload['sid'],
207       'service_sid' => payload['service_sid'],
208       'account_sid' => payload['account_sid'],
209       'to' => payload['to'],
210       'channel' => payload['channel'],
211       'status' => payload['status'],
212       'valid' => payload['valid'],
213       'lookup' => payload['lookup'],
214       'amount' => payload['amount'],
215       'payee' => payload['payee'],
216       'send_code_attempts' => payload['send_code_attempts'],
217       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
218       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
219       'url' => payload['url'],
220   }
221 
222   # Context
223   @instance_context = nil
224   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
225 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
252 def account_sid
253   @properties['account_sid']
254 end
amount() click to toggle source

@return [String] The amount of the associated PSD2 compliant transaction.

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
288 def amount
289   @properties['amount']
290 end
channel() click to toggle source

@return [verification.Channel] The verification method used.

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
264 def channel
265   @properties['channel']
266 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [VerificationContext] VerificationContext for this VerificationInstance

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
231 def context
232   unless @instance_context
233     @instance_context = VerificationContext.new(@version, @params['service_sid'], @params['sid'], )
234   end
235   @instance_context
236 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
306 def date_created
307   @properties['date_created']
308 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
312 def date_updated
313   @properties['date_updated']
314 end
fetch() click to toggle source

Fetch the VerificationInstance @return [VerificationInstance] Fetched VerificationInstance

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
334 def fetch
335   context.fetch
336 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
347 def inspect
348   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
349   "<Twilio.Verify.V2.VerificationInstance #{values}>"
350 end
lookup() click to toggle source

@return [Hash] Information about the phone number being verified

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
282 def lookup
283   @properties['lookup']
284 end
payee() click to toggle source

@return [String] The payee of the associated PSD2 compliant transaction

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
294 def payee
295   @properties['payee']
296 end
send_code_attempts() click to toggle source

@return [Array] An array of verification attempt objects.

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
300 def send_code_attempts
301   @properties['send_code_attempts']
302 end
service_sid() click to toggle source

@return [String] The SID of the Service that the resource is associated with

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
246 def service_sid
247   @properties['service_sid']
248 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
240 def sid
241   @properties['sid']
242 end
status() click to toggle source

@return [String] The status of the verification resource

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
270 def status
271   @properties['status']
272 end
to() click to toggle source

@return [String] The phone number or email being verified

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
258 def to
259   @properties['to']
260 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
340 def to_s
341   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
342   "<Twilio.Verify.V2.VerificationInstance #{values}>"
343 end
update(status: nil) click to toggle source

Update the VerificationInstance @param [verification.Status] status The new status of the resource. Can be:

`canceled` or `approved`.

@return [VerificationInstance] Updated VerificationInstance

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
327 def update(status: nil)
328   context.update(status: status, )
329 end
url() click to toggle source

@return [String] The absolute URL of the Verification resource

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
318 def url
319   @properties['url']
320 end
valid() click to toggle source

@return [Boolean] Whether the verification was successful

    # File lib/twilio-ruby/rest/verify/v2/service/verification.rb
276 def valid
277   @properties['valid']
278 end