Class: Reach::REST::Api::Authentix::AuthenticationTrialItemInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, trial_id: nil) ⇒ AuthenticationTrialItemInstance

Initialize the AuthenticationTrialItemInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 278

def initialize(version, payload , trial_id: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'appletId' => payload['appletId'],
        'apiVersion' => payload['apiVersion'],
        'configurationId' => payload['configurationId'],
        'authenticationId' => payload['authenticationId'],
        'trialId' => payload['trialId'],
        'trialStatus' => payload['trialStatus'],
        'channel' => payload['channel'],
        'paymentInfo' => payload['paymentInfo'],
        'dateCreated' => Reach.deserialize_iso8601_datetime(payload['dateCreated']),
        'dateUpdated' => Reach.deserialize_iso8601_datetime(payload['dateUpdated']),
        'price' => payload['price'],
        'priceUnit' => payload['priceUnit'],
        'channelInfo' => payload['channelInfo'],
    }

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

Instance Method Details

#apiVersionString

Returns The API version.

Returns:

  • (String)

    The API version.



322
323
324
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 322

def apiVersion
    @properties['apiVersion']
end

#appletIdString

Returns The identifier of the applet.

Returns:

  • (String)

    The identifier of the applet.



316
317
318
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 316

def appletId
    @properties['appletId']
end

#authenticationIdString

Returns The identifier of the authentication.

Returns:

  • (String)

    The identifier of the authentication.



334
335
336
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 334

def authenticationId
    @properties['authenticationId']
end

#channelString

Returns The channel used.

Returns:

  • (String)

    The channel used.



352
353
354
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 352

def channel
    @properties['channel']
end

#channelInfoHash<String, Object>

Returns channel specific information related to a trial.

Returns:

  • (Hash<String, Object>)

    channel specific information related to a trial.



388
389
390
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 388

def channelInfo
    @properties['channelInfo']
end

#configurationIdString

Returns The identifier of the configuration.

Returns:

  • (String)

    The identifier of the configuration.



328
329
330
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 328

def configurationId
    @properties['configurationId']
end

#contextAuthenticationTrialItemContext

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

Returns:



307
308
309
310
311
312
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 307

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

#dateCreatedTime

Returns The date and time in GMT that the authentication trial was created.

Returns:

  • (Time)

    The date and time in GMT that the authentication trial was created.



364
365
366
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 364

def dateCreated
    @properties['dateCreated']
end

#dateUpdatedTime

Returns The date and time in GMT that the authentication trial was last updated.

Returns:

  • (Time)

    The date and time in GMT that the authentication trial was last updated.



370
371
372
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 370

def dateUpdated
    @properties['dateUpdated']
end

#fetchAuthenticationTrialItemInstance

Fetch the AuthenticationTrialItemInstance

Returns:



395
396
397
398
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 395

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



409
410
411
412
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 409

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

#paymentInfoPaymentInfo

Returns:

  • (PaymentInfo)


358
359
360
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 358

def paymentInfo
    @properties['paymentInfo']
end

#priceFloat

Returns The cost billed for the authentication trial, in the currency specified by ‘priceUnit`. This cost does not include the cost for checking the correctness of the code.

Returns:

  • (Float)

    The cost billed for the authentication trial, in the currency specified by ‘priceUnit`. This cost does not include the cost for checking the correctness of the code.



376
377
378
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 376

def price
    @properties['price']
end

#priceUnitString

Returns The currency, in ISO 4127 format, in which price is measured. for example, usd, xaf, eur, cad.

Returns:

  • (String)

    The currency, in ISO 4127 format, in which price is measured. for example, usd, xaf, eur, cad.



382
383
384
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 382

def priceUnit
    @properties['priceUnit']
end

#to_sObject

Provide a user friendly representation



402
403
404
405
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 402

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

#trialIdString

Returns The identifier of the authentication trial.

Returns:

  • (String)

    The identifier of the authentication trial.



340
341
342
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 340

def trialId
    @properties['trialId']
end

#trialStatusString

Returns The status of the authentication.

Returns:

  • (String)

    The status of the authentication.



346
347
348
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb', line 346

def trialStatus
    @properties['trialStatus']
end