Class: Reach::REST::Api::Authentix::AuthenticationTrialStatItemInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ AuthenticationTrialStatItemInstance

Initialize the AuthenticationTrialStatItemInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Reach(TalkyLabs)

  • account_sid (String)

    The SID of the Account that created this AuthenticationTrialStatItem resource.

  • sid (String)

    The SID of the Call resource to fetch.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 159

def initialize(version, payload )
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'appletId' => payload['appletId'],
        'apiVersion' => payload['apiVersion'],
        'totalTrials' => payload['totalTrials'] == nil ? payload['totalTrials'] : payload['totalTrials'].to_i,
        'numSuccessfulTrials' => payload['numSuccessfulTrials'] == nil ? payload['numSuccessfulTrials'] : payload['numSuccessfulTrials'].to_i,
        'numUnsuccessfulTrials' => payload['numUnsuccessfulTrials'] == nil ? payload['numUnsuccessfulTrials'] : payload['numUnsuccessfulTrials'].to_i,
        'successRate' => payload['successRate'],
    }

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

Instance Method Details

#apiVersionString

Returns The API version.

Returns:

  • (String)

    The API version.



196
197
198
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 196

def apiVersion
    @properties['apiVersion']
end

#appletIdString

Returns The identifier of the applet.

Returns:

  • (String)

    The identifier of the applet.



190
191
192
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 190

def appletId
    @properties['appletId']
end

#contextAuthenticationTrialStatItemContext

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

Returns:



181
182
183
184
185
186
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 181

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

#fetch(dest: :unset, trial_status: :unset, channel: :unset, configuration_id: :unset, authentication_id: :unset, country: :unset, sent_at: :unset, sent_after: :unset, sent_before: :unset) ⇒ AuthenticationTrialStatItemInstance

Fetch the AuthenticationTrialStatItemInstance

Parameters:

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

    Filter authentication trials sent only to this phone number or email. The phone number must be in the E.164 format.

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

    Filter authentication trials with the specified status.

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

    Filter authentication trials sent via the specified channel.

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

    Filter authentication trials from the configuration whose ID matches the specified one.

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

    Filter authentication trials from the authentication whose ID matches the specified one.

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

    Filter authentication trials sent to the specified destination country (in ISO 3166-1 alpha-2). Only possible when ‘dest` is a phone number.

  • sent_at (Time) (defaults to: :unset)

    Filter authentication trials created at the specified date. Must be in ISO 8601 format.

  • sent_after (Time) (defaults to: :unset)

    Filter authentication trials created after the specified datetime. Must be in ISO 8601 format.

  • sent_before (Time) (defaults to: :unset)

    Filter authentication trials created before the specified datetime. Must be in ISO 8601 format.

Returns:



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 236

def fetch(
    dest: :unset, 
    trial_status: :unset, 
    channel: :unset, 
    configuration_id: :unset, 
    authentication_id: :unset, 
    country: :unset, 
    sent_at: :unset, 
    sent_after: :unset, 
    sent_before: :unset
)

    context.fetch(
        dest: dest, 
        trial_status: trial_status, 
        channel: channel, 
        configuration_id: configuration_id, 
        authentication_id: authentication_id, 
        country: country, 
        sent_at: sent_at, 
        sent_after: sent_after, 
        sent_before: sent_before, 
    )
end

#inspectObject

Provide a detailed, user friendly representation



270
271
272
273
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 270

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Reach.Api.Authentix.AuthenticationTrialStatItemInstance #{values}>"
end

#numSuccessfulTrialsString

Returns The total number of successfull trials among the ones matching the specified criteria.

Returns:

  • (String)

    The total number of successfull trials among the ones matching the specified criteria.



208
209
210
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 208

def numSuccessfulTrials
    @properties['numSuccessfulTrials']
end

#numUnsuccessfulTrialsString

Returns The total number of unsuccessfull trials among the ones matching the specified criteria.

Returns:

  • (String)

    The total number of unsuccessfull trials among the ones matching the specified criteria.



214
215
216
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 214

def numUnsuccessfulTrials
    @properties['numUnsuccessfulTrials']
end

#successRateFloat

Returns The success rate of the trials matching the specified criteria.

Returns:

  • (Float)

    The success rate of the trials matching the specified criteria.



220
221
222
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 220

def successRate
    @properties['successRate']
end

#to_sObject

Provide a user friendly representation



263
264
265
266
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 263

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Reach.Api.Authentix.AuthenticationTrialStatItemInstance #{values}>"
end

#totalTrialsString

Returns The total number of trials matching the specified criteria.

Returns:

  • (String)

    The total number of trials matching the specified criteria.



202
203
204
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 202

def totalTrials
    @properties['totalTrials']
end