Class: Reach::REST::Api::Authentix::ConfigurationItemInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, configuration_id: nil) ⇒ ConfigurationItemInstance

Initialize the ConfigurationItemInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 367

def initialize(version, payload , configuration_id: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'appletId' => payload['appletId'],
        'apiVersion' => payload['apiVersion'],
        'configurationId' => payload['configurationId'],
        'serviceName' => payload['serviceName'],
        'codeLength' => payload['codeLength'] == nil ? payload['codeLength'] : payload['codeLength'].to_i,
        'allowCustomCode' => payload['allowCustomCode'],
        'usedForDigitalPayment' => payload['usedForDigitalPayment'],
        'defaultExpiryTime' => payload['defaultExpiryTime'] == nil ? payload['defaultExpiryTime'] : payload['defaultExpiryTime'].to_i,
        'defaultMaxTrials' => payload['defaultMaxTrials'] == nil ? payload['defaultMaxTrials'] : payload['defaultMaxTrials'].to_i,
        'defaultMaxControls' => payload['defaultMaxControls'] == nil ? payload['defaultMaxControls'] : payload['defaultMaxControls'].to_i,
        'smtpSettingId' => payload['smtpSettingId'],
        'emailTemplateId' => payload['emailTemplateId'],
        'smsTemplateId' => payload['smsTemplateId'],
        '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']  , }
end

Instance Method Details

#allowCustomCodeBoolean

Returns A flag indicating if the configuration allows sending custom and non-generated code.

Returns:

  • (Boolean)

    A flag indicating if the configuration allows sending custom and non-generated code.



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

def allowCustomCode
    @properties['allowCustomCode']
end

#apiVersionString

Returns The API version used to create the configuration.

Returns:

  • (String)

    The API version used to create the configuration.



413
414
415
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 413

def apiVersion
    @properties['apiVersion']
end

#appletIdString

Returns The identifier of the applet creating the configuration.

Returns:

  • (String)

    The identifier of the applet creating the configuration.



407
408
409
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 407

def appletId
    @properties['appletId']
end

#authentication_control_itemsauthentication_control_items

Access the authentication_control_items

Returns:



554
555
556
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 554

def authentication_control_items
    context.authentication_control_items
end

#authentication_itemsauthentication_items

Access the authentication_items

Returns:



561
562
563
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 561

def authentication_items
    context.authentication_items
end

#codeLengthString

Returns The length of the code to be generated.

Returns:

  • (String)

    The length of the code to be generated.



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

def codeLength
    @properties['codeLength']
end

#configurationIdString

Returns The identifier of the configuration.

Returns:

  • (String)

    The identifier of the configuration.



419
420
421
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 419

def configurationId
    @properties['configurationId']
end

#contextConfigurationItemContext

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

Returns:



398
399
400
401
402
403
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 398

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

#dateCreatedTime

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

Returns:

  • (Time)

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



485
486
487
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 485

def dateCreated
    @properties['dateCreated']
end

#dateUpdatedTime

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

Returns:

  • (Time)

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



491
492
493
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 491

def dateUpdated
    @properties['dateUpdated']
end

#defaultExpiryTimeString

Returns the default expiry time of the authentication code.

Returns:

  • (String)

    the default expiry time of the authentication code.



449
450
451
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 449

def defaultExpiryTime
    @properties['defaultExpiryTime']
end

#defaultMaxControlsString

Returns the default maximum number of code controls per authentication.

Returns:

  • (String)

    the default maximum number of code controls per authentication.



461
462
463
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 461

def defaultMaxControls
    @properties['defaultMaxControls']
end

#defaultMaxTrialsString

Returns the default maximum number of trials per authentication.

Returns:

  • (String)

    the default maximum number of trials per authentication.



455
456
457
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 455

def defaultMaxTrials
    @properties['defaultMaxTrials']
end

#deleteBoolean

Delete the ConfigurationItemInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



498
499
500
501
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 498

def delete

    context.delete
end

#emailTemplateIdString

Returns The default email template ID used by this configuration.

Returns:

  • (String)

    The default email template ID used by this configuration.



473
474
475
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 473

def emailTemplateId
    @properties['emailTemplateId']
end

#fetchConfigurationItemInstance

Fetch the ConfigurationItemInstance

Returns:



506
507
508
509
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 506

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



574
575
576
577
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 574

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

#serviceNameString

Returns The name of the authentication service.

Returns:

  • (String)

    The name of the authentication service.



425
426
427
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 425

def serviceName
    @properties['serviceName']
end

#smsTemplateIdString

Returns The default sms template ID used by this configuration.

Returns:

  • (String)

    The default sms template ID used by this configuration.



479
480
481
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 479

def smsTemplateId
    @properties['smsTemplateId']
end

#smtpSettingIdString

Returns The ID of the SMTP settings used by the configuration.

Returns:

  • (String)

    The ID of the SMTP settings used by the configuration.



467
468
469
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 467

def smtpSettingId
    @properties['smtpSettingId']
end

#to_sObject

Provide a user friendly representation



567
568
569
570
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 567

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

#update(service_name: :unset, code_length: :unset, allow_custom_code: :unset, used_for_digital_payment: :unset, default_expiry_time: :unset, default_max_trials: :unset, default_max_controls: :unset, smtp_setting_id: :unset, email_template_id: :unset, sms_template_id: :unset) ⇒ ConfigurationItemInstance

Update the ConfigurationItemInstance

Parameters:

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

    The name of the authentication service attached to this configuration. It can be up to 40 characters long.

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

    The length of the code to be generated. It must be a value between 4 and 10, inclusive.

  • allow_custom_code (Boolean) (defaults to: :unset)

    A flag indicating if the configuration should allow sending custom and non-generated code.

  • used_for_digital_payment (Boolean) (defaults to: :unset)

    A flag indicating if the configuration is used to authenticate digital payments. In such a case, additional information such as the amount and the payee of the financial transaction should be sent to when starting the authentication.

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

    It represents how long, in minutes, an authentication process will remained in the ‘awaiting` status before moving to `expired` in the case no valid matching is performed in between. It must be any value between 1 and 1440 which represents 24 hours.

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

    It represents the maximum number of trials per authentication.

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

    It represents the maximum number of code controls per authentication. It must be between 1 and 6 inclusive.

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

    This is the ID of the SMTP settings used by this configuration. It is mandatory for sending authentication codes via email.

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

    This is the ID of the default email template to use for sending authenetication codes via email.

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

    This is the ID of the default sms template to use for sending authenetication codes via sms.

Returns:



524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 524

def update(
    service_name: :unset, 
    code_length: :unset, 
    allow_custom_code: :unset, 
    used_for_digital_payment: :unset, 
    default_expiry_time: :unset, 
    default_max_trials: :unset, 
    default_max_controls: :unset, 
    smtp_setting_id: :unset, 
    email_template_id: :unset, 
    sms_template_id: :unset
)

    context.update(
        service_name: service_name, 
        code_length: code_length, 
        allow_custom_code: allow_custom_code, 
        used_for_digital_payment: used_for_digital_payment, 
        default_expiry_time: default_expiry_time, 
        default_max_trials: default_max_trials, 
        default_max_controls: default_max_controls, 
        smtp_setting_id: smtp_setting_id, 
        email_template_id: email_template_id, 
        sms_template_id: sms_template_id, 
    )
end

#usedForDigitalPaymentBoolean

Returns A flag indicating if the configuration is used to authenticate digital payments.

Returns:

  • (Boolean)

    A flag indicating if the configuration is used to authenticate digital payments.



443
444
445
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 443

def usedForDigitalPayment
    @properties['usedForDigitalPayment']
end