Class: Twilio::REST::Verify::V2::VerificationAttemptInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/verify/v2/verification_attempt.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ VerificationAttemptInstance

Initialize the VerificationAttemptInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this VerificationAttempt resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 439

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'service_sid' => payload['service_sid'],
        'verification_sid' => payload['verification_sid'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'conversion_status' => payload['conversion_status'],
        'channel' => payload['channel'],
        'price' => payload['price'],
        'channel_data' => payload['channel_data'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Verification resource.

Returns:



482
483
484
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 482

def 
    @properties['account_sid']
end

#channelChannels

Returns:

  • (Channels)


518
519
520
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 518

def channel
    @properties['channel']
end

#channel_dataHash

Returns An object containing the channel specific information for an attempt.

Returns:

  • (Hash)

    An object containing the channel specific information for an attempt.



530
531
532
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 530

def channel_data
    @properties['channel_data']
end

#contextVerificationAttemptContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



467
468
469
470
471
472
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 467

def context
    unless @instance_context
        @instance_context = VerificationAttemptContext.new(@version , @params['sid'])
    end
    @instance_context
end

#conversion_statusConversionStatus

Returns:

  • (ConversionStatus)


512
513
514
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 512

def conversion_status
    @properties['conversion_status']
end

#date_createdTime

Returns The date that this Attempt was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



500
501
502
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 500

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this Attempt was updated, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



506
507
508
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 506

def date_updated
    @properties['date_updated']
end

#fetchVerificationAttemptInstance

Fetch the VerificationAttemptInstance

Returns:



543
544
545
546
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 543

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



557
558
559
560
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 557

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Verify.V2.VerificationAttemptInstance #{values}>"
end

#priceHash

Returns An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](www.twilio.com/en-us/verify/pricing).

Returns:

  • (Hash)

    An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](www.twilio.com/en-us/verify/pricing).



524
525
526
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 524

def price
    @properties['price']
end

#service_sidString

Returns The SID of the [Service](www.twilio.com/docs/verify/api/service) used to generate the attempt.

Returns:



488
489
490
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 488

def service_sid
    @properties['service_sid']
end

#sidString

Returns The SID that uniquely identifies the verification attempt resource.

Returns:

  • (String)

    The SID that uniquely identifies the verification attempt resource.



476
477
478
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 476

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



550
551
552
553
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 550

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Verify.V2.VerificationAttemptInstance #{values}>"
end

#urlString

Returns:

  • (String)


536
537
538
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 536

def url
    @properties['url']
end

#verification_sidString

Returns The SID of the [Verification](www.twilio.com/docs/verify/api/verification) that generated the attempt.

Returns:



494
495
496
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 494

def verification_sid
    @properties['verification_sid']
end