Class: Twilio::REST::Verify::V2::VerificationAttemptsSummaryInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ VerificationAttemptsSummaryInstance

Initialize the VerificationAttemptsSummaryInstance

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 VerificationAttemptsSummary resource.

  • sid (String) —

    The SID of the Call resource to fetch.



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 246

def initialize(version, payload )
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'total_attempts' => payload['total_attempts'] == nil ? payload['total_attempts'] : payload['total_attempts'].to_i,
        'total_converted' => payload['total_converted'] == nil ? payload['total_converted'] : payload['total_converted'].to_i,
        'total_unconverted' => payload['total_unconverted'] == nil ? payload['total_unconverted'] : payload['total_unconverted'].to_i,
        'conversion_rate_percentage' => payload['conversion_rate_percentage'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = {  }
end

Instance Method Details

#context ⇒ VerificationAttemptsSummaryContext

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

Returns:



268
269
270
271
272
273
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 268

def context
    unless @instance_context
        @instance_context = VerificationAttemptsSummaryContext.new(@version )
    end
    @instance_context
end

#conversion_rate_percentage ⇒ String

Returns Percentage of the confirmed messages over the total, defined by (total_converted/total_attempts)*100.

Returns:

  • (String) —

    Percentage of the confirmed messages over the total, defined by (total_converted/total_attempts)*100.



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

def conversion_rate_percentage
    @properties['conversion_rate_percentage']
end

#fetch(verify_service_sid: :unset, date_created_after: :unset, date_created_before: :unset, country: :unset, channel: :unset, destination_prefix: :unset) ⇒ VerificationAttemptsSummaryInstance

Fetch the VerificationAttemptsSummaryInstance

Parameters:

  • verify_service_sid (String) (defaults to: :unset) —

    Filter used to consider only Verification Attempts of the given verify service on the summary aggregation.

  • date_created_after (Time) (defaults to: :unset) —

    Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.

  • date_created_before (Time) (defaults to: :unset) —

    Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z.

  • country (String) (defaults to: :unset) —

    Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation.

  • channel (Channels) (defaults to: :unset) —

    Filter Verification Attempts considered on the summary aggregation by communication channel.

  • destination_prefix (String) (defaults to: :unset) —

    Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format.

Returns:



314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 314

def fetch(
  verify_service_sid: :unset, 
  date_created_after: :unset, 
  date_created_before: :unset, 
  country: :unset, 
  channel: :unset, 
  destination_prefix: :unset
)

    context.fetch(
        verify_service_sid: verify_service_sid, 
        date_created_after: date_created_after, 
        date_created_before: date_created_before, 
        country: country, 
        channel: channel, 
        destination_prefix: destination_prefix, 
    )
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



342
343
344
345
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 342

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

#to_s ⇒ Object

Provide a user friendly representation



335
336
337
338
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 335

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

#total_attempts ⇒ String

Returns Total of attempts made according to the provided filters.

Returns:

  • (String) —

    Total of attempts made according to the provided filters



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

def total_attempts
    @properties['total_attempts']
end

#total_converted ⇒ String

Returns Total of attempts made that were confirmed by the end user, according to the provided filters.

Returns:

  • (String) —

    Total of attempts made that were confirmed by the end user, according to the provided filters.



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

def total_converted
    @properties['total_converted']
end

#total_unconverted ⇒ String

Returns Total of attempts made that were not confirmed by the end user, according to the provided filters.

Returns:

  • (String) —

    Total of attempts made that were not confirmed by the end user, according to the provided filters.



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

def total_unconverted
    @properties['total_unconverted']
end

#url ⇒ String

Returns:

  • (String)


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

def url
    @properties['url']
end