Class: Twilio::REST::Verify::V2::ServiceInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/verify/v2/service.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ServiceInstance

Initialize the ServiceInstance



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 506

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'friendly_name' => payload['friendly_name'],
        'code_length' => payload['code_length'] == nil ? payload['code_length'] : payload['code_length'].to_i,
        'lookup_enabled' => payload['lookup_enabled'],
        'psd2_enabled' => payload['psd2_enabled'],
        'skip_sms_to_landlines' => payload['skip_sms_to_landlines'],
        'dtmf_input_required' => payload['dtmf_input_required'],
        'tts_name' => payload['tts_name'],
        'do_not_share_warning_enabled' => payload['do_not_share_warning_enabled'],
        'custom_code_enabled' => payload['custom_code_enabled'],
        'push' => payload['push'],
        'totp' => payload['totp'],
        'default_template_sid' => payload['default_template_sid'],
        'whatsapp' => payload['whatsapp'],
        'verify_event_subscription_enabled' => payload['verify_event_subscription_enabled'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
    }

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

Instance Method Details

#access_tokensaccess_tokens

Access the access_tokens



772
773
774
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 772

def access_tokens
    context.access_tokens
end

#account_sidString



557
558
559
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 557

def 
    @properties['account_sid']
end

#code_lengthString



569
570
571
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 569

def code_length
    @properties['code_length']
end

#contextServiceContext

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



542
543
544
545
546
547
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 542

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

#custom_code_enabledBoolean



611
612
613
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 611

def custom_code_enabled
    @properties['custom_code_enabled']
end

#date_createdTime



647
648
649
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 647

def date_created
    @properties['date_created']
end

#date_updatedTime



653
654
655
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 653

def date_updated
    @properties['date_updated']
end

#default_template_sidString



629
630
631
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 629

def default_template_sid
    @properties['default_template_sid']
end

#deleteBoolean

Delete the ServiceInstance



672
673
674
675
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 672

def delete

    context.delete
end

#do_not_share_warning_enabledBoolean



605
606
607
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 605

def do_not_share_warning_enabled
    @properties['do_not_share_warning_enabled']
end

#dtmf_input_requiredBoolean



593
594
595
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 593

def dtmf_input_required
    @properties['dtmf_input_required']
end

#entitiesentities

Access the entities



793
794
795
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 793

def entities
    context.entities
end

#fetchServiceInstance

Fetch the ServiceInstance



680
681
682
683
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 680

def fetch

    context.fetch
end

#friendly_nameString



563
564
565
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 563

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



813
814
815
816
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 813

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


665
666
667
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 665

def links
    @properties['links']
end

#lookup_enabledBoolean



575
576
577
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 575

def lookup_enabled
    @properties['lookup_enabled']
end

#messaging_configurationsmessaging_configurations

Access the messaging_configurations



786
787
788
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 786

def messaging_configurations
    context.messaging_configurations
end

#psd2_enabledBoolean



581
582
583
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 581

def psd2_enabled
    @properties['psd2_enabled']
end

#pushHash



617
618
619
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 617

def push
    @properties['push']
end

#rate_limitsrate_limits

Access the rate_limits



800
801
802
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 800

def rate_limits
    context.rate_limits
end

#sidString



551
552
553
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 551

def sid
    @properties['sid']
end

#skip_sms_to_landlinesBoolean



587
588
589
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 587

def skip_sms_to_landlines
    @properties['skip_sms_to_landlines']
end

#to_sObject

Provide a user friendly representation



806
807
808
809
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 806

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

#totpHash



623
624
625
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 623

def totp
    @properties['totp']
end

#tts_nameString



599
600
601
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 599

def tts_name
    @properties['tts_name']
end

#update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset, default_template_sid: :unset, whatsapp_msg_service_sid: :unset, whatsapp_from: :unset, verify_event_subscription_enabled: :unset) ⇒ ServiceInstance

Update the ServiceInstance



708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 708

def update(
    friendly_name: :unset, 
    code_length: :unset, 
    lookup_enabled: :unset, 
    skip_sms_to_landlines: :unset, 
    dtmf_input_required: :unset, 
    tts_name: :unset, 
    psd2_enabled: :unset, 
    do_not_share_warning_enabled: :unset, 
    custom_code_enabled: :unset, 
    push_include_date: :unset, 
    push_apn_credential_sid: :unset, 
    push_fcm_credential_sid: :unset, 
    totp_issuer: :unset, 
    totp_time_step: :unset, 
    totp_code_length: :unset, 
    totp_skew: :unset, 
    default_template_sid: :unset, 
    whatsapp_msg_service_sid: :unset, 
    whatsapp_from: :unset, 
    verify_event_subscription_enabled: :unset
)

    context.update(
        friendly_name: friendly_name, 
        code_length: code_length, 
        lookup_enabled: lookup_enabled, 
        skip_sms_to_landlines: skip_sms_to_landlines, 
        dtmf_input_required: dtmf_input_required, 
        tts_name: tts_name, 
        psd2_enabled: psd2_enabled, 
        do_not_share_warning_enabled: do_not_share_warning_enabled, 
        custom_code_enabled: custom_code_enabled, 
        push_include_date: push_include_date, 
        push_apn_credential_sid: push_apn_credential_sid, 
        push_fcm_credential_sid: push_fcm_credential_sid, 
        totp_issuer: totp_issuer, 
        totp_time_step: totp_time_step, 
        totp_code_length: totp_code_length, 
        totp_skew: totp_skew, 
        default_template_sid: default_template_sid, 
        whatsapp_msg_service_sid: whatsapp_msg_service_sid, 
        whatsapp_from: whatsapp_from, 
        verify_event_subscription_enabled: verify_event_subscription_enabled, 
    )
end

#urlString



659
660
661
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 659

def url
    @properties['url']
end

#verification_checksverification_checks

Access the verification_checks



758
759
760
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 758

def verification_checks
    context.verification_checks
end

#verificationsverifications

Access the verifications



765
766
767
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 765

def verifications
    context.verifications
end

#verify_event_subscription_enabledBoolean



641
642
643
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 641

def verify_event_subscription_enabled
    @properties['verify_event_subscription_enabled']
end

#webhookswebhooks

Access the webhooks



779
780
781
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 779

def webhooks
    context.webhooks
end

#whatsappHash



635
636
637
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 635

def whatsapp
    @properties['whatsapp']
end