twilio-ruby 7.11.2 → 7.12.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +13 -1
  3. data/CHANGES.md +272 -0
  4. data/Gemfile.lock +2 -2
  5. data/README.md +2 -2
  6. data/githooks/pre-commit +11 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +4 -4
  8. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +2 -2
  9. data/lib/twilio-ruby/rest/content/v1/content.rb +2 -2
  10. data/lib/twilio-ruby/rest/conversations/v2/action.rb +9 -2
  11. data/lib/twilio-ruby/rest/conversations/v2/communication.rb +4 -1
  12. data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +14 -0
  13. data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +133 -12
  14. data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +1 -1
  15. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +1 -1
  16. data/lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb +774 -0
  17. data/lib/twilio-ruby/rest/{numbers/v1/voice_verification_check.rb → insights/v3/custom_field_mappings_capacity.rb} +44 -48
  18. data/lib/twilio-ruby/rest/insights/v3.rb +22 -0
  19. data/lib/twilio-ruby/rest/intelligence/v3/rule_execution.rb +33 -1
  20. data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +5 -5
  21. data/lib/twilio-ruby/rest/memory/v1/data_mapping.rb +3 -3
  22. data/lib/twilio-ruby/rest/memory/v1/observation.rb +9 -9
  23. data/lib/twilio-ruby/rest/memory/v1/revision.rb +1 -1
  24. data/lib/twilio-ruby/rest/memory/v1/store.rb +3 -3
  25. data/lib/twilio-ruby/rest/memory/v1/trait_group.rb +3 -3
  26. data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +30 -2
  27. data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +30 -6
  28. data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +30 -6
  29. data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +45 -6
  30. data/lib/twilio-ruby/rest/numbers/v1.rb +0 -6
  31. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +40 -0
  32. data/lib/twilio-ruby/rest/routes/v3/iso_country_code.rb +402 -0
  33. data/lib/twilio-ruby/rest/routes/v3.rb +43 -0
  34. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +1 -1
  35. data/lib/twilio-ruby/rest/verify/v2/service/new_verify_factor.rb +1 -1
  36. data/lib/twilio-ruby/rest/voice/v2/recording_account_default_configuration.rb +547 -0
  37. data/lib/twilio-ruby/rest/voice/v2.rb +6 -0
  38. data/lib/twilio-ruby/twiml/voice_response.rb +12 -6
  39. data/lib/twilio-ruby/version.rb +1 -1
  40. metadata +6 -3
@@ -19,6 +19,26 @@ module Twilio
19
19
  class V1 < Version
20
20
  class SmsVerificationList < ListResource
21
21
 
22
+ class NumbersV1SmsVerificationRequest
23
+ # @param [to]: [String] The phone number to verify in E.164 format.
24
+ # @param [locale]: [String] The locale for the verification SMS message.
25
+ # @param [friendly_name]: [String] A human-readable name for the caller ID.
26
+ attr_accessor :to, :locale, :friendly_name
27
+ def initialize(payload)
28
+ @to = payload["to"]
29
+ @locale = payload["locale"]
30
+ @friendly_name = payload["friendly_name"]
31
+ end
32
+ def to_json(options = {})
33
+ {
34
+ "to": @to,
35
+ "locale": @locale,
36
+ "friendly_name": @friendly_name,
37
+ }.to_json(options)
38
+ end
39
+ end
40
+
41
+
22
42
  ##
23
43
  # Initialize the SmsVerificationList
24
44
  # @param [Version] version Version that contains the resource
@@ -33,16 +53,18 @@ module Twilio
33
53
  end
34
54
  ##
35
55
  # Create the SmsVerificationInstance
56
+ # @param [NumbersV1SmsVerificationRequest] numbers_v1_sms_verification_request
36
57
  # @return [SmsVerificationInstance] Created SmsVerificationInstance
37
- def create
58
+ def create(numbers_v1_sms_verification_request: nil
59
+ )
38
60
 
39
61
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
62
+ headers['Content-Type'] = 'application/json'
40
63
 
41
64
 
42
65
 
43
66
 
44
-
45
- payload = @version.create('POST', @uri, headers: headers)
67
+ payload = @version.create('POST', @uri, headers: headers, data: numbers_v1_sms_verification_request.to_json)
46
68
  SmsVerificationInstance.new(
47
69
  @version,
48
70
  payload,
@@ -51,16 +73,18 @@ module Twilio
51
73
 
52
74
  ##
53
75
  # Create the SmsVerificationInstanceMetadata
76
+ # @param [NumbersV1SmsVerificationRequest] numbers_v1_sms_verification_request
54
77
  # @return [SmsVerificationInstance] Created SmsVerificationInstance
55
- def create_with_metadata
78
+ def create_with_metadata(numbers_v1_sms_verification_request: nil
79
+ )
56
80
 
57
81
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
82
+ headers['Content-Type'] = 'application/json'
58
83
 
59
84
 
60
85
 
61
86
 
62
-
63
- response = @version.create_with_metadata('POST', @uri, headers: headers)
87
+ response = @version.create_with_metadata('POST', @uri, headers: headers, data: numbers_v1_sms_verification_request.to_json)
64
88
  sms_verification_instance = SmsVerificationInstance.new(
65
89
  @version,
66
90
  response.body,
@@ -19,6 +19,26 @@ module Twilio
19
19
  class V1 < Version
20
20
  class SmsVerificationCheckList < ListResource
21
21
 
22
+ class NumbersV1SmsVerificationCheckRequest
23
+ # @param [to]: [String] The phone number being verified in E.164 format.
24
+ # @param [verification_code]: [String] The 6 character verification code to check.
25
+ # @param [friendly_name]: [String] A human-readable name for the caller ID.
26
+ attr_accessor :to, :verification_code, :friendly_name
27
+ def initialize(payload)
28
+ @to = payload["to"]
29
+ @verification_code = payload["verification_code"]
30
+ @friendly_name = payload["friendly_name"]
31
+ end
32
+ def to_json(options = {})
33
+ {
34
+ "to": @to,
35
+ "verification_code": @verification_code,
36
+ "friendly_name": @friendly_name,
37
+ }.to_json(options)
38
+ end
39
+ end
40
+
41
+
22
42
  ##
23
43
  # Initialize the SmsVerificationCheckList
24
44
  # @param [Version] version Version that contains the resource
@@ -33,16 +53,18 @@ module Twilio
33
53
  end
34
54
  ##
35
55
  # Create the SmsVerificationCheckInstance
56
+ # @param [NumbersV1SmsVerificationCheckRequest] numbers_v1_sms_verification_check_request
36
57
  # @return [SmsVerificationCheckInstance] Created SmsVerificationCheckInstance
37
- def create
58
+ def create(numbers_v1_sms_verification_check_request: nil
59
+ )
38
60
 
39
61
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
62
+ headers['Content-Type'] = 'application/json'
40
63
 
41
64
 
42
65
 
43
66
 
44
-
45
- payload = @version.create('POST', @uri, headers: headers)
67
+ payload = @version.create('POST', @uri, headers: headers, data: numbers_v1_sms_verification_check_request.to_json)
46
68
  SmsVerificationCheckInstance.new(
47
69
  @version,
48
70
  payload,
@@ -51,16 +73,18 @@ module Twilio
51
73
 
52
74
  ##
53
75
  # Create the SmsVerificationCheckInstanceMetadata
76
+ # @param [NumbersV1SmsVerificationCheckRequest] numbers_v1_sms_verification_check_request
54
77
  # @return [SmsVerificationCheckInstance] Created SmsVerificationCheckInstance
55
- def create_with_metadata
78
+ def create_with_metadata(numbers_v1_sms_verification_check_request: nil
79
+ )
56
80
 
57
81
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
82
+ headers['Content-Type'] = 'application/json'
58
83
 
59
84
 
60
85
 
61
86
 
62
-
63
- response = @version.create_with_metadata('POST', @uri, headers: headers)
87
+ response = @version.create_with_metadata('POST', @uri, headers: headers, data: numbers_v1_sms_verification_check_request.to_json)
64
88
  sms_verification_check_instance = SmsVerificationCheckInstance.new(
65
89
  @version,
66
90
  response.body,
@@ -19,6 +19,41 @@ module Twilio
19
19
  class V1 < Version
20
20
  class VoiceVerificationList < ListResource
21
21
 
22
+ class NumbersV1VoiceVerificationRequest
23
+ # @param [phone_number]: [String] The phone number to verify in E.164 format.
24
+ # @param [friendly_name]: [String] A human-readable name for the caller ID.
25
+ # @param [custom_code]: [String] A custom verification code to use instead of a generated one.
26
+ # @param [call_delay]: [String] Number of seconds to delay the verification call (0-60).
27
+ # @param [status_callback]: [String] URL to receive status callback events.
28
+ # @param [status_callback_method]: [String] HTTP method for status callback requests.
29
+ # @param [extension]: [String] Phone extension to dial after connecting.
30
+ # @param [custom_success_message]: [String] Custom message to play after successful verification.
31
+ attr_accessor :phone_number, :friendly_name, :custom_code, :call_delay, :status_callback, :status_callback_method, :extension, :custom_success_message
32
+ def initialize(payload)
33
+ @phone_number = payload["phone_number"]
34
+ @friendly_name = payload["friendly_name"]
35
+ @custom_code = payload["custom_code"]
36
+ @call_delay = payload["call_delay"]
37
+ @status_callback = payload["status_callback"]
38
+ @status_callback_method = payload["status_callback_method"]
39
+ @extension = payload["extension"]
40
+ @custom_success_message = payload["custom_success_message"]
41
+ end
42
+ def to_json(options = {})
43
+ {
44
+ "phone_number": @phone_number,
45
+ "friendly_name": @friendly_name,
46
+ "custom_code": @custom_code,
47
+ "call_delay": @call_delay,
48
+ "status_callback": @status_callback,
49
+ "status_callback_method": @status_callback_method,
50
+ "extension": @extension,
51
+ "custom_success_message": @custom_success_message,
52
+ }.to_json(options)
53
+ end
54
+ end
55
+
56
+
22
57
  ##
23
58
  # Initialize the VoiceVerificationList
24
59
  # @param [Version] version Version that contains the resource
@@ -33,16 +68,18 @@ module Twilio
33
68
  end
34
69
  ##
35
70
  # Create the VoiceVerificationInstance
71
+ # @param [NumbersV1VoiceVerificationRequest] numbers_v1_voice_verification_request
36
72
  # @return [VoiceVerificationInstance] Created VoiceVerificationInstance
37
- def create
73
+ def create(numbers_v1_voice_verification_request: nil
74
+ )
38
75
 
39
76
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
77
+ headers['Content-Type'] = 'application/json'
40
78
 
41
79
 
42
80
 
43
81
 
44
-
45
- payload = @version.create('POST', @uri, headers: headers)
82
+ payload = @version.create('POST', @uri, headers: headers, data: numbers_v1_voice_verification_request.to_json)
46
83
  VoiceVerificationInstance.new(
47
84
  @version,
48
85
  payload,
@@ -51,16 +88,18 @@ module Twilio
51
88
 
52
89
  ##
53
90
  # Create the VoiceVerificationInstanceMetadata
91
+ # @param [NumbersV1VoiceVerificationRequest] numbers_v1_voice_verification_request
54
92
  # @return [VoiceVerificationInstance] Created VoiceVerificationInstance
55
- def create_with_metadata
93
+ def create_with_metadata(numbers_v1_voice_verification_request: nil
94
+ )
56
95
 
57
96
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
97
+ headers['Content-Type'] = 'application/json'
58
98
 
59
99
 
60
100
 
61
101
 
62
-
63
- response = @version.create_with_metadata('POST', @uri, headers: headers)
102
+ response = @version.create_with_metadata('POST', @uri, headers: headers, data: numbers_v1_voice_verification_request.to_json)
64
103
  voice_verification_instance = VoiceVerificationInstance.new(
65
104
  @version,
66
105
  response.body,
@@ -35,7 +35,6 @@ module Twilio
35
35
  @sms_verifications = nil
36
36
  @sms_verification_checks = nil
37
37
  @voice_verifications = nil
38
- @voice_verification_checks = nil
39
38
  @webhook = nil
40
39
  end
41
40
 
@@ -196,11 +195,6 @@ module Twilio
196
195
  @voice_verifications ||= VoiceVerificationList.new self
197
196
  end
198
197
  ##
199
- # @return [Twilio::REST::Numbers::V1::VoiceVerificationCheckList]
200
- def voice_verification_checks
201
- @voice_verification_checks ||= VoiceVerificationCheckList.new self
202
- end
203
- ##
204
198
  # @return [Twilio::REST::Numbers::V1::WebhookList]
205
199
  def webhook
206
200
  @webhook ||= WebhookList.new self
@@ -277,6 +277,38 @@ module Twilio
277
277
  # Dependents
278
278
  @dependent_hosted_number_orders = nil
279
279
  end
280
+ ##
281
+ # Delete the AuthorizationDocumentInstance
282
+ # @return [Boolean] True if delete succeeds, false otherwise
283
+ def delete
284
+
285
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
286
+
287
+
288
+
289
+
290
+ @version.delete('DELETE', @uri, headers: headers)
291
+ end
292
+
293
+ ##
294
+ # Delete the AuthorizationDocumentInstanceMetadata
295
+ # @return [Boolean] True if delete succeeds, false otherwise
296
+ def delete_with_metadata
297
+
298
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
299
+
300
+
301
+
302
+ response = @version.delete_with_metadata('DELETE', @uri, headers: headers)
303
+ authorizationDocument_instance = AuthorizationDocumentInstance.new(
304
+ @version,
305
+ response.body,
306
+ account_sid: @solution[:account_sid],
307
+ sid: @solution[:sid],
308
+ )
309
+ AuthorizationDocumentInstanceMetadata.new(@version, authorizationDocument_instance, response.headers, response.status_code)
310
+ end
311
+
280
312
  ##
281
313
  # Fetch the AuthorizationDocumentInstance
282
314
  # @return [AuthorizationDocumentInstance] Fetched AuthorizationDocumentInstance
@@ -675,6 +707,14 @@ module Twilio
675
707
  @properties['links']
676
708
  end
677
709
 
710
+ ##
711
+ # Delete the AuthorizationDocumentInstance
712
+ # @return [Boolean] True if delete succeeds, false otherwise
713
+ def delete
714
+
715
+ context.delete
716
+ end
717
+
678
718
  ##
679
719
  # Fetch the AuthorizationDocumentInstance
680
720
  # @return [AuthorizationDocumentInstance] Fetched AuthorizationDocumentInstance