twilio-ruby 5.30.0 → 5.31.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 (26) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +17 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +5 -5
  5. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +19 -3
  6. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +42 -1
  7. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +42 -1
  8. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +42 -1
  9. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +26 -4
  10. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +7 -0
  11. data/lib/twilio-ruby/rest/insights/v1/call/event.rb +0 -14
  12. data/lib/twilio-ruby/rest/insights/v1/call/metric.rb +0 -14
  13. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +26 -4
  14. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +1 -1
  15. data/lib/twilio-ruby/version.rb +1 -1
  16. data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +8 -2
  17. data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +8 -2
  18. data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +8 -2
  19. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +8 -4
  20. data/spec/integration/chat/v2/service/user/user_channel_spec.rb +34 -5
  21. data/spec/integration/conversations/v1/conversation/message_spec.rb +7 -0
  22. data/spec/integration/insights/v1/call/event_spec.rb +2 -6
  23. data/spec/integration/insights/v1/call/metric_spec.rb +2 -6
  24. data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +34 -5
  25. data/spec/integration/messaging/v1/service/short_code_spec.rb +9 -3
  26. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16cae4a8b8149fc5353e25a78e727c65e1e01d40905818cff2b7f9989b65a848
4
- data.tar.gz: 647c86d08f7647d4fd3eb9ce7aadfa293f6e3d431240467e08332af10a541484
3
+ metadata.gz: fd21930bec1ab5a9a716f5e964b91652f707b5719e5d3bf0c28e2cd9e48e7e6f
4
+ data.tar.gz: 933226cd6679656a45e9f9eb65dda75ba085a5eda5826ca4c38575e8ec7716c6
5
5
  SHA512:
6
- metadata.gz: 0644cc5a3031b3d9df99d7da4f25db0e04b16b394697f2cdfd02e3db89614e58462f3b8d34188606f005f8130f3ad02d82b3577d44bd14cd74cd3abbdddbf05e
7
- data.tar.gz: 726e3cd4dfd182e20ce9b4e23ac61b065b411d9e2ed9004dc61ae85773eb75f57ba4254b424bc4b436ae4f1a90ab60d294e266dc6ea9c7d81285d5cb7633290a
6
+ metadata.gz: 9faa2a4aeb86f2f35878cf14becd52eaebe1fb790b1f888932f26f53524ac7a0a7dbdc30961ed16e861fdb33703074abb7259f5d731997f8662e059e82642255
7
+ data.tar.gz: c4c7b8adb4fe0123f64c67174841106ca4f15c7bf448b69a4132aa60098a9da59d52321eb5c030ba9574305a6019ce014dacb193769e558060d92cefb395b3ab
data/CHANGES.md CHANGED
@@ -1,6 +1,23 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2019-12-12] Version 5.31.0
5
+ ---------------------------
6
+ **Api**
7
+ - Make `twiml` conditional for create. One of `url`, `twiml`, or `application_sid` is now required.
8
+ - Add `bundle_sid` parameter to /IncomingPhoneNumbers API
9
+ - Removed discard / obfuscate parameters from ContentRetention, AddressRetention **(breaking change)**
10
+
11
+ **Chat**
12
+ - Added `last_consumed_message_index` and `last_consumption_timestamp` parameters in update method for UserChannel resource **(breaking change)**
13
+
14
+ **Conversations**
15
+ - Add Participant SID to Message properties
16
+
17
+ **Messaging**
18
+ - Fix incorrectly typed capabilities property for ShortCodes. **(breaking change)**
19
+
20
+
4
21
  [2019-12-04] Version 5.30.0
5
22
  ---------------------------
6
23
  **Library**
data/README.md CHANGED
@@ -31,13 +31,13 @@ This library supports the following Ruby implementations:
31
31
  To install using [Bundler][bundler] grab the latest stable version:
32
32
 
33
33
  ```ruby
34
- gem 'twilio-ruby', '~> 5.30.0'
34
+ gem 'twilio-ruby', '~> 5.31.0'
35
35
  ```
36
36
 
37
37
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
38
38
 
39
39
  ```bash
40
- gem install twilio-ruby -v 5.30.0
40
+ gem install twilio-ruby -v 5.31.0
41
41
  ```
42
42
 
43
43
  To build and install the development branch yourself from the latest source:
@@ -127,22 +127,23 @@ module Twilio
127
127
  # @param [String] machine_detection_silence_timeout The number of milliseconds of
128
128
  # initial silence after which an `unknown` AnsweredBy result will be returned.
129
129
  # Possible Values: 2000-10000. Default: 5000.
130
- # @param [String] twiml TwiML instructions for the call Twilio will use without
131
- # fetching Twiml from url parameter. If both `twiml` and `url` are provided then
132
- # `twiml` parameter will be ignored.
133
130
  # @param [String] url The absolute URL that returns the TwiML instructions for the
134
131
  # call. We will call this URL using the `method` when the call connects. For more
135
132
  # information, see the [Url
136
133
  # Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter)
137
134
  # section in [Making Calls](https://www.twilio.com/docs/voice/make-calls).
135
+ # @param [String] twiml TwiML instructions for the call Twilio will use without
136
+ # fetching Twiml from url parameter. If both `twiml` and `url` are provided then
137
+ # `twiml` parameter will be ignored.
138
138
  # @param [String] application_sid The SID of the Application resource that will
139
139
  # handle the call, if the call will be handled by an application.
140
140
  # @return [CallInstance] Newly created CallInstance
141
- 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, twiml: :unset, url: :unset, application_sid: :unset)
141
+ 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, url: :unset, twiml: :unset, application_sid: :unset)
142
142
  data = Twilio::Values.of({
143
143
  'To' => to,
144
144
  'From' => from,
145
145
  'Url' => url,
146
+ 'Twiml' => twiml,
146
147
  'ApplicationSid' => application_sid,
147
148
  'Method' => method,
148
149
  'FallbackUrl' => fallback_url,
@@ -166,7 +167,6 @@ module Twilio
166
167
  'MachineDetectionSpeechThreshold' => machine_detection_speech_threshold,
167
168
  'MachineDetectionSpeechEndThreshold' => machine_detection_speech_end_threshold,
168
169
  'MachineDetectionSilenceTimeout' => machine_detection_silence_timeout,
169
- 'Twiml' => twiml,
170
170
  })
171
171
 
172
172
  payload = @version.create(
@@ -221,6 +221,8 @@ module Twilio
221
221
  # @param [incoming_phone_number.VoiceReceiveMode] voice_receive_mode The
222
222
  # configuration parameter for the new phone number to receive incoming voice calls
223
223
  # or faxes. Can be: `fax` or `voice` and defaults to `voice`.
224
+ # @param [String] bundle_sid The SID of the Bundle resource that you associate
225
+ # with the phone number. Some regions require a Bundle to meet local Regulations.
224
226
  # @param [String] phone_number The phone number to purchase specified in
225
227
  # [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone
226
228
  # numbers consist of a + followed by the country code and subscriber number
@@ -230,7 +232,7 @@ module Twilio
230
232
  # available phone number within this area code for you. **You must provide an
231
233
  # `area_code` or a `phone_number`.** (US and Canada only).
232
234
  # @return [IncomingPhoneNumberInstance] Newly created IncomingPhoneNumberInstance
233
- def create(api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, identity_sid: :unset, address_sid: :unset, voice_receive_mode: :unset, phone_number: :unset, area_code: :unset)
235
+ def create(api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, identity_sid: :unset, address_sid: :unset, voice_receive_mode: :unset, bundle_sid: :unset, phone_number: :unset, area_code: :unset)
234
236
  data = Twilio::Values.of({
235
237
  'PhoneNumber' => phone_number,
236
238
  'AreaCode' => area_code,
@@ -255,6 +257,7 @@ module Twilio
255
257
  'IdentitySid' => identity_sid,
256
258
  'AddressSid' => address_sid,
257
259
  'VoiceReceiveMode' => voice_receive_mode,
260
+ 'BundleSid' => bundle_sid,
258
261
  })
259
262
 
260
263
  payload = @version.create(
@@ -409,8 +412,10 @@ module Twilio
409
412
  # regulations.
410
413
  # @param [String] address_sid The SID of the Address resource we should associate
411
414
  # with the phone number. Some regions require addresses to meet local regulations.
415
+ # @param [String] bundle_sid The SID of the Bundle resource that you associate
416
+ # with the phone number. Some regions require a Bundle to meet local Regulations.
412
417
  # @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
413
- def update(account_sid: :unset, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset, address_sid: :unset)
418
+ def update(account_sid: :unset, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset, address_sid: :unset, bundle_sid: :unset)
414
419
  data = Twilio::Values.of({
415
420
  'AccountSid' => account_sid,
416
421
  'ApiVersion' => api_version,
@@ -434,6 +439,7 @@ module Twilio
434
439
  'VoiceReceiveMode' => voice_receive_mode,
435
440
  'IdentitySid' => identity_sid,
436
441
  'AddressSid' => address_sid,
442
+ 'BundleSid' => bundle_sid,
437
443
  })
438
444
 
439
445
  payload = @version.update(
@@ -560,6 +566,7 @@ module Twilio
560
566
  'voice_url' => payload['voice_url'],
561
567
  'emergency_status' => payload['emergency_status'],
562
568
  'emergency_address_sid' => payload['emergency_address_sid'],
569
+ 'bundle_sid' => payload['bundle_sid'],
563
570
  }
564
571
 
565
572
  # Context
@@ -758,6 +765,12 @@ module Twilio
758
765
  @properties['emergency_address_sid']
759
766
  end
760
767
 
768
+ ##
769
+ # @return [String] The SID of the Bundle resource associated with number
770
+ def bundle_sid
771
+ @properties['bundle_sid']
772
+ end
773
+
761
774
  ##
762
775
  # Update the IncomingPhoneNumberInstance
763
776
  # @param [String] account_sid The SID of the
@@ -820,8 +833,10 @@ module Twilio
820
833
  # regulations.
821
834
  # @param [String] address_sid The SID of the Address resource we should associate
822
835
  # with the phone number. Some regions require addresses to meet local regulations.
836
+ # @param [String] bundle_sid The SID of the Bundle resource that you associate
837
+ # with the phone number. Some regions require a Bundle to meet local Regulations.
823
838
  # @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
824
- def update(account_sid: :unset, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset, address_sid: :unset)
839
+ def update(account_sid: :unset, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset, address_sid: :unset, bundle_sid: :unset)
825
840
  context.update(
826
841
  account_sid: account_sid,
827
842
  api_version: api_version,
@@ -845,6 +860,7 @@ module Twilio
845
860
  voice_receive_mode: voice_receive_mode,
846
861
  identity_sid: identity_sid,
847
862
  address_sid: address_sid,
863
+ bundle_sid: bundle_sid,
848
864
  )
849
865
  end
850
866
 
@@ -205,8 +205,23 @@ module Twilio
205
205
  # @param [String] address_sid The SID of the Address resource we should associate
206
206
  # with the new phone number. Some regions require addresses to meet local
207
207
  # regulations.
208
+ # @param [local.EmergencyStatus] emergency_status The configuration status
209
+ # parameter that determines whether the new phone number is enabled for emergency
210
+ # calling.
211
+ # @param [String] emergency_address_sid The SID of the emergency address
212
+ # configuration to use for emergency calling from the new phone number.
213
+ # @param [String] trunk_sid The SID of the Trunk we should use to handle calls to
214
+ # the new phone number. If a `trunk_sid` is present, we ignore all of the voice
215
+ # urls and voice applications and use only those set on the Trunk. Setting a
216
+ # `trunk_sid` will automatically delete your `voice_application_sid` and vice
217
+ # versa.
218
+ # @param [local.VoiceReceiveMode] voice_receive_mode The configuration parameter
219
+ # for the new phone number to receive incoming voice calls or faxes. Can be: `fax`
220
+ # or `voice` and defaults to `voice`.
221
+ # @param [String] bundle_sid The SID of the Bundle resource that you associate
222
+ # with the phone number. Some regions require a Bundle to meet local Regulations.
208
223
  # @return [LocalInstance] Newly created LocalInstance
209
- def create(phone_number: nil, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, identity_sid: :unset, address_sid: :unset)
224
+ def create(phone_number: nil, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, identity_sid: :unset, address_sid: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, bundle_sid: :unset)
210
225
  data = Twilio::Values.of({
211
226
  'PhoneNumber' => phone_number,
212
227
  'ApiVersion' => api_version,
@@ -226,6 +241,11 @@ module Twilio
226
241
  'VoiceUrl' => voice_url,
227
242
  'IdentitySid' => identity_sid,
228
243
  'AddressSid' => address_sid,
244
+ 'EmergencyStatus' => emergency_status,
245
+ 'EmergencyAddressSid' => emergency_address_sid,
246
+ 'TrunkSid' => trunk_sid,
247
+ 'VoiceReceiveMode' => voice_receive_mode,
248
+ 'BundleSid' => bundle_sid,
229
249
  })
230
250
 
231
251
  payload = @version.create(
@@ -315,6 +335,9 @@ module Twilio
315
335
  'voice_fallback_url' => payload['voice_fallback_url'],
316
336
  'voice_method' => payload['voice_method'],
317
337
  'voice_url' => payload['voice_url'],
338
+ 'emergency_status' => payload['emergency_status'],
339
+ 'emergency_address_sid' => payload['emergency_address_sid'],
340
+ 'bundle_sid' => payload['bundle_sid'],
318
341
  }
319
342
  end
320
343
 
@@ -486,6 +509,24 @@ module Twilio
486
509
  @properties['voice_url']
487
510
  end
488
511
 
512
+ ##
513
+ # @return [local.EmergencyStatus] Whether the phone number is enabled for emergency calling
514
+ def emergency_status
515
+ @properties['emergency_status']
516
+ end
517
+
518
+ ##
519
+ # @return [String] The emergency address configuration to use for emergency calling
520
+ def emergency_address_sid
521
+ @properties['emergency_address_sid']
522
+ end
523
+
524
+ ##
525
+ # @return [String] The SID of the Bundle resource associated with number
526
+ def bundle_sid
527
+ @properties['bundle_sid']
528
+ end
529
+
489
530
  ##
490
531
  # Provide a user friendly representation
491
532
  def to_s
@@ -204,8 +204,23 @@ module Twilio
204
204
  # @param [String] address_sid The SID of the Address resource we should associate
205
205
  # with the new phone number. Some regions require addresses to meet local
206
206
  # regulations.
207
+ # @param [mobile.EmergencyStatus] emergency_status The configuration status
208
+ # parameter that determines whether the new phone number is enabled for emergency
209
+ # calling.
210
+ # @param [String] emergency_address_sid The SID of the emergency address
211
+ # configuration to use for emergency calling from the new phone number.
212
+ # @param [String] trunk_sid The SID of the Trunk we should use to handle calls to
213
+ # the new phone number. If a `trunk_sid` is present, we ignore all of the voice
214
+ # urls and voice applications and use only those set on the Trunk. Setting a
215
+ # `trunk_sid` will automatically delete your `voice_application_sid` and vice
216
+ # versa.
217
+ # @param [mobile.VoiceReceiveMode] voice_receive_mode The configuration parameter
218
+ # for the new phone number to receive incoming voice calls or faxes. Can be: `fax`
219
+ # or `voice` and defaults to `voice`.
220
+ # @param [String] bundle_sid The SID of the Bundle resource that you associate
221
+ # with the phone number. Some regions require a Bundle to meet local Regulations.
207
222
  # @return [MobileInstance] Newly created MobileInstance
208
- def create(phone_number: nil, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, identity_sid: :unset, address_sid: :unset)
223
+ def create(phone_number: nil, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, identity_sid: :unset, address_sid: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, bundle_sid: :unset)
209
224
  data = Twilio::Values.of({
210
225
  'PhoneNumber' => phone_number,
211
226
  'ApiVersion' => api_version,
@@ -225,6 +240,11 @@ module Twilio
225
240
  'VoiceUrl' => voice_url,
226
241
  'IdentitySid' => identity_sid,
227
242
  'AddressSid' => address_sid,
243
+ 'EmergencyStatus' => emergency_status,
244
+ 'EmergencyAddressSid' => emergency_address_sid,
245
+ 'TrunkSid' => trunk_sid,
246
+ 'VoiceReceiveMode' => voice_receive_mode,
247
+ 'BundleSid' => bundle_sid,
228
248
  })
229
249
 
230
250
  payload = @version.create(
@@ -314,6 +334,9 @@ module Twilio
314
334
  'voice_fallback_url' => payload['voice_fallback_url'],
315
335
  'voice_method' => payload['voice_method'],
316
336
  'voice_url' => payload['voice_url'],
337
+ 'emergency_status' => payload['emergency_status'],
338
+ 'emergency_address_sid' => payload['emergency_address_sid'],
339
+ 'bundle_sid' => payload['bundle_sid'],
317
340
  }
318
341
  end
319
342
 
@@ -485,6 +508,24 @@ module Twilio
485
508
  @properties['voice_url']
486
509
  end
487
510
 
511
+ ##
512
+ # @return [mobile.EmergencyStatus] Whether the phone number is enabled for emergency calling
513
+ def emergency_status
514
+ @properties['emergency_status']
515
+ end
516
+
517
+ ##
518
+ # @return [String] The emergency address configuration to use for emergency calling
519
+ def emergency_address_sid
520
+ @properties['emergency_address_sid']
521
+ end
522
+
523
+ ##
524
+ # @return [String] The SID of the Bundle resource associated with number
525
+ def bundle_sid
526
+ @properties['bundle_sid']
527
+ end
528
+
488
529
  ##
489
530
  # Provide a user friendly representation
490
531
  def to_s
@@ -204,8 +204,23 @@ module Twilio
204
204
  # @param [String] address_sid The SID of the Address resource we should associate
205
205
  # with the new phone number. Some regions require addresses to meet local
206
206
  # regulations.
207
+ # @param [toll_free.EmergencyStatus] emergency_status The configuration status
208
+ # parameter that determines whether the new phone number is enabled for emergency
209
+ # calling.
210
+ # @param [String] emergency_address_sid The SID of the emergency address
211
+ # configuration to use for emergency calling from the new phone number.
212
+ # @param [String] trunk_sid The SID of the Trunk we should use to handle calls to
213
+ # the new phone number. If a `trunk_sid` is present, we ignore all of the voice
214
+ # urls and voice applications and use only those set on the Trunk. Setting a
215
+ # `trunk_sid` will automatically delete your `voice_application_sid` and vice
216
+ # versa.
217
+ # @param [toll_free.VoiceReceiveMode] voice_receive_mode The configuration
218
+ # parameter for the new phone number to receive incoming voice calls or faxes. Can
219
+ # be: `fax` or `voice` and defaults to `voice`.
220
+ # @param [String] bundle_sid The SID of the Bundle resource that you associate
221
+ # with the phone number. Some regions require a Bundle to meet local Regulations.
207
222
  # @return [TollFreeInstance] Newly created TollFreeInstance
208
- def create(phone_number: nil, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, identity_sid: :unset, address_sid: :unset)
223
+ def create(phone_number: nil, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, identity_sid: :unset, address_sid: :unset, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, bundle_sid: :unset)
209
224
  data = Twilio::Values.of({
210
225
  'PhoneNumber' => phone_number,
211
226
  'ApiVersion' => api_version,
@@ -225,6 +240,11 @@ module Twilio
225
240
  'VoiceUrl' => voice_url,
226
241
  'IdentitySid' => identity_sid,
227
242
  'AddressSid' => address_sid,
243
+ 'EmergencyStatus' => emergency_status,
244
+ 'EmergencyAddressSid' => emergency_address_sid,
245
+ 'TrunkSid' => trunk_sid,
246
+ 'VoiceReceiveMode' => voice_receive_mode,
247
+ 'BundleSid' => bundle_sid,
228
248
  })
229
249
 
230
250
  payload = @version.create(
@@ -314,6 +334,9 @@ module Twilio
314
334
  'voice_fallback_url' => payload['voice_fallback_url'],
315
335
  'voice_method' => payload['voice_method'],
316
336
  'voice_url' => payload['voice_url'],
337
+ 'emergency_status' => payload['emergency_status'],
338
+ 'emergency_address_sid' => payload['emergency_address_sid'],
339
+ 'bundle_sid' => payload['bundle_sid'],
317
340
  }
318
341
  end
319
342
 
@@ -485,6 +508,24 @@ module Twilio
485
508
  @properties['voice_url']
486
509
  end
487
510
 
511
+ ##
512
+ # @return [toll_free.EmergencyStatus] Whether the phone number is enabled for emergency calling
513
+ def emergency_status
514
+ @properties['emergency_status']
515
+ end
516
+
517
+ ##
518
+ # @return [String] The emergency address configuration to use for emergency calling
519
+ def emergency_address_sid
520
+ @properties['emergency_address_sid']
521
+ end
522
+
523
+ ##
524
+ # @return [String] The SID of the Bundle resource associated with number
525
+ def bundle_sid
526
+ @properties['bundle_sid']
527
+ end
528
+
488
529
  ##
489
530
  # Provide a user friendly representation
490
531
  def to_s
@@ -210,9 +210,20 @@ module Twilio
210
210
  # Update the UserChannelInstance
211
211
  # @param [user_channel.NotificationLevel] notification_level The push notification
212
212
  # level to assign to the User Channel. Can be: `default` or `muted`.
213
+ # @param [String] last_consumed_message_index The index of the last
214
+ # [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the
215
+ # [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read.
216
+ # @param [Time] last_consumption_timestamp The [ISO
217
+ # 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last
218
+ # [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for
219
+ # the Member within the [Channel](https://www.twilio.com/docs/chat/channels).
213
220
  # @return [UserChannelInstance] Updated UserChannelInstance
214
- def update(notification_level: nil)
215
- data = Twilio::Values.of({'NotificationLevel' => notification_level, })
221
+ def update(notification_level: :unset, last_consumed_message_index: :unset, last_consumption_timestamp: :unset)
222
+ data = Twilio::Values.of({
223
+ 'NotificationLevel' => notification_level,
224
+ 'LastConsumedMessageIndex' => last_consumed_message_index,
225
+ 'LastConsumptionTimestamp' => Twilio.serialize_iso8601_datetime(last_consumption_timestamp),
226
+ })
216
227
 
217
228
  payload = @version.update(
218
229
  'POST',
@@ -387,9 +398,20 @@ module Twilio
387
398
  # Update the UserChannelInstance
388
399
  # @param [user_channel.NotificationLevel] notification_level The push notification
389
400
  # level to assign to the User Channel. Can be: `default` or `muted`.
401
+ # @param [String] last_consumed_message_index The index of the last
402
+ # [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the
403
+ # [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read.
404
+ # @param [Time] last_consumption_timestamp The [ISO
405
+ # 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last
406
+ # [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for
407
+ # the Member within the [Channel](https://www.twilio.com/docs/chat/channels).
390
408
  # @return [UserChannelInstance] Updated UserChannelInstance
391
- def update(notification_level: nil)
392
- context.update(notification_level: notification_level, )
409
+ def update(notification_level: :unset, last_consumed_message_index: :unset, last_consumption_timestamp: :unset)
410
+ context.update(
411
+ notification_level: notification_level,
412
+ last_consumed_message_index: last_consumed_message_index,
413
+ last_consumption_timestamp: last_consumption_timestamp,
414
+ )
393
415
  end
394
416
 
395
417
  ##
@@ -304,6 +304,7 @@ module Twilio
304
304
  'body' => payload['body'],
305
305
  'media' => payload['media'],
306
306
  'attributes' => payload['attributes'],
307
+ 'participant_sid' => payload['participant_sid'],
307
308
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
308
309
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
309
310
  'url' => payload['url'],
@@ -373,6 +374,12 @@ module Twilio
373
374
  @properties['attributes']
374
375
  end
375
376
 
377
+ ##
378
+ # @return [String] The unique id of messages's author participant.
379
+ def participant_sid
380
+ @properties['participant_sid']
381
+ end
382
+
376
383
  ##
377
384
  # @return [Time] The date that this resource was created.
378
385
  def date_created
@@ -172,8 +172,6 @@ module Twilio
172
172
  'group' => payload['group'],
173
173
  'level' => payload['level'],
174
174
  'name' => payload['name'],
175
- 'client' => payload['client'],
176
- 'gateway' => payload['gateway'],
177
175
  'carrier_edge' => payload['carrier_edge'],
178
176
  'sip_edge' => payload['sip_edge'],
179
177
  'sdk_edge' => payload['sdk_edge'],
@@ -223,18 +221,6 @@ module Twilio
223
221
  @properties['name']
224
222
  end
225
223
 
226
- ##
227
- # @return [Hash] The client
228
- def client
229
- @properties['client']
230
- end
231
-
232
- ##
233
- # @return [Hash] The gateway
234
- def gateway
235
- @properties['gateway']
236
- end
237
-
238
224
  ##
239
225
  # @return [Hash] The carrier_edge
240
226
  def carrier_edge
@@ -174,8 +174,6 @@ module Twilio
174
174
  'account_sid' => payload['account_sid'],
175
175
  'edge' => payload['edge'],
176
176
  'direction' => payload['direction'],
177
- 'gateway' => payload['gateway'],
178
- 'client' => payload['client'],
179
177
  'carrier_edge' => payload['carrier_edge'],
180
178
  'sip_edge' => payload['sip_edge'],
181
179
  'sdk_edge' => payload['sdk_edge'],
@@ -213,18 +211,6 @@ module Twilio
213
211
  @properties['direction']
214
212
  end
215
213
 
216
- ##
217
- # @return [Hash] The gateway
218
- def gateway
219
- @properties['gateway']
220
- end
221
-
222
- ##
223
- # @return [Hash] The client
224
- def client
225
- @properties['client']
226
- end
227
-
228
214
  ##
229
215
  # @return [Hash] The carrier_edge
230
216
  def carrier_edge
@@ -210,9 +210,20 @@ module Twilio
210
210
  # Update the UserChannelInstance
211
211
  # @param [user_channel.NotificationLevel] notification_level The push notification
212
212
  # level to assign to the User Channel. Can be: `default` or `muted`.
213
+ # @param [String] last_consumed_message_index The index of the last
214
+ # [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the
215
+ # [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read.
216
+ # @param [Time] last_consumption_timestamp The [ISO
217
+ # 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last
218
+ # [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for
219
+ # the Member within the [Channel](https://www.twilio.com/docs/chat/channels).
213
220
  # @return [UserChannelInstance] Updated UserChannelInstance
214
- def update(notification_level: nil)
215
- data = Twilio::Values.of({'NotificationLevel' => notification_level, })
221
+ def update(notification_level: :unset, last_consumed_message_index: :unset, last_consumption_timestamp: :unset)
222
+ data = Twilio::Values.of({
223
+ 'NotificationLevel' => notification_level,
224
+ 'LastConsumedMessageIndex' => last_consumed_message_index,
225
+ 'LastConsumptionTimestamp' => Twilio.serialize_iso8601_datetime(last_consumption_timestamp),
226
+ })
216
227
 
217
228
  payload = @version.update(
218
229
  'POST',
@@ -387,9 +398,20 @@ module Twilio
387
398
  # Update the UserChannelInstance
388
399
  # @param [user_channel.NotificationLevel] notification_level The push notification
389
400
  # level to assign to the User Channel. Can be: `default` or `muted`.
401
+ # @param [String] last_consumed_message_index The index of the last
402
+ # [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the
403
+ # [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read.
404
+ # @param [Time] last_consumption_timestamp The [ISO
405
+ # 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last
406
+ # [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for
407
+ # the Member within the [Channel](https://www.twilio.com/docs/chat/channels).
390
408
  # @return [UserChannelInstance] Updated UserChannelInstance
391
- def update(notification_level: nil)
392
- context.update(notification_level: notification_level, )
409
+ def update(notification_level: :unset, last_consumed_message_index: :unset, last_consumption_timestamp: :unset)
410
+ context.update(
411
+ notification_level: notification_level,
412
+ last_consumed_message_index: last_consumed_message_index,
413
+ last_consumption_timestamp: last_consumption_timestamp,
414
+ )
393
415
  end
394
416
 
395
417
  ##
@@ -310,7 +310,7 @@ module Twilio
310
310
  end
311
311
 
312
312
  ##
313
- # @return [Hash] An array of values that describe whether the number can receive calls or messages
313
+ # @return [String] An array of values that describe whether the number can receive calls or messages
314
314
  def capabilities
315
315
  @properties['capabilities']
316
316
  end
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.30.0'
2
+ VERSION = '5.31.0'
3
3
  end
@@ -66,7 +66,10 @@ describe 'Local' do
66
66
  "voice_fallback_method": "POST",
67
67
  "voice_fallback_url": null,
68
68
  "voice_method": "POST",
69
- "voice_url": null
69
+ "voice_url": null,
70
+ "emergency_status": "Active",
71
+ "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
72
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
70
73
  }
71
74
  ],
72
75
  "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=2",
@@ -171,7 +174,10 @@ describe 'Local' do
171
174
  "voice_fallback_method": "POST",
172
175
  "voice_fallback_url": null,
173
176
  "voice_method": "POST",
174
- "voice_url": null
177
+ "voice_url": null,
178
+ "emergency_status": "Active",
179
+ "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
180
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
175
181
  }
176
182
  ]
177
183
  ))
@@ -66,7 +66,10 @@ describe 'Mobile' do
66
66
  "voice_fallback_method": "POST",
67
67
  "voice_fallback_url": null,
68
68
  "voice_method": "POST",
69
- "voice_url": null
69
+ "voice_url": null,
70
+ "emergency_status": "Active",
71
+ "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
72
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
70
73
  }
71
74
  ],
72
75
  "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50",
@@ -171,7 +174,10 @@ describe 'Mobile' do
171
174
  "voice_fallback_method": "POST",
172
175
  "voice_fallback_url": null,
173
176
  "voice_method": "POST",
174
- "voice_url": null
177
+ "voice_url": null,
178
+ "emergency_status": "Active",
179
+ "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
180
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
175
181
  }
176
182
  ]
177
183
  ))
@@ -66,7 +66,10 @@ describe 'TollFree' do
66
66
  "voice_fallback_method": "POST",
67
67
  "voice_fallback_url": null,
68
68
  "voice_method": "POST",
69
- "voice_url": null
69
+ "voice_url": null,
70
+ "emergency_status": "Active",
71
+ "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
72
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
70
73
  }
71
74
  ],
72
75
  "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=2",
@@ -171,7 +174,10 @@ describe 'TollFree' do
171
174
  "voice_fallback_method": "POST",
172
175
  "voice_fallback_url": null,
173
176
  "voice_method": "POST",
174
- "voice_url": null
177
+ "voice_url": null,
178
+ "emergency_status": "Active",
179
+ "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
180
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
175
181
  }
176
182
  ]
177
183
  ))
@@ -63,7 +63,8 @@ describe 'IncomingPhoneNumber' do
63
63
  "voice_fallback_method": "POST",
64
64
  "voice_fallback_url": null,
65
65
  "voice_method": "POST",
66
- "voice_url": null
66
+ "voice_url": null,
67
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
67
68
  }
68
69
  ]
69
70
  ))
@@ -128,7 +129,8 @@ describe 'IncomingPhoneNumber' do
128
129
  "voice_fallback_method": "POST",
129
130
  "voice_fallback_url": null,
130
131
  "voice_method": "POST",
131
- "voice_url": null
132
+ "voice_url": null,
133
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
132
134
  }
133
135
  ]
134
136
  ))
@@ -225,7 +227,8 @@ describe 'IncomingPhoneNumber' do
225
227
  "voice_fallback_method": "POST",
226
228
  "voice_fallback_url": null,
227
229
  "voice_method": "POST",
228
- "voice_url": null
230
+ "voice_url": null,
231
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
229
232
  }
230
233
  ],
231
234
  "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=2",
@@ -328,7 +331,8 @@ describe 'IncomingPhoneNumber' do
328
331
  "voice_fallback_method": "POST",
329
332
  "voice_fallback_url": null,
330
333
  "voice_method": "POST",
331
- "voice_url": null
334
+ "voice_url": null,
335
+ "bundle_sid": "BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
332
336
  }
333
337
  ]
334
338
  ))
@@ -178,19 +178,18 @@ describe 'UserChannel' do
178
178
  expect {
179
179
  @client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
180
180
  .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
181
- .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(notification_level: 'default')
181
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
182
182
  }.to raise_exception(Twilio::REST::TwilioError)
183
183
 
184
- values = {'NotificationLevel' => 'default', }
184
+ values = {}
185
185
  expect(
186
186
  @holodeck.has_request?(Holodeck::Request.new(
187
187
  method: 'post',
188
188
  url: 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
189
- data: values,
190
189
  ))).to eq(true)
191
190
  end
192
191
 
193
- it "receives update responses" do
192
+ it "receives update_notification_level responses" do
194
193
  @holodeck.mock(Twilio::Response.new(
195
194
  200,
196
195
  %q[
@@ -215,7 +214,37 @@ describe 'UserChannel' do
215
214
 
216
215
  actual = @client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
217
216
  .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
218
- .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(notification_level: 'default')
217
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
218
+
219
+ expect(actual).to_not eq(nil)
220
+ end
221
+
222
+ it "receives update_last_consumed_message_index responses" do
223
+ @holodeck.mock(Twilio::Response.new(
224
+ 200,
225
+ %q[
226
+ {
227
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
228
+ "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
229
+ "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
230
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
231
+ "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
232
+ "status": "joined",
233
+ "last_consumed_message_index": 10,
234
+ "unread_messages_count": 5,
235
+ "notification_level": "muted",
236
+ "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
237
+ "links": {
238
+ "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
239
+ "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
240
+ }
241
+ }
242
+ ]
243
+ ))
244
+
245
+ actual = @client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
246
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
247
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
219
248
 
220
249
  expect(actual).to_not eq(nil)
221
250
  end
@@ -36,6 +36,7 @@ describe 'Message' do
36
36
  "body": "Hello",
37
37
  "media": null,
38
38
  "author": "message author",
39
+ "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39
40
  "attributes": "{ \\"importance\\": \\"high\\" }",
40
41
  "date_created": "2015-12-16T22:18:37Z",
41
42
  "date_updated": "2015-12-16T22:18:38Z",
@@ -69,6 +70,7 @@ describe 'Message' do
69
70
  }
70
71
  ],
71
72
  "author": "message author",
73
+ "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
72
74
  "attributes": "{ \\"importance\\": \\"high\\" }",
73
75
  "date_created": "2015-12-16T22:18:37Z",
74
76
  "date_updated": "2015-12-16T22:18:38Z",
@@ -111,6 +113,7 @@ describe 'Message' do
111
113
  "body": "Hello",
112
114
  "media": null,
113
115
  "author": "message author",
116
+ "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
114
117
  "attributes": "{ \\"importance\\": \\"high\\" }",
115
118
  "date_created": "2015-12-16T22:18:37Z",
116
119
  "date_updated": "2015-12-16T22:18:38Z",
@@ -181,6 +184,7 @@ describe 'Message' do
181
184
  "body": "Welcome!",
182
185
  "media": null,
183
186
  "author": "system",
187
+ "participant_sid": null,
184
188
  "attributes": "{ \\"importance\\": \\"high\\" }",
185
189
  "date_created": "2016-03-24T20:37:57Z",
186
190
  "date_updated": "2016-03-24T20:37:57Z",
@@ -234,6 +238,7 @@ describe 'Message' do
234
238
  "body": "I like pie.",
235
239
  "media": null,
236
240
  "author": "pie_preferrer",
241
+ "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
237
242
  "attributes": "{ \\"importance\\": \\"high\\" }",
238
243
  "date_created": "2016-03-24T20:37:57Z",
239
244
  "date_updated": "2016-03-24T20:37:57Z",
@@ -247,6 +252,7 @@ describe 'Message' do
247
252
  "body": "Cake is my favorite!",
248
253
  "media": null,
249
254
  "author": "cake_lover",
255
+ "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
250
256
  "attributes": "{ \\"importance\\": \\"high\\" }",
251
257
  "date_created": "2016-03-24T20:38:21Z",
252
258
  "date_updated": "2016-03-24T20:38:21Z",
@@ -267,6 +273,7 @@ describe 'Message' do
267
273
  }
268
274
  ],
269
275
  "author": "cake_lover",
276
+ "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
270
277
  "attributes": "{ \\"importance\\": \\"high\\" }",
271
278
  "date_created": "2016-03-24T20:38:21Z",
272
279
  "date_updated": "2016-03-24T20:38:21Z",
@@ -82,9 +82,7 @@ describe 'Event' do
82
82
  },
83
83
  "client_edge": null,
84
84
  "carrier_edge": null,
85
- "sip_edge": null,
86
- "gateway": null,
87
- "client": null
85
+ "sip_edge": null
88
86
  }
89
87
  ]
90
88
  }
@@ -154,9 +152,7 @@ describe 'Event' do
154
152
  },
155
153
  "client_edge": null,
156
154
  "carrier_edge": null,
157
- "sip_edge": null,
158
- "gateway": null,
159
- "client": null
155
+ "sip_edge": null
160
156
  }
161
157
  ]
162
158
  }
@@ -76,9 +76,7 @@ describe 'Metric' do
76
76
  },
77
77
  "client_edge": null,
78
78
  "carrier_edge": null,
79
- "sip_edge": null,
80
- "gateway": null,
81
- "client": null
79
+ "sip_edge": null
82
80
  }
83
81
  ]
84
82
  }
@@ -142,9 +140,7 @@ describe 'Metric' do
142
140
  },
143
141
  "client_edge": null,
144
142
  "carrier_edge": null,
145
- "sip_edge": null,
146
- "gateway": null,
147
- "client": null
143
+ "sip_edge": null
148
144
  }
149
145
  ]
150
146
  }
@@ -178,19 +178,18 @@ describe 'UserChannel' do
178
178
  expect {
179
179
  @client.ip_messaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
180
180
  .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
181
- .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(notification_level: 'default')
181
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
182
182
  }.to raise_exception(Twilio::REST::TwilioError)
183
183
 
184
- values = {'NotificationLevel' => 'default', }
184
+ values = {}
185
185
  expect(
186
186
  @holodeck.has_request?(Holodeck::Request.new(
187
187
  method: 'post',
188
188
  url: 'https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
189
- data: values,
190
189
  ))).to eq(true)
191
190
  end
192
191
 
193
- it "receives update responses" do
192
+ it "receives update_notification_level responses" do
194
193
  @holodeck.mock(Twilio::Response.new(
195
194
  200,
196
195
  %q[
@@ -215,7 +214,37 @@ describe 'UserChannel' do
215
214
 
216
215
  actual = @client.ip_messaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
217
216
  .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
218
- .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(notification_level: 'default')
217
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
218
+
219
+ expect(actual).to_not eq(nil)
220
+ end
221
+
222
+ it "receives update_last_consumed_message_index responses" do
223
+ @holodeck.mock(Twilio::Response.new(
224
+ 200,
225
+ %q[
226
+ {
227
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
228
+ "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
229
+ "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
230
+ "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
231
+ "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
232
+ "status": "joined",
233
+ "last_consumed_message_index": 10,
234
+ "unread_messages_count": 5,
235
+ "notification_level": "muted",
236
+ "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
237
+ "links": {
238
+ "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
239
+ "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
240
+ }
241
+ }
242
+ ]
243
+ ))
244
+
245
+ actual = @client.ip_messaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
246
+ .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
247
+ .user_channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
219
248
 
220
249
  expect(actual).to_not eq(nil)
221
250
  end
@@ -38,7 +38,9 @@ describe 'ShortCode' do
38
38
  "date_updated": "2015-07-30T20:12:33Z",
39
39
  "short_code": "12345",
40
40
  "country_code": "US",
41
- "capabilities": [],
41
+ "capabilities": [
42
+ "SMS"
43
+ ],
42
44
  "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
43
45
  }
44
46
  ]
@@ -117,7 +119,9 @@ describe 'ShortCode' do
117
119
  "date_updated": "2015-07-30T20:12:33Z",
118
120
  "short_code": "12345",
119
121
  "country_code": "US",
120
- "capabilities": [],
122
+ "capabilities": [
123
+ "SMS"
124
+ ],
121
125
  "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
122
126
  }
123
127
  ]
@@ -159,7 +163,9 @@ describe 'ShortCode' do
159
163
  "date_updated": "2015-07-30T20:12:33Z",
160
164
  "short_code": "12345",
161
165
  "country_code": "US",
162
- "capabilities": [],
166
+ "capabilities": [
167
+ "SMS"
168
+ ],
163
169
  "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
164
170
  }
165
171
  ]
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.30.0
4
+ version: 5.31.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: 2019-12-04 00:00:00.000000000 Z
11
+ date: 2019-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt