twilio-ruby 7.11.3 → 7.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +277 -0
  3. data/Gemfile.lock +2 -2
  4. data/README.md +2 -2
  5. data/examples/WebhookSignatureValidation.md +61 -0
  6. data/lib/rack/twilio_webhook_authentication.rb +30 -5
  7. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +7 -0
  8. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +4 -4
  9. data/lib/twilio-ruby/rest/client.rb +5 -0
  10. data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +108 -1
  11. data/lib/twilio-ruby/rest/content/v1/content.rb +10 -4
  12. data/lib/twilio-ruby/rest/conversations/v2/action.rb +9 -2
  13. data/lib/twilio-ruby/rest/conversations/v2/communication.rb +4 -1
  14. data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +21 -0
  15. data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +226 -7
  16. data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +1 -1
  17. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +1 -1
  18. data/lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb +512 -17
  19. data/lib/twilio-ruby/rest/insights/v3/{capacity.rb → custom_field_mappings_capacity.rb} +26 -26
  20. data/lib/twilio-ruby/rest/insights/v3.rb +17 -7
  21. data/lib/twilio-ruby/rest/memory/v1/bulk.rb +22 -1
  22. data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +5 -5
  23. data/lib/twilio-ruby/rest/memory/v1/import.rb +21 -7
  24. data/lib/twilio-ruby/rest/memory/v1/observation.rb +9 -9
  25. data/lib/twilio-ruby/rest/memory/v1/revision.rb +1 -1
  26. data/lib/twilio-ruby/rest/memory/v1/store.rb +7 -0
  27. data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +30 -2
  28. data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +30 -6
  29. data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +30 -6
  30. data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +45 -6
  31. data/lib/twilio-ruby/rest/numbers/v1.rb +0 -6
  32. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +40 -0
  33. data/lib/twilio-ruby/rest/routes/v3/iso_country_code.rb +402 -0
  34. data/lib/twilio-ruby/rest/routes/v3.rb +43 -0
  35. data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +5 -5
  36. data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +4 -4
  37. data/lib/twilio-ruby/rest/trusthub/v1.rb +2 -2
  38. data/lib/twilio-ruby/rest/webhooks/v1/auth_profile.rb +825 -0
  39. data/lib/twilio-ruby/rest/webhooks/v1/edge_zone.rb +320 -0
  40. data/lib/twilio-ruby/rest/webhooks/v1/operation.rb +513 -0
  41. data/lib/twilio-ruby/rest/webhooks/v1/rule.rb +818 -0
  42. data/lib/twilio-ruby/rest/webhooks/v1/setting.rb +1028 -0
  43. data/lib/twilio-ruby/rest/webhooks/v1/shared_key.rb +722 -0
  44. data/lib/twilio-ruby/rest/webhooks/v1/test.rb +228 -0
  45. data/lib/twilio-ruby/rest/webhooks/v1.rb +126 -0
  46. data/lib/twilio-ruby/rest/webhooks.rb +6 -0
  47. data/lib/twilio-ruby/rest/webhooks_base.rb +38 -0
  48. data/lib/twilio-ruby/security/request_validator.rb +54 -8
  49. data/lib/twilio-ruby/twiml/voice_response.rb +20 -5
  50. data/lib/twilio-ruby/version.rb +1 -1
  51. metadata +15 -5
  52. data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +0 -165
  53. data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +0 -200
@@ -21,9 +21,52 @@ module Twilio
21
21
  def initialize(domain)
22
22
  super
23
23
  @version = 'v3'
24
+ @iso_country_code = nil
24
25
  @phone_numbers = nil
25
26
  end
26
27
 
28
+ ##
29
+ # @param [String] iso_country_code The ISO country code of the short code
30
+ # @param [String] short_code The short code
31
+ # @return [Twilio::REST::Routes::V3::IsoCountryCodeContext] if isoCountryCode was passed.
32
+ # @return [Twilio::REST::Routes::V3::IsoCountryCodeList]
33
+ def iso_country_code(iso_country_code=:unset, short_code=:unset)
34
+ if iso_country_code.nil?
35
+ raise ArgumentError, 'iso_country_code cannot be nil'
36
+ end
37
+ if short_code.nil?
38
+ raise ArgumentError, 'short_code cannot be nil'
39
+ end
40
+
41
+ if iso_country_code == :unset && short_code == :unset
42
+ @iso_country_code ||= IsoCountryCodeList.new self
43
+ elsif iso_country_code != :unset && short_code == :unset
44
+ IsoCountryCodeList.new(self, iso_country_code: iso_country_code)
45
+ else
46
+ IsoCountryCodeContext.new(self, iso_country_code, short_code)
47
+ end
48
+ end
49
+ ##
50
+ # @param [String] iso_country_code The ISO country code of the short code
51
+ # @param [String] short_code The short code
52
+ # @return [Twilio::REST::Routes::V3::IsoCountryCodeContext] if shortCode was passed.
53
+ # @return [Twilio::REST::Routes::V3::IsoCountryCodeList]
54
+ def iso_country_code(iso_country_code=:unset, short_code=:unset)
55
+ if iso_country_code.nil?
56
+ raise ArgumentError, 'iso_country_code cannot be nil'
57
+ end
58
+ if short_code.nil?
59
+ raise ArgumentError, 'short_code cannot be nil'
60
+ end
61
+
62
+ if iso_country_code == :unset && short_code == :unset
63
+ @iso_country_code ||= IsoCountryCodeList.new self
64
+ elsif iso_country_code != :unset && short_code == :unset
65
+ IsoCountryCodeList.new(self, iso_country_code: iso_country_code)
66
+ else
67
+ IsoCountryCodeContext.new(self, iso_country_code, short_code)
68
+ end
69
+ end
27
70
  ##
28
71
  # @param [String] phone_number The phone number in E.164 format
29
72
  # @return [Twilio::REST::Routes::V3::PhoneNumberContext] if phoneNumber was passed.
@@ -25,14 +25,14 @@ module Twilio
25
25
  # @param [friendly_name]: [String] A human-readable name for the brand registration.
26
26
  # @param [notification_email]: [String] The email address to receive notifications about the registration.
27
27
  # @param [business_name]: [String] The legal name of the business.
28
- # @param [business_registration_authority]: [String] The authority with which the business is registered.
28
+ # @param [business_registration_authority]: [String] The authority with which the business is registered. The value is validated by the service; see the Twilio docs for accepted values.
29
29
  # @param [business_registration_number]: [String] The business registration number (e.g., EIN, CBN, ACN). Maximum 21 characters.
30
- # @param [business_industry]: [String] The industry of the business.
30
+ # @param [business_industry]: [String] The industry of the business. The value is validated by the service; see the Twilio docs for accepted values.
31
31
  # @param [business_website]: [String] The business website URL (must use https://).
32
- # @param [business_type]: [String] The type of business entity.
32
+ # @param [business_type]: [String] The type of business entity. The value is validated by the service; see the Twilio docs for accepted values.
33
33
  # @param [business_stock_symbol]: [String] The stock symbol for publicly traded companies.
34
- # @param [business_stock_exchange]: [String] The stock exchange where the business is listed.
35
- # @param [business_tax_exempt_status]: [String] Nonprofit/political organization tax-exempt status per the U.S. tax code (e.g. 501c3, 501c1, 527). A value of 527 (political organization) requires a Campaign Verify token in brandExternalVettingToken.
34
+ # @param [business_stock_exchange]: [String] The stock exchange where the business is listed. The value is validated by the service; see the Twilio docs for accepted values.
35
+ # @param [business_tax_exempt_status]: [String] Nonprofit/political organization tax-exempt status per the U.S. tax code (e.g. 501c3, 501c1, 527). A value of 527 (political organization) requires a Campaign Verify token in brandExternalVettingToken. The value is validated by the service; see the Twilio docs for accepted values.
36
36
  # @param [brand_external_vetting_token]: [String] Campaign Verify token for externally vetted brands.
37
37
  # @param [business_street_address]: [String] The street address of the business.
38
38
  # @param [business_street_address2]: [String] Additional street address information.
@@ -20,17 +20,17 @@ module Twilio
20
20
  class A2PCampaignRegistrationList < ListResource
21
21
 
22
22
  class TrusthubV1A2pCampaignRegistrationRequest
23
- # @param [a2p_brand_registration_sid]: [String] The legacy Twilio A2P Brand SID (BN-prefixed) for the brand this campaign is registered under. This is a different identifier from the `id` returned by the Initialize Brand endpoint (which is formatted as `tri1.us1.account.AC.../registration.BU...`). Retrieve the BN brand SID via [GET /v1/a2p/BrandRegistrations/{Sid}](https://www.twilio.com/docs/messaging/api/brand-registration-resource) on `messaging.twilio.com`.
24
- # @param [messaging_service_sid]: [String] The SID of the Messaging Service.
23
+ # @param [a2p_brand_registration_sid]: [String] The legacy Twilio A2P Brand SID (BN-prefixed) for the brand this campaign is registered under. This is a different identifier from the `id` returned by the Initialize Brand endpoint (which is formatted as `tri1.us1.account.AC.../registration.BU...`). Retrieve the BN brand SID via [GET /v1/a2p/BrandRegistrations/{Sid}](https://www.twilio.com/docs/messaging/api/brand-registration-resource) on `messaging.twilio.com`. This field keeps the legacy Sid name because it carries a legacy Twilio SID (BN prefix) from messaging.twilio.com.
24
+ # @param [messaging_service_sid]: [String] The SID of the Messaging Service. This field keeps the legacy Sid name because it carries a legacy Twilio SID (MG prefix) from messaging.twilio.com.
25
25
  # @param [theme_set_id]: [String] Theme ID for styling the inquiry form.
26
- # @param [use_case_categories]: [Array<String>] The categories of the messaging use case.
26
+ # @param [use_case_categories]: [Array<String>] The categories of the messaging use case. The value is validated by the service; see the Twilio docs for accepted values.
27
27
  # @param [use_case_description]: [String] A description of the messaging use case.
28
28
  # @param [use_case_sample_message1]: [String] A sample message for the use case.
29
29
  # @param [use_case_sample_message2]: [String] A second sample message for the use case.
30
30
  # @param [use_case_sample_message3]: [String] A third sample message for the use case.
31
31
  # @param [use_case_sample_message4]: [String] A fourth sample message for the use case.
32
32
  # @param [use_case_sample_message5]: [String] A fifth sample message for the use case.
33
- # @param [use_case_opt_in_types]: [Array<String>] The opt-in methods for the use case.
33
+ # @param [use_case_opt_in_types]: [Array<String>] The opt-in methods for the use case. The value is validated by the service; see the Twilio docs for accepted values.
34
34
  # @param [use_case_opt_in_description]: [String] A description of the opt-in process.
35
35
  # @param [has_embedded_links]: [Boolean] Whether messages will contain embedded links.
36
36
  # @param [has_embedded_phone]: [Boolean] Whether messages will contain embedded phone numbers.
@@ -45,7 +45,7 @@ module Twilio
45
45
  @a2p_brand_registrations ||= A2PBrandRegistrationList.new self
46
46
  end
47
47
  ##
48
- # @param [String] id The unique identifier for the A2P Brand Registration.
48
+ # @param [String] id The unique identifier for the A2P Brand Registration, as returned in the `id` field when the brand registration was created.
49
49
  # @return [Twilio::REST::Trusthub::V1::A2PBrandRegistrationEmbeddedSessionList]
50
50
  def a2p_brand_registration_embedded_sessions(id=:unset)
51
51
  if id.nil?
@@ -64,7 +64,7 @@ module Twilio
64
64
  @a2p_campaign_registrations ||= A2PCampaignRegistrationList.new self
65
65
  end
66
66
  ##
67
- # @param [String] id The unique identifier for the A2P Campaign Registration. This can be either an A2P Campaign Registration ID (formatted `tri1.us1.account.AC.../registration.BU...`) returned from the Initialize Campaign endpoint, or a Messaging Service SID (`MG...`) for campaigns created outside the embeddable.
67
+ # @param [String] id The unique identifier for the A2P Campaign Registration. This is the A2P Campaign Registration ID (formatted `tri1.us1.account.AC.../registration.BU...`) returned in the `id` field when the campaign registration was created. For a campaign in FAILED status, use the Messaging Service SID (`MG...`) of the campaign instead.
68
68
  # @return [Twilio::REST::Trusthub::V1::A2PCampaignRegistrationEmbeddedSessionList]
69
69
  def a2p_campaign_registration_embedded_sessions(id=:unset)
70
70
  if id.nil?