twilio-ruby 7.9.0 → 7.9.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d7b336bf9b2991bc49c17ca8c21bf48d30404a3
4
- data.tar.gz: ebfe33678601bcffdea47d8d9ba87986ba076a57
3
+ metadata.gz: ee948f47784c5d49ae7243b9b002376870a6ddc3
4
+ data.tar.gz: 69e8b52f1c5cdde77e96325e87c988f28ca0cd12
5
5
  SHA512:
6
- metadata.gz: 15e023044c5b7f71d47ca46f950be16a9bf92f9953d7934b8b6e57fcaf70a6119d9130642267e1387330ad57cc8f7bfee405c148e32ce48ace22a45abc9d70e2
7
- data.tar.gz: 5038a92dd9a0d1f862d9778854347fe32e539966bee7cdc8d975f366df059543548369fd6dc70f9a1966be5ca5d63d0e09ecee86c88e5405f80a52fec41a8e40
6
+ metadata.gz: ccf16209bbd92b3cbe393fca56a34c4ac835f83f6a2076990cd4049ba997163c253204a18bf36164bcc12cbb927d70f29a82c156f3adf081007a0f62b4eb9e83
7
+ data.tar.gz: 741e65880219e81c967263cd5293e693a06af02b45a53de8e9cf52d3638d05df499a1f22273f751893e4b6324d7feaa547f236890b8266266fc951d1c2c8e044
data/CHANGES.md CHANGED
@@ -1,6 +1,17 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2026-01-07] Version 7.9.1
5
+ --------------------------
6
+ **Library - Chore**
7
+ - [PR #772](https://github.com/twilio/twilio-ruby/pull/772): Token Pagination support. Thanks to [@manisha1997](https://github.com/manisha1997)!
8
+ - [PR #773](https://github.com/twilio/twilio-ruby/pull/773): custom error response redesign. Thanks to [@manisha1997](https://github.com/manisha1997)!
9
+
10
+ **Api**
11
+ - Added optional parameter `clientNotificationUrl` for create call api
12
+ - Added optional parameter `clientNotificationUrl` for create participant api
13
+
14
+
4
15
  [2025-12-17] Version 7.9.0
5
16
  --------------------------
6
17
  **Library - Chore**
data/README.md CHANGED
@@ -39,13 +39,13 @@ This library supports the following Ruby implementations:
39
39
  To install using [Bundler][bundler] grab the latest stable version:
40
40
 
41
41
  ```ruby
42
- gem 'twilio-ruby', '~> 7.9.0'
42
+ gem 'twilio-ruby', '~> 7.9.1'
43
43
  ```
44
44
 
45
45
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
46
46
 
47
47
  ```bash
48
- gem install twilio-ruby -v 7.9.0
48
+ gem install twilio-ruby -v 7.9.1
49
49
  ```
50
50
 
51
51
  To build and install the development branch yourself from the latest source:
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'version'
4
+ require_relative 'error'
5
+
6
+ module Twilio
7
+ module REST
8
+ class ApiV1Version < Version
9
+ attr_accessor :api_version
10
+
11
+ def initialize(domain, version)
12
+ super(domain)
13
+ @version = version.version
14
+ @api_version = 'v1'
15
+ end
16
+
17
+ def exception(response, _)
18
+ RestErrorV10.new(response.body)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -35,5 +35,32 @@ module Twilio
35
35
 
36
36
  class ObsoleteError < StandardError
37
37
  end
38
+
39
+ class RestErrorV10 < TwilioError
40
+ attr_accessor :code, :message, :http_status_code, :params, :user_error
41
+
42
+ def initialize(response)
43
+ @code = response['code']
44
+ @message = response['message']
45
+ @http_status_code = response['httpsStatusCode']
46
+ @params = response['params']
47
+ @user_error = response['userError']
48
+ end
49
+
50
+ def to_s
51
+ message
52
+ end
53
+
54
+ private
55
+
56
+ def format_message(initial_message)
57
+ message_response = "[HTTP #{status_code}] #{code} : #{initial_message}"
58
+ message_response += "\n#{message}" if message
59
+ message_response += "\n#{http_status_code}" if http_status_code
60
+ message_response += "\n#{params}" if params
61
+ message_response += "\n#{user_error}" if user_error
62
+ message_response + "\n\n"
63
+ end
64
+ end
38
65
  end
39
66
  end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Twilio
4
+ module REST
5
+ class TokenPage < Page
6
+ attr_accessor :key, :page_size, :url
7
+
8
+ def initialize(version, response)
9
+ super(version, response)
10
+
11
+ @client = @version.domain.client.http_client
12
+ @url = ''
13
+ if @client.last_request
14
+ full_url = @client.last_request.url
15
+ uri = URI.parse(full_url)
16
+ @url = uri.path
17
+ @params = @client.last_request.params
18
+ end
19
+ @page_size = @payload['meta'] && @payload['meta']['pageSize']
20
+ @next_token = @payload['meta'] && @payload['meta']['nextToken']
21
+ @previous_token = @payload['meta'] && @payload['meta']['previousToken']
22
+ end
23
+
24
+ def previous_token
25
+ @payload['meta'] && @payload['meta']['previousToken']
26
+ end
27
+
28
+ def previous_page
29
+ cached_url = previous_page_url
30
+ return nil unless cached_url
31
+
32
+ response = @version.domain.request('GET', cached_url, @params)
33
+
34
+ self.class.new(@version, response, @solution)
35
+ end
36
+
37
+ def next_token
38
+ @payload['meta'] && @payload['meta']['nextToken']
39
+ end
40
+
41
+ def previous_page_url
42
+ return nil if previous_token.nil?
43
+
44
+ @params['pageToken'] = previous_token
45
+ @version.domain.absolute_url(@url)
46
+ end
47
+
48
+ def next_page_url
49
+ token = next_token
50
+ return nil if token.nil? || token.to_s.empty?
51
+
52
+ @params['pageToken'] = token
53
+ @version.domain.absolute_url(@url)
54
+ end
55
+
56
+ def next_page
57
+ cached_url = next_page_url
58
+ return nil unless cached_url
59
+
60
+ response = @version.domain.request('GET', cached_url, @params)
61
+
62
+ self.class.new(@version, response, @solution)
63
+ end
64
+
65
+ def load_page(payload)
66
+ @key ||= payload['meta'] && payload['meta']['key']
67
+ return @payload[@key] if @key && @payload[@key]
68
+
69
+ raise Twilio::REST::TwilioError, 'Page Records can not be deserialized'
70
+ end
71
+ end
72
+ end
73
+ end
@@ -3,7 +3,7 @@
3
3
  module Twilio
4
4
  module REST
5
5
  class Version
6
- attr_accessor :domain
6
+ attr_accessor :domain, :version
7
7
 
8
8
  class RecordStream
9
9
  include Enumerable
@@ -66,6 +66,7 @@ module Twilio
66
66
  # @param [String] call_token A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call.
67
67
  # @param [String] recording_track The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio.
68
68
  # @param [String] time_limit The maximum duration of the call in seconds. Constraints depend on account and configuration.
69
+ # @param [String] client_notification_url The URL that we should use to deliver `push call notification`.
69
70
  # @param [String] url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
70
71
  # @param [String] twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters.
71
72
  # @param [String] application_sid The SID of the Application resource that will handle the call, if the call will be handled by an application.
@@ -103,6 +104,7 @@ module Twilio
103
104
  call_token: :unset,
104
105
  recording_track: :unset,
105
106
  time_limit: :unset,
107
+ client_notification_url: :unset,
106
108
  url: :unset,
107
109
  twiml: :unset,
108
110
  application_sid: :unset
@@ -141,6 +143,7 @@ module Twilio
141
143
  'CallToken' => call_token,
142
144
  'RecordingTrack' => recording_track,
143
145
  'TimeLimit' => time_limit,
146
+ 'ClientNotificationUrl' => client_notification_url,
144
147
  'Url' => url,
145
148
  'Twiml' => twiml,
146
149
  'ApplicationSid' => application_sid,
@@ -83,6 +83,7 @@ module Twilio
83
83
  # @param [String] amd_status_callback_method The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`.
84
84
  # @param [String] trim Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`.
85
85
  # @param [String] call_token A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call.
86
+ # @param [String] client_notification_url The URL that we should use to deliver `push call notification`.
86
87
  # @param [String] caller_display_name The name that populates the display name in the From header. Must be between 2 and 255 characters. Only applicable for calls to sip address.
87
88
  # @return [ParticipantInstance] Created ParticipantInstance
88
89
  def create(
@@ -134,6 +135,7 @@ module Twilio
134
135
  amd_status_callback_method: :unset,
135
136
  trim: :unset,
136
137
  call_token: :unset,
138
+ client_notification_url: :unset,
137
139
  caller_display_name: :unset
138
140
  )
139
141
 
@@ -186,6 +188,7 @@ module Twilio
186
188
  'AmdStatusCallbackMethod' => amd_status_callback_method,
187
189
  'Trim' => trim,
188
190
  'CallToken' => call_token,
191
+ 'ClientNotificationUrl' => client_notification_url,
189
192
  'CallerDisplayName' => caller_display_name,
190
193
  })
191
194
 
@@ -67,6 +67,8 @@ module Twilio
67
67
  # @param [String] terms_and_conditions_url The URL to the terms and conditions for the business or organization.
68
68
  # @param [Boolean] age_gated_content Indicates if the content is age gated.
69
69
  # @param [Array[String]] opt_in_keywords List of keywords that users can text in to opt in to receive messages.
70
+ # @param [VettingProvider] vetting_provider
71
+ # @param [String] vetting_id The unique ID of the vetting
70
72
  # @return [TollfreeVerificationInstance] Created TollfreeVerificationInstance
71
73
  def create(
72
74
  business_name: nil,
@@ -103,7 +105,9 @@ module Twilio
103
105
  privacy_policy_url: :unset,
104
106
  terms_and_conditions_url: :unset,
105
107
  age_gated_content: :unset,
106
- opt_in_keywords: :unset
108
+ opt_in_keywords: :unset,
109
+ vetting_provider: :unset,
110
+ vetting_id: :unset
107
111
  )
108
112
 
109
113
  data = Twilio::Values.of({
@@ -142,6 +146,8 @@ module Twilio
142
146
  'TermsAndConditionsUrl' => terms_and_conditions_url,
143
147
  'AgeGatedContent' => age_gated_content,
144
148
  'OptInKeywords' => Twilio.serialize_list(opt_in_keywords) { |e| e },
149
+ 'VettingProvider' => vetting_provider,
150
+ 'VettingId' => vetting_id,
145
151
  })
146
152
 
147
153
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
@@ -366,6 +372,8 @@ module Twilio
366
372
  # @param [String] terms_and_conditions_url The URL to the terms and conditions for the business or organization.
367
373
  # @param [Boolean] age_gated_content Indicates if the content is age gated.
368
374
  # @param [Array[String]] opt_in_keywords List of keywords that users can text in to opt in to receive messages.
375
+ # @param [VettingProvider] vetting_provider
376
+ # @param [String] vetting_id The unique ID of the vetting
369
377
  # @return [TollfreeVerificationInstance] Updated TollfreeVerificationInstance
370
378
  def update(
371
379
  business_name: :unset,
@@ -400,7 +408,9 @@ module Twilio
400
408
  privacy_policy_url: :unset,
401
409
  terms_and_conditions_url: :unset,
402
410
  age_gated_content: :unset,
403
- opt_in_keywords: :unset
411
+ opt_in_keywords: :unset,
412
+ vetting_provider: :unset,
413
+ vetting_id: :unset
404
414
  )
405
415
 
406
416
  data = Twilio::Values.of({
@@ -437,6 +447,8 @@ module Twilio
437
447
  'TermsAndConditionsUrl' => terms_and_conditions_url,
438
448
  'AgeGatedContent' => age_gated_content,
439
449
  'OptInKeywords' => Twilio.serialize_list(opt_in_keywords) { |e| e },
450
+ 'VettingProvider' => vetting_provider,
451
+ 'VettingId' => vetting_id,
440
452
  })
441
453
 
442
454
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
@@ -562,6 +574,9 @@ module Twilio
562
574
  'rejection_reasons' => payload['rejection_reasons'],
563
575
  'resource_links' => payload['resource_links'],
564
576
  'external_reference_id' => payload['external_reference_id'],
577
+ 'vetting_id' => payload['vetting_id'],
578
+ 'vetting_provider' => payload['vetting_provider'],
579
+ 'vetting_id_expiration' => Twilio.deserialize_iso8601_datetime(payload['vetting_id_expiration']),
565
580
  }
566
581
 
567
582
  # Context
@@ -880,6 +895,24 @@ module Twilio
880
895
  @properties['external_reference_id']
881
896
  end
882
897
 
898
+ ##
899
+ # @return [String]
900
+ def vetting_id
901
+ @properties['vetting_id']
902
+ end
903
+
904
+ ##
905
+ # @return [VettingProvider]
906
+ def vetting_provider
907
+ @properties['vetting_provider']
908
+ end
909
+
910
+ ##
911
+ # @return [Time]
912
+ def vetting_id_expiration
913
+ @properties['vetting_id_expiration']
914
+ end
915
+
883
916
  ##
884
917
  # Delete the TollfreeVerificationInstance
885
918
  # @return [Boolean] True if delete succeeds, false otherwise
@@ -931,6 +964,8 @@ module Twilio
931
964
  # @param [String] terms_and_conditions_url The URL to the terms and conditions for the business or organization.
932
965
  # @param [Boolean] age_gated_content Indicates if the content is age gated.
933
966
  # @param [Array[String]] opt_in_keywords List of keywords that users can text in to opt in to receive messages.
967
+ # @param [VettingProvider] vetting_provider
968
+ # @param [String] vetting_id The unique ID of the vetting
934
969
  # @return [TollfreeVerificationInstance] Updated TollfreeVerificationInstance
935
970
  def update(
936
971
  business_name: :unset,
@@ -965,7 +1000,9 @@ module Twilio
965
1000
  privacy_policy_url: :unset,
966
1001
  terms_and_conditions_url: :unset,
967
1002
  age_gated_content: :unset,
968
- opt_in_keywords: :unset
1003
+ opt_in_keywords: :unset,
1004
+ vetting_provider: :unset,
1005
+ vetting_id: :unset
969
1006
  )
970
1007
 
971
1008
  context.update(
@@ -1002,6 +1039,8 @@ module Twilio
1002
1039
  terms_and_conditions_url: terms_and_conditions_url,
1003
1040
  age_gated_content: age_gated_content,
1004
1041
  opt_in_keywords: opt_in_keywords,
1042
+ vetting_provider: vetting_provider,
1043
+ vetting_id: vetting_id,
1005
1044
  )
1006
1045
  end
1007
1046
 
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '7.9.0'
2
+ VERSION = '7.9.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.9.0
4
+ version: 7.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twilio API Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-17 00:00:00.000000000 Z
11
+ date: 2026-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -238,12 +238,14 @@ files:
238
238
  - lib/twilio-ruby/credential/orgs_credential_provider.rb
239
239
  - lib/twilio-ruby/framework/request.rb
240
240
  - lib/twilio-ruby/framework/response.rb
241
+ - lib/twilio-ruby/framework/rest/api_v1_version.rb
241
242
  - lib/twilio-ruby/framework/rest/domain.rb
242
243
  - lib/twilio-ruby/framework/rest/error.rb
243
244
  - lib/twilio-ruby/framework/rest/helper.rb
244
245
  - lib/twilio-ruby/framework/rest/obsolete_client.rb
245
246
  - lib/twilio-ruby/framework/rest/page.rb
246
247
  - lib/twilio-ruby/framework/rest/resource.rb
248
+ - lib/twilio-ruby/framework/rest/token_page.rb
247
249
  - lib/twilio-ruby/framework/rest/version.rb
248
250
  - lib/twilio-ruby/framework/serialize.rb
249
251
  - lib/twilio-ruby/framework/values.rb