twilio-ruby 5.57.1 → 5.58.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56ba46ce32ceced608bcb6b1ab335f0aa103da6d3a40dba1e0a59b97734fe4f7
4
- data.tar.gz: 4104e0a452f0760f38a5ef1429553ad9a5f92c33a314e57d8f6e25c1689ada84
3
+ metadata.gz: 90245670a85b148807ee4a2be28da950b65530413eef56cf403e16708222a5d4
4
+ data.tar.gz: e279a65d127e4b629c904a9de0081c03effd7fa76ec73aa945bb52a8f4d32806
5
5
  SHA512:
6
- metadata.gz: 0d3edfca4bae4bad789f6ef2e5f15a161c115bb625e6a0912049c8f6054b05c40d4e41dd19544072be75a0e4f6d69f1b23fa41f3e8b3bee2453843f370c8c658
7
- data.tar.gz: 294073c071626bd889f211b66d16f0f896c6e127d524385b9d8989684eced0d63cdd1b6d456537f9ccc78e8b2a71b45dfdb1b14ec4a86c1f3b90413a0f4c588b
6
+ metadata.gz: f4cf12efd6b9c6b1a8dd4d3239c369e1592cb920e1c2c68451e5e835dcb43a1aa2d914b2fc6eaadd4daa65c09c980278d2fa6fd09723db8ecede21023bc38108
7
+ data.tar.gz: f92a04a5901154ccdb52b8a79dce167019b61177e90cc050774a2f1bfcb6a3b466b73fe92639363bdc43a697845423fd9d4d00e9ff1cad9fe34c9ae27329c831
data/.gitignore CHANGED
@@ -12,3 +12,5 @@ bin
12
12
  docs/_build
13
13
  *.bak
14
14
  *.iml
15
+
16
+ coverage
data/.travis.yml CHANGED
@@ -3,23 +3,35 @@ cache: bundler
3
3
  bundler_args: "--without development"
4
4
  rvm:
5
5
  - ruby-head
6
- - 3.0
7
- - 2.7
8
- - 2.6
9
- - 2.5
10
- - 2.4
11
6
  - jruby-9.2
7
+ - 2.4
8
+ - 2.5
9
+ - 2.6
10
+ - 2.7
11
+ - 3.0
12
12
  services:
13
13
  - docker
14
14
  install: make install
15
- script: make test
15
+ script:
16
+ - make test
17
+ - if [[ "$TRAVIS_BRANCH" == "main" || "$TRAVIS_BRANCH" == "travis" ]] && [ "$TRAVIS_PULL_REQUEST"
18
+ == "false" ]; then echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}"
19
+ --password-stdin; fi
16
20
  matrix:
21
+ include:
22
+ - language: ruby
23
+ rvm: '3.0'
24
+ # The below workaround is necessary because of the branch coverage inclusion in simplecov 0.18+
25
+ # more discussion here - https://community.sonarsource.com/t/ruby-coverage-simplecov-json-file-does-not-work/20909/7
26
+ after_success:
27
+ - ruby -rjson -e 'sqube = JSON.load(File.read("coverage/.resultset.json"))["RSpec"]["coverage"].transform_values {|lines| lines["lines"]}; total = { "RSpec" => { "coverage" => sqube, "timestamp" => Time.now.to_i }}; puts JSON.dump(total)' > coverage/.resultset.sonarqube.json
28
+ - sonar-scanner
17
29
  allow_failures:
18
30
  - rvm: ruby-head
19
31
  fast_finish: true
20
32
  deploy:
21
33
  - provider: script
22
- script: echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin && make docker-build && make docker-push
34
+ script: make docker-build && make docker-push
23
35
  skip_cleanup: true
24
36
  on:
25
37
  tags: true
@@ -37,3 +49,8 @@ notifications:
37
49
  on_failure: change
38
50
  rooms:
39
51
  secure: HG7rC5VSDOZiLCkpTsC4ZImh1k59OPi6YEjYKhdGXItybLHa6Yh5C42WvSx3kVW3SeyLOm1CiaMv+pbBZUXStXYsl8eH69MbEZimhDWsPs/m+bh+gEISov22WNUs3ZfUqIXMIb6v18oXPp2Qa1gX5LUEAGoSxHWNmCAcHayWl7M=
52
+ addons:
53
+ sonarcloud:
54
+ organization: twilio
55
+ token:
56
+ secure: OSEahx/yO/r9PdjXbASwJt+ogphxkDDpnlajWNCBTc+hoiEurGP/12CN0oQi7+iishIgIowqo5J9/+m1BQfsAv4fKST+t6mSazx27udiiM9am03lhviW8QSG6STADvtq6uJRqTXMk3WehoSidNRYXamVdCoBbqxCSaMX8MbMsN8=
data/CHANGES.md CHANGED
@@ -1,6 +1,35 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2021-08-11] Version 5.58.0
5
+ ---------------------------
6
+ **Library - Chore**
7
+ - [PR #566](https://github.com/twilio/twilio-ruby/pull/566): integrate sonarcloud. Thanks to [@shwetha-manvinkurke](https://github.com/shwetha-manvinkurke)!
8
+
9
+ **Library - Docs**
10
+ - [PR #565](https://github.com/twilio/twilio-ruby/pull/565): update mms example to use media_url. Thanks to [@cnorm35](https://github.com/cnorm35)!
11
+
12
+ **Api**
13
+ - Corrected the `price`, `call_sid_to_coach`, and `uri` data types for Conference, Participant, and Recording **(breaking change)**
14
+ - Made documentation for property `time_limit` in the call api public. **(breaking change)**
15
+ - Added `domain_sid` in sip_credential_list_mapping and sip_ip_access_control_list_mapping APIs **(breaking change)**
16
+
17
+ **Insights**
18
+ - Added new endpoint to fetch Call Summaries
19
+
20
+ **Messaging**
21
+ - Add brand_type field to a2p brand_registration api
22
+ - Revert brand registration api update to add brand_type field
23
+ - Add brand_type field to a2p brand_registration api
24
+
25
+ **Taskrouter**
26
+ - Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` as Response Headers to all TaskRouter endpoints
27
+
28
+ **Verify**
29
+ - Add `TemplateSid` optional parameter on Verification creation.
30
+ - Include `whatsapp` as a channel type in the verifications API.
31
+
32
+
4
33
  [2021-07-28] Version 5.57.1
5
34
  ---------------------------
6
35
  **Conversations**
data/Gemfile CHANGED
@@ -1,2 +1,3 @@
1
1
  source 'https://rubygems.org'
2
+ gem 'simplecov', require: false, group: :test
2
3
  gemspec
data/README.md CHANGED
@@ -35,13 +35,13 @@ This library supports the following Ruby implementations:
35
35
  To install using [Bundler][bundler] grab the latest stable version:
36
36
 
37
37
  ```ruby
38
- gem 'twilio-ruby', '~> 5.57.1'
38
+ gem 'twilio-ruby', '~> 5.58.0'
39
39
  ```
40
40
 
41
41
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
42
42
 
43
43
  ```bash
44
- gem install twilio-ruby -v 5.57.1
44
+ gem install twilio-ruby -v 5.58.0
45
45
  ```
46
46
 
47
47
  To build and install the development branch yourself from the latest source:
data/examples/examples.rb CHANGED
@@ -69,7 +69,7 @@ puts @client.messages('SMXXXXXXXX').fetch.body
69
69
  @client.messages.create(
70
70
  from: '+14159341234',
71
71
  to: '+16105557069',
72
- media_urls: 'http://example.com/media.png'
72
+ media_url: 'http://example.com/media.png'
73
73
  )
74
74
 
75
75
  ################ PHONE NUMBERS ################
@@ -151,6 +151,8 @@ module Twilio
151
151
  # `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the
152
152
  # audio that is received by Twilio. `outbound` records the audio that is generated
153
153
  # from Twilio. `both` records the audio that is received and generated by Twilio.
154
+ # @param [String] time_limit The maximum duration of the call in seconds.
155
+ # Constraints depend on account and configuration.
154
156
  # @param [String] url The absolute URL that returns the TwiML instructions for the
155
157
  # call. We will call this URL using the `method` when the call connects. For more
156
158
  # information, see the {Url
@@ -162,7 +164,7 @@ module Twilio
162
164
  # @param [String] application_sid The SID of the Application resource that will
163
165
  # handle the call, if the call will be handled by an application.
164
166
  # @return [CallInstance] Created CallInstance
165
- def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, recording_status_callback_event: :unset, trim: :unset, caller_id: :unset, machine_detection_speech_threshold: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_silence_timeout: :unset, async_amd: :unset, async_amd_status_callback: :unset, async_amd_status_callback_method: :unset, byoc: :unset, call_reason: :unset, call_token: :unset, recording_track: :unset, url: :unset, twiml: :unset, application_sid: :unset)
167
+ def create(to: nil, from: nil, method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_event: :unset, status_callback_method: :unset, send_digits: :unset, timeout: :unset, record: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, machine_detection: :unset, machine_detection_timeout: :unset, recording_status_callback_event: :unset, trim: :unset, caller_id: :unset, machine_detection_speech_threshold: :unset, machine_detection_speech_end_threshold: :unset, machine_detection_silence_timeout: :unset, async_amd: :unset, async_amd_status_callback: :unset, async_amd_status_callback_method: :unset, byoc: :unset, call_reason: :unset, call_token: :unset, recording_track: :unset, time_limit: :unset, url: :unset, twiml: :unset, application_sid: :unset)
166
168
  data = Twilio::Values.of({
167
169
  'To' => to,
168
170
  'From' => from,
@@ -198,6 +200,7 @@ module Twilio
198
200
  'CallReason' => call_reason,
199
201
  'CallToken' => call_token,
200
202
  'RecordingTrack' => recording_track,
203
+ 'TimeLimit' => time_limit,
201
204
  })
202
205
 
203
206
  payload = @version.create('POST', @uri, data: data)
@@ -488,8 +491,10 @@ module Twilio
488
491
  # `POST`. If an `application_sid` parameter is present, this parameter is ignored.
489
492
  # @param [String] twiml TwiML instructions for the call Twilio will use without
490
493
  # fetching Twiml from url. Twiml and url parameters are mutually exclusive
494
+ # @param [String] time_limit The maximum duration of the call in seconds.
495
+ # Constraints depend on account and configuration.
491
496
  # @return [CallInstance] Updated CallInstance
492
- def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset)
497
+ def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset)
493
498
  data = Twilio::Values.of({
494
499
  'Url' => url,
495
500
  'Method' => method,
@@ -499,6 +504,7 @@ module Twilio
499
504
  'StatusCallback' => status_callback,
500
505
  'StatusCallbackMethod' => status_callback_method,
501
506
  'Twiml' => twiml,
507
+ 'TimeLimit' => time_limit,
502
508
  })
503
509
 
504
510
  payload = @version.update('POST', @uri, data: data)
@@ -874,8 +880,10 @@ module Twilio
874
880
  # `POST`. If an `application_sid` parameter is present, this parameter is ignored.
875
881
  # @param [String] twiml TwiML instructions for the call Twilio will use without
876
882
  # fetching Twiml from url. Twiml and url parameters are mutually exclusive
883
+ # @param [String] time_limit The maximum duration of the call in seconds.
884
+ # Constraints depend on account and configuration.
877
885
  # @return [CallInstance] Updated CallInstance
878
- def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset)
886
+ def update(url: :unset, method: :unset, status: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, twiml: :unset, time_limit: :unset)
879
887
  context.update(
880
888
  url: url,
881
889
  method: method,
@@ -885,6 +893,7 @@ module Twilio
885
893
  status_callback: status_callback,
886
894
  status_callback_method: status_callback_method,
887
895
  twiml: twiml,
896
+ time_limit: time_limit,
888
897
  )
889
898
  end
890
899
 
@@ -167,8 +167,10 @@ module Twilio
167
167
  # `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the
168
168
  # audio that is received by Twilio. `outbound` records the audio that is sent from
169
169
  # Twilio. `both` records the audio that is received and sent by Twilio.
170
+ # @param [String] time_limit The maximum duration of the call in seconds.
171
+ # Constraints depend on account and configuration.
170
172
  # @return [ParticipantInstance] Created ParticipantInstance
171
- def create(from: nil, to: nil, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, label: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_record: :unset, conference_trim: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, region: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, recording_status_callback_event: :unset, conference_recording_status_callback_event: :unset, coaching: :unset, call_sid_to_coach: :unset, jitter_buffer_size: :unset, byoc: :unset, caller_id: :unset, call_reason: :unset, recording_track: :unset)
173
+ def create(from: nil, to: nil, status_callback: :unset, status_callback_method: :unset, status_callback_event: :unset, label: :unset, timeout: :unset, record: :unset, muted: :unset, beep: :unset, start_conference_on_enter: :unset, end_conference_on_exit: :unset, wait_url: :unset, wait_method: :unset, early_media: :unset, max_participants: :unset, conference_record: :unset, conference_trim: :unset, conference_status_callback: :unset, conference_status_callback_method: :unset, conference_status_callback_event: :unset, recording_channels: :unset, recording_status_callback: :unset, recording_status_callback_method: :unset, sip_auth_username: :unset, sip_auth_password: :unset, region: :unset, conference_recording_status_callback: :unset, conference_recording_status_callback_method: :unset, recording_status_callback_event: :unset, conference_recording_status_callback_event: :unset, coaching: :unset, call_sid_to_coach: :unset, jitter_buffer_size: :unset, byoc: :unset, caller_id: :unset, call_reason: :unset, recording_track: :unset, time_limit: :unset)
172
174
  data = Twilio::Values.of({
173
175
  'From' => from,
174
176
  'To' => to,
@@ -208,6 +210,7 @@ module Twilio
208
210
  'CallerId' => caller_id,
209
211
  'CallReason' => call_reason,
210
212
  'RecordingTrack' => recording_track,
213
+ 'TimeLimit' => time_limit,
211
214
  })
212
215
 
213
216
  payload = @version.create('POST', @uri, data: data)
@@ -282,7 +282,7 @@ module Twilio
282
282
  'start_time' => Twilio.deserialize_rfc2822(payload['start_time']),
283
283
  'duration' => payload['duration'],
284
284
  'sid' => payload['sid'],
285
- 'price' => payload['price'].to_f,
285
+ 'price' => payload['price'],
286
286
  'price_unit' => payload['price_unit'],
287
287
  'status' => payload['status'],
288
288
  'channels' => payload['channels'].to_i,
@@ -19,8 +19,8 @@ module Twilio
19
19
  # @param [Version] version Version that contains the resource
20
20
  # @param [String] account_sid The unique id of the Account that is responsible for
21
21
  # this resource.
22
- # @param [String] domain_sid The unique string that that we created to identify
23
- # the SipDomain resource.
22
+ # @param [String] domain_sid The unique string that is created to identify the
23
+ # SipDomain resource.
24
24
  # @return [CredentialListMappingList] CredentialListMappingList
25
25
  def initialize(version, account_sid: nil, domain_sid: nil)
26
26
  super(version)
@@ -233,8 +233,8 @@ module Twilio
233
233
  # @param [Hash] payload payload that contains response from Twilio
234
234
  # @param [String] account_sid The unique id of the Account that is responsible for
235
235
  # this resource.
236
- # @param [String] domain_sid The unique string that that we created to identify
237
- # the SipDomain resource.
236
+ # @param [String] domain_sid The unique string that is created to identify the
237
+ # SipDomain resource.
238
238
  # @param [String] sid A 34 character string that uniquely identifies the resource
239
239
  # to fetch.
240
240
  # @return [CredentialListMappingInstance] CredentialListMappingInstance
@@ -246,10 +246,10 @@ module Twilio
246
246
  'account_sid' => payload['account_sid'],
247
247
  'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
248
248
  'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
249
+ 'domain_sid' => payload['domain_sid'],
249
250
  'friendly_name' => payload['friendly_name'],
250
251
  'sid' => payload['sid'],
251
252
  'uri' => payload['uri'],
252
- 'subresource_uris' => payload['subresource_uris'],
253
253
  }
254
254
 
255
255
  # Context
@@ -295,6 +295,12 @@ module Twilio
295
295
  @properties['date_updated']
296
296
  end
297
297
 
298
+ ##
299
+ # @return [String] The unique string that identifies the SipDomain resource.
300
+ def domain_sid
301
+ @properties['domain_sid']
302
+ end
303
+
298
304
  ##
299
305
  # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
300
306
  def friendly_name
@@ -313,12 +319,6 @@ module Twilio
313
319
  @properties['uri']
314
320
  end
315
321
 
316
- ##
317
- # @return [String] The credentials associated with this resource.
318
- def subresource_uris
319
- @properties['subresource_uris']
320
- end
321
-
322
322
  ##
323
323
  # Fetch the CredentialListMappingInstance
324
324
  # @return [CredentialListMappingInstance] Fetched CredentialListMappingInstance
@@ -19,8 +19,8 @@ module Twilio
19
19
  # @param [Version] version Version that contains the resource
20
20
  # @param [String] account_sid The unique id of the Account that is responsible for
21
21
  # this resource.
22
- # @param [String] domain_sid The unique string that that we created to identify
23
- # the SipDomain resource.
22
+ # @param [String] domain_sid The unique string that is created to identify the
23
+ # SipDomain resource.
24
24
  # @return [IpAccessControlListMappingList] IpAccessControlListMappingList
25
25
  def initialize(version, account_sid: nil, domain_sid: nil)
26
26
  super(version)
@@ -232,8 +232,8 @@ module Twilio
232
232
  # @param [Hash] payload payload that contains response from Twilio
233
233
  # @param [String] account_sid The unique id of the Account that is responsible for
234
234
  # this resource.
235
- # @param [String] domain_sid The unique string that that we created to identify
236
- # the SipDomain resource.
235
+ # @param [String] domain_sid The unique string that is created to identify the
236
+ # SipDomain resource.
237
237
  # @param [String] sid A 34 character string that uniquely identifies the resource
238
238
  # to fetch.
239
239
  # @return [IpAccessControlListMappingInstance] IpAccessControlListMappingInstance
@@ -245,10 +245,10 @@ module Twilio
245
245
  'account_sid' => payload['account_sid'],
246
246
  'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
247
247
  'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
248
+ 'domain_sid' => payload['domain_sid'],
248
249
  'friendly_name' => payload['friendly_name'],
249
250
  'sid' => payload['sid'],
250
251
  'uri' => payload['uri'],
251
- 'subresource_uris' => payload['subresource_uris'],
252
252
  }
253
253
 
254
254
  # Context
@@ -294,6 +294,12 @@ module Twilio
294
294
  @properties['date_updated']
295
295
  end
296
296
 
297
+ ##
298
+ # @return [String] The unique string that identifies the SipDomain resource.
299
+ def domain_sid
300
+ @properties['domain_sid']
301
+ end
302
+
297
303
  ##
298
304
  # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
299
305
  def friendly_name
@@ -312,12 +318,6 @@ module Twilio
312
318
  @properties['uri']
313
319
  end
314
320
 
315
- ##
316
- # @return [String] The list of IP addresses associated with this domain.
317
- def subresource_uris
318
- @properties['subresource_uris']
319
- end
320
-
321
321
  ##
322
322
  # Fetch the IpAccessControlListMappingInstance
323
323
  # @return [IpAccessControlListMappingInstance] Fetched IpAccessControlListMappingInstance
@@ -36,6 +36,12 @@ module Twilio
36
36
  self.v1.calls(sid)
37
37
  end
38
38
 
39
+ ##
40
+ # @return [Twilio::REST::Insights::V1::CallSummariesInstance]
41
+ def call_summaries
42
+ self.v1.call_summaries()
43
+ end
44
+
39
45
  ##
40
46
  # @param [String] room_sid Unique identifier for the room.
41
47
  # @return [Twilio::REST::Insights::V1::RoomInstance] if room_sid was passed.
@@ -16,6 +16,7 @@ module Twilio
16
16
  super
17
17
  @version = 'v1'
18
18
  @calls = nil
19
+ @call_summaries = nil
19
20
  @rooms = nil
20
21
  end
21
22
 
@@ -34,6 +35,12 @@ module Twilio
34
35
  end
35
36
  end
36
37
 
38
+ ##
39
+ # @return [Twilio::REST::Insights::V1::CallSummariesContext]
40
+ def call_summaries
41
+ @call_summaries ||= CallSummariesList.new self
42
+ end
43
+
37
44
  ##
38
45
  # @param [String] room_sid The SID of the Room resource.
39
46
  # @return [Twilio::REST::Insights::V1::RoomContext] if room_sid was passed.
@@ -0,0 +1,428 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Insights < Domain
12
+ class V1 < Version
13
+ class CallSummariesList < ListResource
14
+ ##
15
+ # Initialize the CallSummariesList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [CallSummariesList] CallSummariesList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Voice/Summaries"
24
+ end
25
+
26
+ ##
27
+ # Lists CallSummariesInstance records from the API as a list.
28
+ # Unlike stream(), this operation is eager and will load `limit` records into
29
+ # memory before returning.
30
+ # @param [Array[String]] from The from
31
+ # @param [Array[String]] to The to
32
+ # @param [Array[String]] from_carrier The from_carrier
33
+ # @param [Array[String]] to_carrier The to_carrier
34
+ # @param [Array[String]] from_country_code The from_country_code
35
+ # @param [Array[String]] to_country_code The to_country_code
36
+ # @param [Boolean] branded The branded
37
+ # @param [Boolean] verified_caller The verified_caller
38
+ # @param [Boolean] has_tag The has_tag
39
+ # @param [String] start_time The start_time
40
+ # @param [String] end_time The end_time
41
+ # @param [Array[String]] call_type The call_type
42
+ # @param [Array[String]] call_state The call_state
43
+ # @param [call_summaries.CallDirection] direction The direction
44
+ # @param [call_summaries.ProcessingStateRequest] processing_state The
45
+ # processing_state
46
+ # @param [call_summaries.SortBy] sort_by The sort_by
47
+ # @param [String] subaccount The subaccount
48
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
49
+ # guarantees to never return more than limit. Default is no limit
50
+ # @param [Integer] page_size Number of records to fetch per request, when
51
+ # not set will use the default value of 50 records. If no page_size is defined
52
+ # but a limit is defined, stream() will attempt to read the limit with the most
53
+ # efficient page size, i.e. min(limit, 1000)
54
+ # @return [Array] Array of up to limit results
55
+ def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, limit: nil, page_size: nil)
56
+ self.stream(
57
+ from: from,
58
+ to: to,
59
+ from_carrier: from_carrier,
60
+ to_carrier: to_carrier,
61
+ from_country_code: from_country_code,
62
+ to_country_code: to_country_code,
63
+ branded: branded,
64
+ verified_caller: verified_caller,
65
+ has_tag: has_tag,
66
+ start_time: start_time,
67
+ end_time: end_time,
68
+ call_type: call_type,
69
+ call_state: call_state,
70
+ direction: direction,
71
+ processing_state: processing_state,
72
+ sort_by: sort_by,
73
+ subaccount: subaccount,
74
+ limit: limit,
75
+ page_size: page_size
76
+ ).entries
77
+ end
78
+
79
+ ##
80
+ # Streams CallSummariesInstance records from the API as an Enumerable.
81
+ # This operation lazily loads records as efficiently as possible until the limit
82
+ # is reached.
83
+ # @param [Array[String]] from The from
84
+ # @param [Array[String]] to The to
85
+ # @param [Array[String]] from_carrier The from_carrier
86
+ # @param [Array[String]] to_carrier The to_carrier
87
+ # @param [Array[String]] from_country_code The from_country_code
88
+ # @param [Array[String]] to_country_code The to_country_code
89
+ # @param [Boolean] branded The branded
90
+ # @param [Boolean] verified_caller The verified_caller
91
+ # @param [Boolean] has_tag The has_tag
92
+ # @param [String] start_time The start_time
93
+ # @param [String] end_time The end_time
94
+ # @param [Array[String]] call_type The call_type
95
+ # @param [Array[String]] call_state The call_state
96
+ # @param [call_summaries.CallDirection] direction The direction
97
+ # @param [call_summaries.ProcessingStateRequest] processing_state The
98
+ # processing_state
99
+ # @param [call_summaries.SortBy] sort_by The sort_by
100
+ # @param [String] subaccount The subaccount
101
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
102
+ # guarantees to never return more than limit. Default is no limit.
103
+ # @param [Integer] page_size Number of records to fetch per request, when
104
+ # not set will use the default value of 50 records. If no page_size is defined
105
+ # but a limit is defined, stream() will attempt to read the limit with the most
106
+ # efficient page size, i.e. min(limit, 1000)
107
+ # @return [Enumerable] Enumerable that will yield up to limit results
108
+ def stream(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, limit: nil, page_size: nil)
109
+ limits = @version.read_limits(limit, page_size)
110
+
111
+ page = self.page(
112
+ from: from,
113
+ to: to,
114
+ from_carrier: from_carrier,
115
+ to_carrier: to_carrier,
116
+ from_country_code: from_country_code,
117
+ to_country_code: to_country_code,
118
+ branded: branded,
119
+ verified_caller: verified_caller,
120
+ has_tag: has_tag,
121
+ start_time: start_time,
122
+ end_time: end_time,
123
+ call_type: call_type,
124
+ call_state: call_state,
125
+ direction: direction,
126
+ processing_state: processing_state,
127
+ sort_by: sort_by,
128
+ subaccount: subaccount,
129
+ page_size: limits[:page_size],
130
+ )
131
+
132
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
133
+ end
134
+
135
+ ##
136
+ # When passed a block, yields CallSummariesInstance records from the API.
137
+ # This operation lazily loads records as efficiently as possible until the limit
138
+ # is reached.
139
+ def each
140
+ limits = @version.read_limits
141
+
142
+ page = self.page(page_size: limits[:page_size], )
143
+
144
+ @version.stream(page,
145
+ limit: limits[:limit],
146
+ page_limit: limits[:page_limit]).each {|x| yield x}
147
+ end
148
+
149
+ ##
150
+ # Retrieve a single page of CallSummariesInstance records from the API.
151
+ # Request is executed immediately.
152
+ # @param [Array[String]] from The from
153
+ # @param [Array[String]] to The to
154
+ # @param [Array[String]] from_carrier The from_carrier
155
+ # @param [Array[String]] to_carrier The to_carrier
156
+ # @param [Array[String]] from_country_code The from_country_code
157
+ # @param [Array[String]] to_country_code The to_country_code
158
+ # @param [Boolean] branded The branded
159
+ # @param [Boolean] verified_caller The verified_caller
160
+ # @param [Boolean] has_tag The has_tag
161
+ # @param [String] start_time The start_time
162
+ # @param [String] end_time The end_time
163
+ # @param [Array[String]] call_type The call_type
164
+ # @param [Array[String]] call_state The call_state
165
+ # @param [call_summaries.CallDirection] direction The direction
166
+ # @param [call_summaries.ProcessingStateRequest] processing_state The
167
+ # processing_state
168
+ # @param [call_summaries.SortBy] sort_by The sort_by
169
+ # @param [String] subaccount The subaccount
170
+ # @param [String] page_token PageToken provided by the API
171
+ # @param [Integer] page_number Page Number, this value is simply for client state
172
+ # @param [Integer] page_size Number of records to return, defaults to 50
173
+ # @return [Page] Page of CallSummariesInstance
174
+ def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
175
+ params = Twilio::Values.of({
176
+ 'From' => Twilio.serialize_list(from) { |e| e },
177
+ 'To' => Twilio.serialize_list(to) { |e| e },
178
+ 'FromCarrier' => Twilio.serialize_list(from_carrier) { |e| e },
179
+ 'ToCarrier' => Twilio.serialize_list(to_carrier) { |e| e },
180
+ 'FromCountryCode' => Twilio.serialize_list(from_country_code) { |e| e },
181
+ 'ToCountryCode' => Twilio.serialize_list(to_country_code) { |e| e },
182
+ 'Branded' => branded,
183
+ 'VerifiedCaller' => verified_caller,
184
+ 'HasTag' => has_tag,
185
+ 'StartTime' => start_time,
186
+ 'EndTime' => end_time,
187
+ 'CallType' => Twilio.serialize_list(call_type) { |e| e },
188
+ 'CallState' => Twilio.serialize_list(call_state) { |e| e },
189
+ 'Direction' => direction,
190
+ 'ProcessingState' => processing_state,
191
+ 'SortBy' => sort_by,
192
+ 'Subaccount' => subaccount,
193
+ 'PageToken' => page_token,
194
+ 'Page' => page_number,
195
+ 'PageSize' => page_size,
196
+ })
197
+
198
+ response = @version.page('GET', @uri, params: params)
199
+
200
+ CallSummariesPage.new(@version, response, @solution)
201
+ end
202
+
203
+ ##
204
+ # Retrieve a single page of CallSummariesInstance records from the API.
205
+ # Request is executed immediately.
206
+ # @param [String] target_url API-generated URL for the requested results page
207
+ # @return [Page] Page of CallSummariesInstance
208
+ def get_page(target_url)
209
+ response = @version.domain.request(
210
+ 'GET',
211
+ target_url
212
+ )
213
+ CallSummariesPage.new(@version, response, @solution)
214
+ end
215
+
216
+ ##
217
+ # Provide a user friendly representation
218
+ def to_s
219
+ '#<Twilio.Insights.V1.CallSummariesList>'
220
+ end
221
+ end
222
+
223
+ class CallSummariesPage < Page
224
+ ##
225
+ # Initialize the CallSummariesPage
226
+ # @param [Version] version Version that contains the resource
227
+ # @param [Response] response Response from the API
228
+ # @param [Hash] solution Path solution for the resource
229
+ # @return [CallSummariesPage] CallSummariesPage
230
+ def initialize(version, response, solution)
231
+ super(version, response)
232
+
233
+ # Path Solution
234
+ @solution = solution
235
+ end
236
+
237
+ ##
238
+ # Build an instance of CallSummariesInstance
239
+ # @param [Hash] payload Payload response from the API
240
+ # @return [CallSummariesInstance] CallSummariesInstance
241
+ def get_instance(payload)
242
+ CallSummariesInstance.new(@version, payload, )
243
+ end
244
+
245
+ ##
246
+ # Provide a user friendly representation
247
+ def to_s
248
+ '<Twilio.Insights.V1.CallSummariesPage>'
249
+ end
250
+ end
251
+
252
+ class CallSummariesInstance < InstanceResource
253
+ ##
254
+ # Initialize the CallSummariesInstance
255
+ # @param [Version] version Version that contains the resource
256
+ # @param [Hash] payload payload that contains response from Twilio
257
+ # @return [CallSummariesInstance] CallSummariesInstance
258
+ def initialize(version, payload)
259
+ super(version)
260
+
261
+ # Marshaled Properties
262
+ @properties = {
263
+ 'account_sid' => payload['account_sid'],
264
+ 'call_sid' => payload['call_sid'],
265
+ 'call_type' => payload['call_type'],
266
+ 'call_state' => payload['call_state'],
267
+ 'processing_state' => payload['processing_state'],
268
+ 'created_time' => Twilio.deserialize_iso8601_datetime(payload['created_time']),
269
+ 'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']),
270
+ 'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
271
+ 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
272
+ 'connect_duration' => payload['connect_duration'] == nil ? payload['connect_duration'] : payload['connect_duration'].to_i,
273
+ 'from' => payload['from'],
274
+ 'to' => payload['to'],
275
+ 'carrier_edge' => payload['carrier_edge'],
276
+ 'client_edge' => payload['client_edge'],
277
+ 'sdk_edge' => payload['sdk_edge'],
278
+ 'sip_edge' => payload['sip_edge'],
279
+ 'tags' => payload['tags'],
280
+ 'url' => payload['url'],
281
+ 'attributes' => payload['attributes'],
282
+ 'properties' => payload['properties'],
283
+ 'trust' => payload['trust'],
284
+ }
285
+ end
286
+
287
+ ##
288
+ # @return [String] The account_sid
289
+ def account_sid
290
+ @properties['account_sid']
291
+ end
292
+
293
+ ##
294
+ # @return [String] The call_sid
295
+ def call_sid
296
+ @properties['call_sid']
297
+ end
298
+
299
+ ##
300
+ # @return [call_summaries.CallType] The call_type
301
+ def call_type
302
+ @properties['call_type']
303
+ end
304
+
305
+ ##
306
+ # @return [call_summaries.CallState] The call_state
307
+ def call_state
308
+ @properties['call_state']
309
+ end
310
+
311
+ ##
312
+ # @return [call_summaries.ProcessingState] The processing_state
313
+ def processing_state
314
+ @properties['processing_state']
315
+ end
316
+
317
+ ##
318
+ # @return [Time] The created_time
319
+ def created_time
320
+ @properties['created_time']
321
+ end
322
+
323
+ ##
324
+ # @return [Time] The start_time
325
+ def start_time
326
+ @properties['start_time']
327
+ end
328
+
329
+ ##
330
+ # @return [Time] The end_time
331
+ def end_time
332
+ @properties['end_time']
333
+ end
334
+
335
+ ##
336
+ # @return [String] The duration
337
+ def duration
338
+ @properties['duration']
339
+ end
340
+
341
+ ##
342
+ # @return [String] The connect_duration
343
+ def connect_duration
344
+ @properties['connect_duration']
345
+ end
346
+
347
+ ##
348
+ # @return [Hash] The from
349
+ def from
350
+ @properties['from']
351
+ end
352
+
353
+ ##
354
+ # @return [Hash] The to
355
+ def to
356
+ @properties['to']
357
+ end
358
+
359
+ ##
360
+ # @return [Hash] The carrier_edge
361
+ def carrier_edge
362
+ @properties['carrier_edge']
363
+ end
364
+
365
+ ##
366
+ # @return [Hash] The client_edge
367
+ def client_edge
368
+ @properties['client_edge']
369
+ end
370
+
371
+ ##
372
+ # @return [Hash] The sdk_edge
373
+ def sdk_edge
374
+ @properties['sdk_edge']
375
+ end
376
+
377
+ ##
378
+ # @return [Hash] The sip_edge
379
+ def sip_edge
380
+ @properties['sip_edge']
381
+ end
382
+
383
+ ##
384
+ # @return [Array[String]] The tags
385
+ def tags
386
+ @properties['tags']
387
+ end
388
+
389
+ ##
390
+ # @return [String] The url
391
+ def url
392
+ @properties['url']
393
+ end
394
+
395
+ ##
396
+ # @return [Hash] The attributes
397
+ def attributes
398
+ @properties['attributes']
399
+ end
400
+
401
+ ##
402
+ # @return [Hash] The properties
403
+ def properties
404
+ @properties['properties']
405
+ end
406
+
407
+ ##
408
+ # @return [Hash] The trust
409
+ def trust
410
+ @properties['trust']
411
+ end
412
+
413
+ ##
414
+ # Provide a user friendly representation
415
+ def to_s
416
+ "<Twilio.Insights.V1.CallSummariesInstance>"
417
+ end
418
+
419
+ ##
420
+ # Provide a detailed, user friendly representation
421
+ def inspect
422
+ "<Twilio.Insights.V1.CallSummariesInstance>"
423
+ end
424
+ end
425
+ end
426
+ end
427
+ end
428
+ end
@@ -109,11 +109,15 @@ module Twilio
109
109
  # Create the BrandRegistrationInstance
110
110
  # @param [String] customer_profile_bundle_sid Customer Profile Bundle Sid.
111
111
  # @param [String] a2p_profile_bundle_sid A2P Messaging Profile Bundle Sid.
112
+ # @param [String] brand_type Type of brand being created. One of: "STANDARD",
113
+ # "STARTER". STARTER is for low volume, starter use cases. STANDARD is for all
114
+ # other use cases.
112
115
  # @return [BrandRegistrationInstance] Created BrandRegistrationInstance
113
- def create(customer_profile_bundle_sid: nil, a2p_profile_bundle_sid: nil)
116
+ def create(customer_profile_bundle_sid: nil, a2p_profile_bundle_sid: nil, brand_type: :unset)
114
117
  data = Twilio::Values.of({
115
118
  'CustomerProfileBundleSid' => customer_profile_bundle_sid,
116
119
  'A2PProfileBundleSid' => a2p_profile_bundle_sid,
120
+ 'BrandType' => brand_type,
117
121
  })
118
122
 
119
123
  payload = @version.create('POST', @uri, data: data)
@@ -219,6 +223,7 @@ module Twilio
219
223
  'a2p_profile_bundle_sid' => payload['a2p_profile_bundle_sid'],
220
224
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
221
225
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
226
+ 'brand_type' => payload['brand_type'],
222
227
  'status' => payload['status'],
223
228
  'tcr_id' => payload['tcr_id'],
224
229
  'failure_reason' => payload['failure_reason'],
@@ -278,6 +283,12 @@ module Twilio
278
283
  @properties['date_updated']
279
284
  end
280
285
 
286
+ ##
287
+ # @return [String] Type of brand. One of: "STANDARD", "STARTER".
288
+ def brand_type
289
+ @properties['brand_type']
290
+ end
291
+
281
292
  ##
282
293
  # @return [brand_registration.Status] Brand Registration status
283
294
  def status
@@ -64,8 +64,9 @@ module Twilio
64
64
  # Hash}[https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string]
65
65
  # to be appended at the end of your verification SMS body. Applies only to SMS.
66
66
  # Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`.
67
+ # @param [String] template_sid The SID of the custom template to be used.
67
68
  # @return [VerificationInstance] Created VerificationInstance
68
- def create(to: nil, channel: nil, custom_friendly_name: :unset, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset, rate_limits: :unset, channel_configuration: :unset, app_hash: :unset)
69
+ def create(to: nil, channel: nil, custom_friendly_name: :unset, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset, rate_limits: :unset, channel_configuration: :unset, app_hash: :unset, template_sid: :unset)
69
70
  data = Twilio::Values.of({
70
71
  'To' => to,
71
72
  'Channel' => channel,
@@ -79,6 +80,7 @@ module Twilio
79
80
  'RateLimits' => Twilio.serialize_object(rate_limits),
80
81
  'ChannelConfiguration' => Twilio.serialize_object(channel_configuration),
81
82
  'AppHash' => app_hash,
83
+ 'TemplateSid' => template_sid,
82
84
  })
83
85
 
84
86
  payload = @version.create('POST', @uri, data: data)
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.57.1'
2
+ VERSION = '5.58.0'
3
3
  end
@@ -0,0 +1,13 @@
1
+ sonar.projectKey=twilio_twilio-ruby
2
+ sonar.projectName=twilio-ruby
3
+ sonar.organization=twilio
4
+
5
+ sonar.sources=lib/twilio-ruby
6
+ # Exclude any auto-generated source code
7
+ sonar.exclusions=lib/twilio-ruby/rest/**/*
8
+ sonar.tests=spec/
9
+ # Exclude any auto-generated integration tests
10
+ sonar.test.exclusions=spec/integration/**/*.spec.rb
11
+
12
+ # For Code Coverage analysis
13
+ sonar.ruby.coverage.reportPaths=coverage/.resultset.sonarqube.json
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: 5.57.1
4
+ version: 5.58.0
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: 2021-07-28 00:00:00.000000000 Z
11
+ date: 2021-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -444,6 +444,7 @@ files:
444
444
  - lib/twilio-ruby/rest/insights/v1/call/event.rb
445
445
  - lib/twilio-ruby/rest/insights/v1/call/metric.rb
446
446
  - lib/twilio-ruby/rest/insights/v1/call/summary.rb
447
+ - lib/twilio-ruby/rest/insights/v1/call_summaries.rb
447
448
  - lib/twilio-ruby/rest/insights/v1/room.rb
448
449
  - lib/twilio-ruby/rest/insights/v1/room/participant.rb
449
450
  - lib/twilio-ruby/rest/ip_messaging.rb
@@ -753,6 +754,7 @@ files:
753
754
  - lib/twilio-ruby/util.rb
754
755
  - lib/twilio-ruby/util/configuration.rb
755
756
  - lib/twilio-ruby/version.rb
757
+ - sonar-project.properties
756
758
  - twilio-ruby.gemspec
757
759
  homepage: https://github.com/twilio/twilio-ruby
758
760
  licenses: