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



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 129

def initialize(version, payload)
  super(version)

  # Marshaled Properties
  @properties = {
      'total_attempts' => payload['total_attempts'].to_i,
      'total_converted' => payload['total_converted'].to_i,
      'total_unconverted' => payload['total_unconverted'].to_i,
      'conversion_rate_percentage' => payload['conversion_rate_percentage'].to_f,
      'url' => payload['url'],
  }

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

Instance Method Details

#contextVerificationAttemptsSummaryContext

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

Returns:



150
151
152
153
154
155
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 150

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

#conversion_rate_percentageString

Returns Percentage of the confirmed messages over the total.

Returns:

  • (String)

    Percentage of the confirmed messages over the total.



177
178
179
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 177

def conversion_rate_percentage
  @properties['conversion_rate_percentage']
end

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

Fetch the VerificationAttemptsSummaryInstance

Parameters:

  • 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 RFC 2822 format.

  • 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 RFC 2822 format.

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

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

  • channel (verification_attempts_summary.Channels) (defaults to: :unset)

    Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are ‘SMS` and `CALL`

  • 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:



206
207
208
209
210
211
212
213
214
215
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 206

def fetch(service_sid: :unset, date_created_after: :unset, date_created_before: :unset, country: :unset, channel: :unset, destination_prefix: :unset)
  context.fetch(
      service_sid: service_sid,
      date_created_after: date_created_after,
      date_created_before: date_created_before,
      country: country,
      channel: channel,
      destination_prefix: destination_prefix,
  )
end

#inspectObject

Provide a detailed, user friendly representation



226
227
228
229
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 226

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

#to_sObject

Provide a user friendly representation



219
220
221
222
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 219

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

#total_attemptsString

Returns Total of attempts made.

Returns:

  • (String)

    Total of attempts made.



159
160
161
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 159

def total_attempts
  @properties['total_attempts']
end

#total_convertedString

Returns Total of attempts confirmed by the end user.

Returns:

  • (String)

    Total of attempts confirmed by the end user.



165
166
167
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 165

def total_converted
  @properties['total_converted']
end

#total_unconvertedString

Returns Total of attempts made that were not confirmed by the end user.

Returns:

  • (String)

    Total of attempts made that were not confirmed by the end user.



171
172
173
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 171

def total_unconverted
  @properties['total_unconverted']
end

#urlString

Returns The url.

Returns:

  • (String)

    The url



183
184
185
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 183

def url
  @properties['url']
end