Class: Twilio::REST::Verify::V2::ServiceContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Verify::V2::ServiceContext
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service.rb,
lib/twilio-ruby/rest/verify/v2/service/entity.rb,
lib/twilio-ruby/rest/verify/v2/service/webhook.rb,
lib/twilio-ruby/rest/verify/v2/service/new_factor.rb,
lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb,
lib/twilio-ruby/rest/verify/v2/service/access_token.rb,
lib/twilio-ruby/rest/verify/v2/service/verification.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb,
lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb,
lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb,
lib/twilio-ruby/rest/verify/v2/service/new_verify_factor.rb,
lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb,
lib/twilio-ruby/rest/verify/v2/service/verification_check.rb,
lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb
Defined Under Namespace
Classes: AccessTokenContext, AccessTokenInstance, AccessTokenInstanceMetadata, AccessTokenList, AccessTokenListResponse, AccessTokenPage, AccessTokenPageMetadata, ApproveChallengeInstance, ApproveChallengeList, ApproveChallengeListResponse, ApproveChallengePage, ApproveChallengePageMetadata, EntityContext, EntityInstance, EntityInstanceMetadata, EntityList, EntityListResponse, EntityPage, EntityPageMetadata, MessagingConfigurationContext, MessagingConfigurationInstance, MessagingConfigurationInstanceMetadata, MessagingConfigurationList, MessagingConfigurationListResponse, MessagingConfigurationPage, MessagingConfigurationPageMetadata, NewChallengeContext, NewChallengeInstance, NewChallengeInstanceMetadata, NewChallengeList, NewChallengeListResponse, NewChallengePage, NewChallengePageMetadata, NewFactorInstance, NewFactorList, NewFactorListResponse, NewFactorPage, NewFactorPageMetadata, NewVerifyFactorInstance, NewVerifyFactorList, NewVerifyFactorListResponse, NewVerifyFactorPage, NewVerifyFactorPageMetadata, RateLimitContext, RateLimitInstance, RateLimitInstanceMetadata, RateLimitList, RateLimitListResponse, RateLimitPage, RateLimitPageMetadata, VerificationCheckInstance, VerificationCheckList, VerificationCheckListResponse, VerificationCheckPage, VerificationCheckPageMetadata, VerificationContext, VerificationInstance, VerificationInstanceMetadata, VerificationList, VerificationListResponse, VerificationPage, VerificationPageMetadata, WebhookContext, WebhookInstance, WebhookInstanceMetadata, WebhookList, WebhookListResponse, WebhookPage, WebhookPageMetadata
Instance Method Summary collapse
-
#access_tokens(sid = :unset) ⇒ AccessTokenList, AccessTokenContext
Access the access_tokens.
-
#approve_challenge ⇒ ApproveChallengeList, ApproveChallengeContext
Access the approve_challenge.
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the ServiceInstanceMetadata.
-
#entities(identity = :unset) ⇒ EntityList, EntityContext
Access the entities.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
-
#fetch_with_metadata ⇒ ServiceInstance
Fetch the ServiceInstanceMetadata.
-
#initialize(version, sid) ⇒ ServiceContext
constructor
Initialize the ServiceContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#messaging_configurations(country = :unset) ⇒ MessagingConfigurationList, MessagingConfigurationContext
Access the messaging_configurations.
-
#new_challenge ⇒ NewChallengeList, NewChallengeContext
Access the new_challenge.
-
#new_factors ⇒ NewFactorList, NewFactorContext
Access the new_factors.
-
#new_verify_factors ⇒ NewVerifyFactorList, NewVerifyFactorContext
Access the new_verify_factors.
-
#rate_limits(sid = :unset) ⇒ RateLimitList, RateLimitContext
Access the rate_limits.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#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, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#update_with_metadata(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, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstanceMetadata.
-
#verification_checks ⇒ VerificationCheckList, VerificationCheckContext
Access the verification_checks.
-
#verifications(sid = :unset) ⇒ VerificationList, VerificationContext
Access the verifications.
-
#webhooks(sid = :unset) ⇒ WebhookList, WebhookContext
Access the webhooks.
Constructor Details
#initialize(version, sid) ⇒ ServiceContext
Initialize the ServiceContext
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 373 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Services/#{@solution[:sid]}" # Dependents @verification_checks = nil @new_verify_factors = nil @new_factors = nil @approve_challenge = nil @verifications = nil @access_tokens = nil @webhooks = nil @messaging_configurations = nil @new_challenge = nil @entities = nil @rate_limits = nil end |
Instance Method Details
#access_tokens(sid = :unset) ⇒ AccessTokenList, AccessTokenContext
Access the access_tokens
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 745 def access_tokens(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return AccessTokenContext.new(@version, @solution[:sid],sid ) end unless @access_tokens @access_tokens = AccessTokenList.new( @version, service_sid: @solution[:sid], ) end @access_tokens end |
#approve_challenge ⇒ ApproveChallengeList, ApproveChallengeContext
Access the approve_challenge
715 716 717 718 719 720 721 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 715 def approve_challenge unless @approve_challenge @approve_challenge = ApproveChallengeList.new( @version, ) end @approve_challenge end |
#delete ⇒ Boolean
Delete the ServiceInstance
397 398 399 400 401 402 403 404 405 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 397 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the ServiceInstanceMetadata
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 410 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) service_instance = ServiceInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) ServiceInstanceMetadata.new(@version, service_instance, response.headers, response.status_code) end |
#entities(identity = :unset) ⇒ EntityList, EntityContext
Access the entities
812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 812 def entities(identity=:unset) raise ArgumentError, 'identity cannot be nil' if identity.nil? if identity != :unset return EntityContext.new(@version, @solution[:sid],identity ) end unless @entities @entities = EntityList.new( @version, service_sid: @solution[:sid], ) end @entities end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 429 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ ServiceInstance
Fetch the ServiceInstanceMetadata
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 448 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) service_instance = ServiceInstance.new( @version, response.body, sid: @solution[:sid], ) ServiceInstanceMetadata.new( @version, service_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
856 857 858 859 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 856 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.ServiceContext #{context}>" end |
#messaging_configurations(country = :unset) ⇒ MessagingConfigurationList, MessagingConfigurationContext
Access the messaging_configurations
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 783 def messaging_configurations(country=:unset) raise ArgumentError, 'country cannot be nil' if country.nil? if country != :unset return MessagingConfigurationContext.new(@version, @solution[:sid],country ) end unless @messaging_configurations @messaging_configurations = MessagingConfigurationList.new( @version, service_sid: @solution[:sid], ) end @messaging_configurations end |
#new_challenge ⇒ NewChallengeList, NewChallengeContext
Access the new_challenge
802 803 804 805 806 807 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 802 def new_challenge NewChallengeContext.new( @version, @solution[:sid] ) end |
#new_factors ⇒ NewFactorList, NewFactorContext
Access the new_factors
704 705 706 707 708 709 710 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 704 def new_factors unless @new_factors @new_factors = NewFactorList.new( @version, ) end @new_factors end |
#new_verify_factors ⇒ NewVerifyFactorList, NewVerifyFactorContext
Access the new_verify_factors
693 694 695 696 697 698 699 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 693 def new_verify_factors unless @new_verify_factors @new_verify_factors = NewVerifyFactorList.new( @version, ) end @new_verify_factors end |
#rate_limits(sid = :unset) ⇒ RateLimitList, RateLimitContext
Access the rate_limits
831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 831 def rate_limits(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return RateLimitContext.new(@version, @solution[:sid],sid ) end unless @rate_limits @rate_limits = RateLimitList.new( @version, service_sid: @solution[:sid], ) end @rate_limits end |
#to_s ⇒ Object
Provide a user friendly representation
849 850 851 852 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 849 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.ServiceContext #{context}>" 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, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance
499 500 501 502 503 504 505 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 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 499 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, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'CodeLength' => code_length, 'LookupEnabled' => lookup_enabled, 'SkipSmsToLandlines' => skip_sms_to_landlines, 'DtmfInputRequired' => dtmf_input_required, 'TtsName' => tts_name, 'Psd2Enabled' => psd2_enabled, 'DoNotShareWarningEnabled' => do_not_share_warning_enabled, 'CustomCodeEnabled' => custom_code_enabled, 'Push.IncludeDate' => push_include_date, 'Push.ApnCredentialSid' => push_apn_credential_sid, 'Push.FcmCredentialSid' => push_fcm_credential_sid, 'Totp.Issuer' => totp_issuer, 'Totp.TimeStep' => totp_time_step, 'Totp.CodeLength' => totp_code_length, 'Totp.Skew' => totp_skew, 'DefaultTemplateSid' => default_template_sid, 'Whatsapp.MsgServiceSid' => whatsapp_msg_service_sid, 'Whatsapp.From' => whatsapp_from, 'Passkeys.RelyingParty.Id' => , 'Passkeys.RelyingParty.Name' => , 'Passkeys.RelyingParty.Origins' => , 'Passkeys.AuthenticatorAttachment' => , 'Passkeys.DiscoverableCredentials' => passkeys_discoverable_credentials, 'Passkeys.UserVerification' => passkeys_user_verification, 'VerifyEventSubscriptionEnabled' => verify_event_subscription_enabled, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end |
#update_with_metadata(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, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstanceMetadata
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 600 def ( 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, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'CodeLength' => code_length, 'LookupEnabled' => lookup_enabled, 'SkipSmsToLandlines' => skip_sms_to_landlines, 'DtmfInputRequired' => dtmf_input_required, 'TtsName' => tts_name, 'Psd2Enabled' => psd2_enabled, 'DoNotShareWarningEnabled' => do_not_share_warning_enabled, 'CustomCodeEnabled' => custom_code_enabled, 'Push.IncludeDate' => push_include_date, 'Push.ApnCredentialSid' => push_apn_credential_sid, 'Push.FcmCredentialSid' => push_fcm_credential_sid, 'Totp.Issuer' => totp_issuer, 'Totp.TimeStep' => totp_time_step, 'Totp.CodeLength' => totp_code_length, 'Totp.Skew' => totp_skew, 'DefaultTemplateSid' => default_template_sid, 'Whatsapp.MsgServiceSid' => whatsapp_msg_service_sid, 'Whatsapp.From' => whatsapp_from, 'Passkeys.RelyingParty.Id' => , 'Passkeys.RelyingParty.Name' => , 'Passkeys.RelyingParty.Origins' => , 'Passkeys.AuthenticatorAttachment' => , 'Passkeys.DiscoverableCredentials' => passkeys_discoverable_credentials, 'Passkeys.UserVerification' => passkeys_user_verification, 'VerifyEventSubscriptionEnabled' => verify_event_subscription_enabled, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) service_instance = ServiceInstance.new( @version, response.body, sid: @solution[:sid], ) ServiceInstanceMetadata.new( @version, service_instance, response.headers, response.status_code ) end |
#verification_checks ⇒ VerificationCheckList, VerificationCheckContext
Access the verification_checks
682 683 684 685 686 687 688 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 682 def verification_checks unless @verification_checks @verification_checks = VerificationCheckList.new( @version, service_sid: @solution[:sid], ) end @verification_checks end |
#verifications(sid = :unset) ⇒ VerificationList, VerificationContext
Access the verifications
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 726 def verifications(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return VerificationContext.new(@version, @solution[:sid],sid ) end unless @verifications @verifications = VerificationList.new( @version, service_sid: @solution[:sid], ) end @verifications end |
#webhooks(sid = :unset) ⇒ WebhookList, WebhookContext
Access the webhooks
764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 764 def webhooks(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return WebhookContext.new(@version, @solution[:sid],sid ) end unless @webhooks @webhooks = WebhookList.new( @version, service_sid: @solution[:sid], ) end @webhooks end |