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

  • sid (String) (defaults to: nil)

    The unique SID identifier of a Verification Attempt


219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 219

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'service_sid' => payload['service_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'],
      'channel_data' => payload['channel_data'],
      'url' => payload['url'],
  }

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

Instance Method Details

#account_sidString

Returns Account Sid.

Returns:

  • (String)

    Account Sid


259
260
261
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 259

def 
  @properties['account_sid']
end

#channelverification_attempt.Channels

Returns Channel used for the attempt.

Returns:

  • (verification_attempt.Channels)

    Channel used for the attempt


289
290
291
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 289

def channel
  @properties['channel']
end

#channel_dataHash

Returns Object with the channel information for an attempt.

Returns:

  • (Hash)

    Object with the channel information for an attempt


295
296
297
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 295

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:


244
245
246
247
248
249
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 244

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

#conversion_statusverification_attempt.ConversionStatus

Returns Status of a conversion.

Returns:

  • (verification_attempt.ConversionStatus)

    Status of a conversion


283
284
285
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 283

def conversion_status
  @properties['conversion_status']
end

#date_createdTime

Returns The date this Attempt was created.

Returns:

  • (Time)

    The date this Attempt was created


271
272
273
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 271

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this Attempt was updated.

Returns:

  • (Time)

    The date this Attempt was updated


277
278
279
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 277

def date_updated
  @properties['date_updated']
end

#fetchVerificationAttemptInstance

Fetch the VerificationAttemptInstance

Returns:


308
309
310
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 308

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


321
322
323
324
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 321

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

#service_sidString

Returns The service_sid.

Returns:

  • (String)

    The service_sid


265
266
267
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 265

def service_sid
  @properties['service_sid']
end

#sidString

Returns A string that uniquely identifies this Verification Attempt.

Returns:

  • (String)

    A string that uniquely identifies this Verification Attempt


253
254
255
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 253

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


314
315
316
317
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 314

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

#urlString

Returns The url.

Returns:

  • (String)

    The url


301
302
303
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempt.rb', line 301

def url
  @properties['url']
end