Class: Twilio::REST::Messaging::V1::TollfreeVerificationContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ TollfreeVerificationContext

Initialize the TollfreeVerificationContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The unique string to identify Tollfree Verification.



473
474
475
476
477
478
479
480
481
482
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 473

def initialize(version, sid)
    super(version)
    

    # Path Solution
    @solution = { sid: sid,  }
    @uri = "/Tollfree/Verifications/#{@solution[:sid]}"

    
end

Instance Method Details

#deleteBoolean

Delete the TollfreeVerificationInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



486
487
488
489
490
491
492
493
494
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 486

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadataBoolean

Delete the TollfreeVerificationInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 499

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      tollfreeVerification_instance = TollfreeVerificationInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      .new(@version, tollfreeVerification_instance, response.headers, response.status_code)
end

#fetchTollfreeVerificationInstance

Fetch the TollfreeVerificationInstance

Returns:



518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 518

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    TollfreeVerificationInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#fetch_with_metadataTollfreeVerificationInstance

Fetch the TollfreeVerificationInstanceMetadata

Returns:



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 537

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    tollfree_verification_instance = TollfreeVerificationInstance.new(
        @version,
        response.body,
        sid: @solution[:sid],
    )
    .new(
        @version,
        tollfree_verification_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



831
832
833
834
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 831

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Messaging.V1.TollfreeVerificationContext #{context}>"
end

#to_sObject

Provide a user friendly representation



824
825
826
827
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 824

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Messaging.V1.TollfreeVerificationContext #{context}>"
end

#update(business_name: :unset, business_website: :unset, notification_email: :unset, use_case_categories: :unset, use_case_summary: :unset, production_message_sample: :unset, opt_in_image_urls: :unset, opt_in_type: :unset, message_volume: :unset, business_street_address: :unset, business_street_address2: :unset, business_city: :unset, business_state_province_region: :unset, business_postal_code: :unset, business_country: :unset, additional_information: :unset, business_contact_first_name: :unset, business_contact_last_name: :unset, business_contact_email: :unset, business_contact_phone: :unset, edit_reason: :unset, business_registration_number: :unset, business_registration_authority: :unset, business_registration_country: :unset, business_type: :unset, business_registration_phone_number: :unset, doing_business_as: :unset, opt_in_confirmation_message: :unset, help_message_sample: :unset, privacy_policy_url: :unset, terms_and_conditions_url: :unset, age_gated_content: :unset, opt_in_keywords: :unset, vetting_provider: :unset, vetting_id: :unset) ⇒ TollfreeVerificationInstance

Update the TollfreeVerificationInstance

Parameters:

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

    The name of the business or organization using the Tollfree number.

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

    The website of the business or organization using the Tollfree number.

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

    The email address to receive the notification about the verification result. .

  • use_case_categories (Array[String]) (defaults to: :unset)

    The category of the use case for the Tollfree Number. List as many are applicable..

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

    Use this to further explain how messaging is used by the business or organization.

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

    An example of message content, i.e. a sample message.

  • opt_in_image_urls (Array[String]) (defaults to: :unset)

    Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL.

  • opt_in_type (OptInType) (defaults to: :unset)
  • message_volume (String) (defaults to: :unset)

    Estimate monthly volume of messages from the Tollfree Number.

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

    The address of the business or organization using the Tollfree number.

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

    The address of the business or organization using the Tollfree number.

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

    The city of the business or organization using the Tollfree number.

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

    The state/province/region of the business or organization using the Tollfree number.

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

    The postal code of the business or organization using the Tollfree number.

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

    The country of the business or organization using the Tollfree number.

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

    Additional information to be provided for verification.

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

    The first name of the contact for the business or organization using the Tollfree number.

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

    The last name of the contact for the business or organization using the Tollfree number.

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

    The email address of the contact for the business or organization using the Tollfree number.

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

    The E.164 formatted phone number of the contact for the business or organization using the Tollfree number.

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

    Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to ‘Website fixed’.

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

    A legaly recognized business registration number

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

    The organizational authority for business registrations

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

    Country business is registered in

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

    The type of business, valid values are PRIVATE_PROFIT, PUBLIC_PROFIT, NON_PROFIT, SOLE_PROPRIETOR, GOVERNMENT

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

    The E.164 formatted number associated with the business.

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

    Trade name, sub entity, or downstream business name of business being submitted for verification

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

    The confirmation message sent to users when they opt in to receive messages.

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

    A sample help message provided to users.

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

    The URL to the privacy policy for the business or organization.

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

    The URL to the terms and conditions for the business or organization.

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

    Indicates if the content is age gated.

  • opt_in_keywords (Array[String]) (defaults to: :unset)

    List of keywords that users can text in to opt in to receive messages.

  • vetting_provider (VettingProvider) (defaults to: :unset)
  • vetting_id (String) (defaults to: :unset)

    The unique ID of the vetting

Returns:



597
598
599
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
677
678
679
680
681
682
683
684
685
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 597

def update(
    business_name: :unset, 
    business_website: :unset, 
    notification_email: :unset, 
    use_case_categories: :unset, 
    use_case_summary: :unset, 
    production_message_sample: :unset, 
    opt_in_image_urls: :unset, 
    opt_in_type: :unset, 
    message_volume: :unset, 
    business_street_address: :unset, 
    business_street_address2: :unset, 
    business_city: :unset, 
    business_state_province_region: :unset, 
    business_postal_code: :unset, 
    business_country: :unset, 
    additional_information: :unset, 
    business_contact_first_name: :unset, 
    business_contact_last_name: :unset, 
    business_contact_email: :unset, 
    business_contact_phone: :unset, 
    edit_reason: :unset, 
    business_registration_number: :unset, 
    business_registration_authority: :unset, 
    business_registration_country: :unset, 
    business_type: :unset, 
    business_registration_phone_number: :unset, 
    doing_business_as: :unset, 
    opt_in_confirmation_message: :unset, 
    help_message_sample: :unset, 
    privacy_policy_url: :unset, 
    terms_and_conditions_url: :unset, 
    age_gated_content: :unset, 
    opt_in_keywords: :unset, 
    vetting_provider: :unset, 
    vetting_id: :unset
)

    data = Twilio::Values.of({
        'BusinessName' => business_name,
        'BusinessWebsite' => business_website,
        'NotificationEmail' => notification_email,
        'UseCaseCategories' => Twilio.serialize_list(use_case_categories) { |e| e },
        'UseCaseSummary' => use_case_summary,
        'ProductionMessageSample' => production_message_sample,
        'OptInImageUrls' => Twilio.serialize_list(opt_in_image_urls) { |e| e },
        'OptInType' => opt_in_type,
        'MessageVolume' => message_volume,
        'BusinessStreetAddress' => business_street_address,
        'BusinessStreetAddress2' => business_street_address2,
        'BusinessCity' => business_city,
        'BusinessStateProvinceRegion' => business_state_province_region,
        'BusinessPostalCode' => business_postal_code,
        'BusinessCountry' => business_country,
        'AdditionalInformation' => additional_information,
        'BusinessContactFirstName' => business_contact_first_name,
        'BusinessContactLastName' => business_contact_last_name,
        'BusinessContactEmail' => business_contact_email,
        'BusinessContactPhone' => business_contact_phone,
        'EditReason' => edit_reason,
        'BusinessRegistrationNumber' => business_registration_number,
        'BusinessRegistrationAuthority' => business_registration_authority,
        'BusinessRegistrationCountry' => business_registration_country,
        'BusinessType' => business_type,
        'BusinessRegistrationPhoneNumber' => business_registration_phone_number,
        'DoingBusinessAs' => doing_business_as,
        'OptInConfirmationMessage' => opt_in_confirmation_message,
        'HelpMessageSample' => help_message_sample,
        'PrivacyPolicyUrl' => privacy_policy_url,
        'TermsAndConditionsUrl' => terms_and_conditions_url,
        'AgeGatedContent' => age_gated_content,
        'OptInKeywords' => Twilio.serialize_list(opt_in_keywords) { |e| e },
        'VettingProvider' => vetting_provider,
        'VettingId' => vetting_id,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    TollfreeVerificationInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#update_with_metadata(business_name: :unset, business_website: :unset, notification_email: :unset, use_case_categories: :unset, use_case_summary: :unset, production_message_sample: :unset, opt_in_image_urls: :unset, opt_in_type: :unset, message_volume: :unset, business_street_address: :unset, business_street_address2: :unset, business_city: :unset, business_state_province_region: :unset, business_postal_code: :unset, business_country: :unset, additional_information: :unset, business_contact_first_name: :unset, business_contact_last_name: :unset, business_contact_email: :unset, business_contact_phone: :unset, edit_reason: :unset, business_registration_number: :unset, business_registration_authority: :unset, business_registration_country: :unset, business_type: :unset, business_registration_phone_number: :unset, doing_business_as: :unset, opt_in_confirmation_message: :unset, help_message_sample: :unset, privacy_policy_url: :unset, terms_and_conditions_url: :unset, age_gated_content: :unset, opt_in_keywords: :unset, vetting_provider: :unset, vetting_id: :unset) ⇒ TollfreeVerificationInstance

Update the TollfreeVerificationInstanceMetadata

Parameters:

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

    The name of the business or organization using the Tollfree number.

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

    The website of the business or organization using the Tollfree number.

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

    The email address to receive the notification about the verification result. .

  • use_case_categories (Array[String]) (defaults to: :unset)

    The category of the use case for the Tollfree Number. List as many are applicable..

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

    Use this to further explain how messaging is used by the business or organization.

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

    An example of message content, i.e. a sample message.

  • opt_in_image_urls (Array[String]) (defaults to: :unset)

    Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL.

  • opt_in_type (OptInType) (defaults to: :unset)
  • message_volume (String) (defaults to: :unset)

    Estimate monthly volume of messages from the Tollfree Number.

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

    The address of the business or organization using the Tollfree number.

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

    The address of the business or organization using the Tollfree number.

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

    The city of the business or organization using the Tollfree number.

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

    The state/province/region of the business or organization using the Tollfree number.

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

    The postal code of the business or organization using the Tollfree number.

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

    The country of the business or organization using the Tollfree number.

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

    Additional information to be provided for verification.

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

    The first name of the contact for the business or organization using the Tollfree number.

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

    The last name of the contact for the business or organization using the Tollfree number.

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

    The email address of the contact for the business or organization using the Tollfree number.

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

    The E.164 formatted phone number of the contact for the business or organization using the Tollfree number.

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

    Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to ‘Website fixed’.

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

    A legaly recognized business registration number

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

    The organizational authority for business registrations

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

    Country business is registered in

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

    The type of business, valid values are PRIVATE_PROFIT, PUBLIC_PROFIT, NON_PROFIT, SOLE_PROPRIETOR, GOVERNMENT

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

    The E.164 formatted number associated with the business.

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

    Trade name, sub entity, or downstream business name of business being submitted for verification

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

    The confirmation message sent to users when they opt in to receive messages.

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

    A sample help message provided to users.

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

    The URL to the privacy policy for the business or organization.

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

    The URL to the terms and conditions for the business or organization.

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

    Indicates if the content is age gated.

  • opt_in_keywords (Array[String]) (defaults to: :unset)

    List of keywords that users can text in to opt in to receive messages.

  • vetting_provider (VettingProvider) (defaults to: :unset)
  • vetting_id (String) (defaults to: :unset)

    The unique ID of the vetting

Returns:



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
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 725

def (
  business_name: :unset, 
  business_website: :unset, 
  notification_email: :unset, 
  use_case_categories: :unset, 
  use_case_summary: :unset, 
  production_message_sample: :unset, 
  opt_in_image_urls: :unset, 
  opt_in_type: :unset, 
  message_volume: :unset, 
  business_street_address: :unset, 
  business_street_address2: :unset, 
  business_city: :unset, 
  business_state_province_region: :unset, 
  business_postal_code: :unset, 
  business_country: :unset, 
  additional_information: :unset, 
  business_contact_first_name: :unset, 
  business_contact_last_name: :unset, 
  business_contact_email: :unset, 
  business_contact_phone: :unset, 
  edit_reason: :unset, 
  business_registration_number: :unset, 
  business_registration_authority: :unset, 
  business_registration_country: :unset, 
  business_type: :unset, 
  business_registration_phone_number: :unset, 
  doing_business_as: :unset, 
  opt_in_confirmation_message: :unset, 
  help_message_sample: :unset, 
  privacy_policy_url: :unset, 
  terms_and_conditions_url: :unset, 
  age_gated_content: :unset, 
  opt_in_keywords: :unset, 
  vetting_provider: :unset, 
  vetting_id: :unset
)

    data = Twilio::Values.of({
        'BusinessName' => business_name,
        'BusinessWebsite' => business_website,
        'NotificationEmail' => notification_email,
        'UseCaseCategories' => Twilio.serialize_list(use_case_categories) { |e| e },
        'UseCaseSummary' => use_case_summary,
        'ProductionMessageSample' => production_message_sample,
        'OptInImageUrls' => Twilio.serialize_list(opt_in_image_urls) { |e| e },
        'OptInType' => opt_in_type,
        'MessageVolume' => message_volume,
        'BusinessStreetAddress' => business_street_address,
        'BusinessStreetAddress2' => business_street_address2,
        'BusinessCity' => business_city,
        'BusinessStateProvinceRegion' => business_state_province_region,
        'BusinessPostalCode' => business_postal_code,
        'BusinessCountry' => business_country,
        'AdditionalInformation' => additional_information,
        'BusinessContactFirstName' => business_contact_first_name,
        'BusinessContactLastName' => business_contact_last_name,
        'BusinessContactEmail' => business_contact_email,
        'BusinessContactPhone' => business_contact_phone,
        'EditReason' => edit_reason,
        'BusinessRegistrationNumber' => business_registration_number,
        'BusinessRegistrationAuthority' => business_registration_authority,
        'BusinessRegistrationCountry' => business_registration_country,
        'BusinessType' => business_type,
        'BusinessRegistrationPhoneNumber' => business_registration_phone_number,
        'DoingBusinessAs' => doing_business_as,
        'OptInConfirmationMessage' => opt_in_confirmation_message,
        'HelpMessageSample' => help_message_sample,
        'PrivacyPolicyUrl' => privacy_policy_url,
        'TermsAndConditionsUrl' => terms_and_conditions_url,
        'AgeGatedContent' => age_gated_content,
        'OptInKeywords' => Twilio.serialize_list(opt_in_keywords) { |e| e },
        'VettingProvider' => vetting_provider,
        'VettingId' => vetting_id,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    tollfree_verification_instance = TollfreeVerificationInstance.new(
        @version,
        response.body,
        sid: @solution[:sid],
    )
    .new(
        @version,
        tollfree_verification_instance,
        response.headers,
        response.status_code
    )
end