Class: Reach::REST::Api::Authentix::ConfigurationItemContext::AuthenticationItemInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, configuration_id: nil, authentication_id: nil) ⇒ AuthenticationItemInstance

Initialize the AuthenticationItemInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 286

def initialize(version, payload , configuration_id: nil, authentication_id: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'appletId' => payload['appletId'],
        'apiVersion' => payload['apiVersion'],
        'configurationId' => payload['configurationId'],
        'authenticationId' => payload['authenticationId'],
        'status' => payload['status'],
        'dest' => payload['dest'],
        'channel' => payload['channel'],
        'expiryTime' => payload['expiryTime'] == nil ? payload['expiryTime'] : payload['expiryTime'].to_i,
        'maxTrials' => payload['maxTrials'] == nil ? payload['maxTrials'] : payload['maxTrials'].to_i,
        'maxControls' => payload['maxControls'] == nil ? payload['maxControls'] : payload['maxControls'].to_i,
        'paymentInfo' => payload['paymentInfo'],
        'trials' => payload['trials'],
        'dateCreated' => Reach.deserialize_iso8601_datetime(payload['dateCreated']),
        'dateUpdated' => Reach.deserialize_iso8601_datetime(payload['dateUpdated']),
    }

    # Context
    @instance_context = nil
    @params = { 'configuration_id' => configuration_id  || @properties['configurationId']  ,'authentication_id' => authentication_id  || @properties['authenticationId']  , }
end

Instance Method Details

#apiVersionString

Returns The API version.

Returns:

  • (String)

    The API version.



331
332
333
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 331

def apiVersion
    @properties['apiVersion']
end

#appletIdString

Returns The identifier of the applet.

Returns:

  • (String)

    The identifier of the applet.



325
326
327
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 325

def appletId
    @properties['appletId']
end

#authenticationIdString

Returns The identifier of the authentication.

Returns:

  • (String)

    The identifier of the authentication.



343
344
345
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 343

def authenticationId
    @properties['authenticationId']
end

#channelString

Returns The channel used.

Returns:

  • (String)

    The channel used.



361
362
363
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 361

def channel
    @properties['channel']
end

#configurationIdString

Returns The identifier of the configuration.

Returns:

  • (String)

    The identifier of the configuration.



337
338
339
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 337

def configurationId
    @properties['configurationId']
end

#contextAuthenticationItemContext

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

Returns:



316
317
318
319
320
321
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 316

def context
    unless @instance_context
        @instance_context = AuthenticationItemContext.new(@version , @params['configuration_id'], @params['authentication_id'])
    end
    @instance_context
end

#dateCreatedTime

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

Returns:

  • (Time)

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



397
398
399
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 397

def dateCreated
    @properties['dateCreated']
end

#dateUpdatedTime

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

Returns:

  • (Time)

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



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

def dateUpdated
    @properties['dateUpdated']
end

#destString

Returns The destination of the authentication code. Phone numbers must be in E.164 format.

Returns:

  • (String)

    The destination of the authentication code. Phone numbers must be in E.164 format.



355
356
357
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 355

def dest
    @properties['dest']
end

#expiryTimeString

Returns An expiry time in minutes.

Returns:

  • (String)

    An expiry time in minutes.



367
368
369
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 367

def expiryTime
    @properties['expiryTime']
end

#fetchAuthenticationItemInstance

Fetch the AuthenticationItemInstance

Returns:



410
411
412
413
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 410

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



437
438
439
440
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 437

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

#maxControlsString

Returns The maximum number of code controls.

Returns:

  • (String)

    The maximum number of code controls.



379
380
381
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 379

def maxControls
    @properties['maxControls']
end

#maxTrialsString

Returns The maximum number of trials.

Returns:

  • (String)

    The maximum number of trials.



373
374
375
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 373

def maxTrials
    @properties['maxTrials']
end

#paymentInfoPaymentInfo

Returns:

  • (PaymentInfo)


385
386
387
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 385

def paymentInfo
    @properties['paymentInfo']
end

#statusString

Returns The status of the authentication.

Returns:

  • (String)

    The status of the authentication.



349
350
351
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 349

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



430
431
432
433
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 430

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

#trialsArray<TrialQuickInfo>

Returns An array of authentication trials containing channel-specific information about each trial.

Returns:

  • (Array<TrialQuickInfo>)

    An array of authentication trials containing channel-specific information about each trial.



391
392
393
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 391

def trials
    @properties['trials']
end

#update(status: nil) ⇒ AuthenticationItemInstance

Update the AuthenticationItemInstance

Parameters:

  • status (String) (defaults to: nil)

    The new status of the authentication.

Returns:



419
420
421
422
423
424
425
426
# File 'lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb', line 419

def update(
    status: nil
)

    context.update(
        status: status, 
    )
end