twilio-ruby 5.1.1 → 5.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) 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/incoming_phone_number.rb +8 -2
  5. data/lib/twilio-ruby/rest/chat/v2/service.rb +13 -2
  6. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +14 -0
  7. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +13 -2
  8. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +14 -0
  9. data/lib/twilio-ruby/rest/preview.rb +16 -0
  10. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +2 -13
  11. data/lib/twilio-ruby/rest/preview/deployed_devices.rb +42 -0
  12. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +531 -0
  13. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb +428 -0
  14. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb +412 -0
  15. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb +465 -0
  16. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb +425 -0
  17. data/lib/twilio-ruby/rest/sync/v1/service.rb +7 -0
  18. data/lib/twilio-ruby/version.rb +1 -1
  19. data/spec/integration/chat/v2/service/channel/message_spec.rb +68 -0
  20. data/spec/integration/chat/v2/service_spec.rb +20 -4
  21. data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +68 -0
  22. data/spec/integration/ip_messaging/v2/service_spec.rb +20 -4
  23. data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +1 -3
  24. data/spec/integration/preview/deployed_devices/fleet/certificate_spec.rb +238 -0
  25. data/spec/integration/preview/deployed_devices/fleet/deployment_spec.rb +231 -0
  26. data/spec/integration/preview/deployed_devices/fleet/device_spec.rb +247 -0
  27. data/spec/integration/preview/deployed_devices/fleet/key_spec.rb +235 -0
  28. data/spec/integration/preview/deployed_devices/fleet_spec.rb +244 -0
  29. data/spec/integration/sync/v1/service_spec.rb +4 -0
  30. metadata +19 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 399f522ccd4b51d8383070a32079b1414e9b18df
4
- data.tar.gz: aea3e095d94d500c80fdaf3c2c7f9d7cda910619
3
+ metadata.gz: 73e7d7451244594c21a6404c68f9024929afd5de
4
+ data.tar.gz: e0e6a02ddc95f46c72315fd6c2e31c3dd1439476
5
5
  SHA512:
6
- metadata.gz: 1d09bebe465830e3d8bc71fa4f647885ea27814cd22a6b8a7b7522f0fc774102d6c37e4e44e012b777279700b5433dd48e36ff5fa097dfd558259d2f2abbb05f
7
- data.tar.gz: 4b2ac197c38fda839f8836931a6986a80687a9212e75d6a74f875c20fbcc7509ff9e06ff424b08e44a7507e61b92791d30114e278e3066da8cee0c8b3f028082
6
+ metadata.gz: 85f17716b4e55821f781fdc6f93e66ef838c93586a324e4076ac9251e1901bd3b011f74569352a23e641ce592c837515bd31085802909e3af2389a74a40cd57a
7
+ data.tar.gz: ddd9aa3be92c33d625959411180fe6e0dcd51a3ab2c2588da2c4d0b93ccd6c9ec0cdae799cd80252814062c688b0ed3be8927fead0af66def75a93e6fd0fb8cf
data/CHANGES.md CHANGED
@@ -1,6 +1,23 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2017-08-18] Version 5.1.2
5
+ ---------------------------
6
+ **Api**
7
+ - Add VoiceReceiveMode {'voice', 'fax'} option to IncomingPhoneNumber UPDATE requests
8
+
9
+ **Chat**
10
+ - Add channel message media information
11
+ - Add service instance message media information
12
+
13
+ **Preview**
14
+ - Removed 'email' from bulk_exports configuration api [bi]. No migration plan needed because api has not been used yet.
15
+ - Add DeployedDevices.
16
+
17
+ **Sync**
18
+ - Add support for Service Instance unique names
19
+
20
+
4
21
  [2017-08-10] Version 5.1.1
5
22
  ---------------------------
6
23
  **Library**
data/README.md CHANGED
@@ -27,13 +27,13 @@ in-line code documentation here in the library.
27
27
  To install using [Bundler][bundler] grab the latest stable version:
28
28
 
29
29
  ```ruby
30
- gem 'twilio-ruby', '~> 5.1.1'
30
+ gem 'twilio-ruby', '~> 5.1.2'
31
31
  ```
32
32
 
33
33
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
34
34
 
35
35
  ```bash
36
- gem install twilio-ruby -v 5.1.1
36
+ gem install twilio-ruby -v 5.1.2
37
37
  ```
38
38
 
39
39
  To build and install the development branch yourself from the latest source:
@@ -382,8 +382,10 @@ module Twilio
382
382
  # ignore all of the voice urls and voice applications above and use those set on
383
383
  # the Trunk. Setting a `TrunkSid` will automatically delete your
384
384
  # `VoiceApplicationSid` and vice versa.
385
+ # @param [incoming_phone_number.VoiceReceiveMode] voice_receive_mode The
386
+ # voice_receive_mode
385
387
  # @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
386
- def update(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)
388
+ def update(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)
387
389
  data = Twilio::Values.of({
388
390
  'ApiVersion' => api_version,
389
391
  'FriendlyName' => friendly_name,
@@ -403,6 +405,7 @@ module Twilio
403
405
  'EmergencyStatus' => emergency_status,
404
406
  'EmergencyAddressSid' => emergency_address_sid,
405
407
  'TrunkSid' => trunk_sid,
408
+ 'VoiceReceiveMode' => voice_receive_mode,
406
409
  })
407
410
 
408
411
  payload = @version.update(
@@ -764,8 +767,10 @@ module Twilio
764
767
  # ignore all of the voice urls and voice applications above and use those set on
765
768
  # the Trunk. Setting a `TrunkSid` will automatically delete your
766
769
  # `VoiceApplicationSid` and vice versa.
770
+ # @param [incoming_phone_number.VoiceReceiveMode] voice_receive_mode The
771
+ # voice_receive_mode
767
772
  # @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
768
- def update(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)
773
+ def update(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)
769
774
  context.update(
770
775
  api_version: api_version,
771
776
  friendly_name: friendly_name,
@@ -785,6 +790,7 @@ module Twilio
785
790
  emergency_status: emergency_status,
786
791
  emergency_address_sid: emergency_address_sid,
787
792
  trunk_sid: trunk_sid,
793
+ voice_receive_mode: voice_receive_mode,
788
794
  )
789
795
  end
790
796
 
@@ -261,8 +261,9 @@ module Twilio
261
261
  # @param [String] webhook_filters The webhook_filters
262
262
  # @param [String] limits_channel_members The limits.channel_members
263
263
  # @param [String] limits_user_channels The limits.user_channels
264
+ # @param [String] media_compatibility_message The media.compatibility_message
264
265
  # @return [ServiceInstance] Updated ServiceInstance
265
- def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset)
266
+ def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset, media_compatibility_message: :unset)
266
267
  data = Twilio::Values.of({
267
268
  'FriendlyName' => friendly_name,
268
269
  'DefaultServiceRoleSid' => default_service_role_sid,
@@ -291,6 +292,7 @@ module Twilio
291
292
  'WebhookFilters' => webhook_filters,
292
293
  'Limits.ChannelMembers' => limits_channel_members,
293
294
  'Limits.UserChannels' => limits_user_channels,
295
+ 'Media.CompatibilityMessage' => media_compatibility_message,
294
296
  })
295
297
 
296
298
  payload = @version.update(
@@ -419,6 +421,7 @@ module Twilio
419
421
  'webhook_method' => payload['webhook_method'],
420
422
  'webhook_filters' => payload['webhook_filters'],
421
423
  'notifications' => payload['notifications'],
424
+ 'media' => payload['media'],
422
425
  'url' => payload['url'],
423
426
  'links' => payload['links'],
424
427
  }
@@ -552,6 +555,12 @@ module Twilio
552
555
  @properties['notifications']
553
556
  end
554
557
 
558
+ ##
559
+ # @return [Hash] The media
560
+ def media
561
+ @properties['media']
562
+ end
563
+
555
564
  ##
556
565
  # @return [String] The url
557
566
  def url
@@ -621,8 +630,9 @@ module Twilio
621
630
  # @param [String] webhook_filters The webhook_filters
622
631
  # @param [String] limits_channel_members The limits.channel_members
623
632
  # @param [String] limits_user_channels The limits.user_channels
633
+ # @param [String] media_compatibility_message The media.compatibility_message
624
634
  # @return [ServiceInstance] Updated ServiceInstance
625
- def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset)
635
+ def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset, media_compatibility_message: :unset)
626
636
  context.update(
627
637
  friendly_name: friendly_name,
628
638
  default_service_role_sid: default_service_role_sid,
@@ -651,6 +661,7 @@ module Twilio
651
661
  webhook_filters: webhook_filters,
652
662
  limits_channel_members: limits_channel_members,
653
663
  limits_user_channels: limits_user_channels,
664
+ media_compatibility_message: media_compatibility_message,
654
665
  )
655
666
  end
656
667
 
@@ -300,6 +300,8 @@ module Twilio
300
300
  'from' => payload['from'],
301
301
  'body' => payload['body'],
302
302
  'index' => payload['index'].to_i,
303
+ 'type' => payload['type'],
304
+ 'media' => payload['media'],
303
305
  'url' => payload['url'],
304
306
  }
305
307
 
@@ -400,6 +402,18 @@ module Twilio
400
402
  @properties['index']
401
403
  end
402
404
 
405
+ ##
406
+ # @return [String] The type
407
+ def type
408
+ @properties['type']
409
+ end
410
+
411
+ ##
412
+ # @return [Hash] The media
413
+ def media
414
+ @properties['media']
415
+ end
416
+
403
417
  ##
404
418
  # @return [String] The url
405
419
  def url
@@ -261,8 +261,9 @@ module Twilio
261
261
  # @param [String] webhook_filters The webhook_filters
262
262
  # @param [String] limits_channel_members The limits.channel_members
263
263
  # @param [String] limits_user_channels The limits.user_channels
264
+ # @param [String] media_compatibility_message The media.compatibility_message
264
265
  # @return [ServiceInstance] Updated ServiceInstance
265
- def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset)
266
+ def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset, media_compatibility_message: :unset)
266
267
  data = Twilio::Values.of({
267
268
  'FriendlyName' => friendly_name,
268
269
  'DefaultServiceRoleSid' => default_service_role_sid,
@@ -291,6 +292,7 @@ module Twilio
291
292
  'WebhookFilters' => webhook_filters,
292
293
  'Limits.ChannelMembers' => limits_channel_members,
293
294
  'Limits.UserChannels' => limits_user_channels,
295
+ 'Media.CompatibilityMessage' => media_compatibility_message,
294
296
  })
295
297
 
296
298
  payload = @version.update(
@@ -419,6 +421,7 @@ module Twilio
419
421
  'webhook_method' => payload['webhook_method'],
420
422
  'webhook_filters' => payload['webhook_filters'],
421
423
  'notifications' => payload['notifications'],
424
+ 'media' => payload['media'],
422
425
  'url' => payload['url'],
423
426
  'links' => payload['links'],
424
427
  }
@@ -552,6 +555,12 @@ module Twilio
552
555
  @properties['notifications']
553
556
  end
554
557
 
558
+ ##
559
+ # @return [Hash] The media
560
+ def media
561
+ @properties['media']
562
+ end
563
+
555
564
  ##
556
565
  # @return [String] The url
557
566
  def url
@@ -621,8 +630,9 @@ module Twilio
621
630
  # @param [String] webhook_filters The webhook_filters
622
631
  # @param [String] limits_channel_members The limits.channel_members
623
632
  # @param [String] limits_user_channels The limits.user_channels
633
+ # @param [String] media_compatibility_message The media.compatibility_message
624
634
  # @return [ServiceInstance] Updated ServiceInstance
625
- def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset)
635
+ def update(friendly_name: :unset, default_service_role_sid: :unset, default_channel_role_sid: :unset, default_channel_creator_role_sid: :unset, read_status_enabled: :unset, reachability_enabled: :unset, typing_indicator_timeout: :unset, consumption_report_interval: :unset, notifications_new_message_enabled: :unset, notifications_new_message_template: :unset, notifications_new_message_sound: :unset, notifications_new_message_badge_count_enabled: :unset, notifications_added_to_channel_enabled: :unset, notifications_added_to_channel_template: :unset, notifications_added_to_channel_sound: :unset, notifications_removed_from_channel_enabled: :unset, notifications_removed_from_channel_template: :unset, notifications_removed_from_channel_sound: :unset, notifications_invited_to_channel_enabled: :unset, notifications_invited_to_channel_template: :unset, notifications_invited_to_channel_sound: :unset, pre_webhook_url: :unset, post_webhook_url: :unset, webhook_method: :unset, webhook_filters: :unset, limits_channel_members: :unset, limits_user_channels: :unset, media_compatibility_message: :unset)
626
636
  context.update(
627
637
  friendly_name: friendly_name,
628
638
  default_service_role_sid: default_service_role_sid,
@@ -651,6 +661,7 @@ module Twilio
651
661
  webhook_filters: webhook_filters,
652
662
  limits_channel_members: limits_channel_members,
653
663
  limits_user_channels: limits_user_channels,
664
+ media_compatibility_message: media_compatibility_message,
654
665
  )
655
666
  end
656
667
 
@@ -300,6 +300,8 @@ module Twilio
300
300
  'from' => payload['from'],
301
301
  'body' => payload['body'],
302
302
  'index' => payload['index'].to_i,
303
+ 'type' => payload['type'],
304
+ 'media' => payload['media'],
303
305
  'url' => payload['url'],
304
306
  }
305
307
 
@@ -400,6 +402,18 @@ module Twilio
400
402
  @properties['index']
401
403
  end
402
404
 
405
+ ##
406
+ # @return [String] The type
407
+ def type
408
+ @properties['type']
409
+ end
410
+
411
+ ##
412
+ # @return [Hash] The media
413
+ def media
414
+ @properties['media']
415
+ end
416
+
403
417
  ##
404
418
  # @return [String] The url
405
419
  def url
@@ -19,6 +19,7 @@ module Twilio
19
19
  # Versions
20
20
  @sync = nil
21
21
  @wireless = nil
22
+ @deployed_devices = nil
22
23
  @marketplace = nil
23
24
  @bulk_exports = nil
24
25
  @proxy = nil
@@ -37,6 +38,12 @@ module Twilio
37
38
  @wireless ||= Wireless.new self
38
39
  end
39
40
 
41
+ ##
42
+ # Version deployed_devices of preview
43
+ def deployed_devices
44
+ @deployed_devices ||= DeployedDevices.new self
45
+ end
46
+
40
47
  ##
41
48
  # Version marketplace of preview
42
49
  def marketplace
@@ -93,6 +100,15 @@ module Twilio
93
100
  self.wireless.sims(sid)
94
101
  end
95
102
 
103
+ ##
104
+ # @param [String] sid Contains a 34 character string that uniquely identifies this
105
+ # Fleet resource.
106
+ # @return [Twilio::REST::Preview::DeployedDevices::FleetInstance] if sid was passed.
107
+ # @return [Twilio::REST::Preview::DeployedDevices::FleetList]
108
+ def fleets(sid=:unset)
109
+ self.deployed_devices.fleets(sid)
110
+ end
111
+
96
112
  ##
97
113
  # @param [String] sid A 34 character string that uniquely identifies this Add-on.
98
114
  # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnInstance] if sid was passed.
@@ -105,14 +105,12 @@ module Twilio
105
105
  # @param [Boolean] enabled The enabled
106
106
  # @param [String] webhook_url The webhook_url
107
107
  # @param [String] webhook_method The webhook_method
108
- # @param [String] email The email
109
108
  # @return [ExportConfigurationInstance] Updated ExportConfigurationInstance
110
- def update(enabled: :unset, webhook_url: :unset, webhook_method: :unset, email: :unset)
109
+ def update(enabled: :unset, webhook_url: :unset, webhook_method: :unset)
111
110
  data = Twilio::Values.of({
112
111
  'Enabled' => enabled,
113
112
  'WebhookUrl' => webhook_url,
114
113
  'WebhookMethod' => webhook_method,
115
- 'Email' => email,
116
114
  })
117
115
 
118
116
  payload = @version.update(
@@ -153,7 +151,6 @@ module Twilio
153
151
  'enabled' => payload['enabled'],
154
152
  'webhook_url' => payload['webhook_url'],
155
153
  'webhook_method' => payload['webhook_method'],
156
- 'email' => payload['email'],
157
154
  'resource_type' => payload['resource_type'],
158
155
  'url' => payload['url'],
159
156
  }
@@ -197,12 +194,6 @@ module Twilio
197
194
  @properties['webhook_method']
198
195
  end
199
196
 
200
- ##
201
- # @return [String] The email
202
- def email
203
- @properties['email']
204
- end
205
-
206
197
  ##
207
198
  # @return [String] The resource_type
208
199
  def resource_type
@@ -227,14 +218,12 @@ module Twilio
227
218
  # @param [Boolean] enabled The enabled
228
219
  # @param [String] webhook_url The webhook_url
229
220
  # @param [String] webhook_method The webhook_method
230
- # @param [String] email The email
231
221
  # @return [ExportConfigurationInstance] Updated ExportConfigurationInstance
232
- def update(enabled: :unset, webhook_url: :unset, webhook_method: :unset, email: :unset)
222
+ def update(enabled: :unset, webhook_url: :unset, webhook_method: :unset)
233
223
  context.update(
234
224
  enabled: enabled,
235
225
  webhook_url: webhook_url,
236
226
  webhook_method: webhook_method,
237
- email: email,
238
227
  )
239
228
  end
240
229
 
@@ -0,0 +1,42 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview
10
+ class DeployedDevices < Version
11
+ ##
12
+ # Initialize the DeployedDevices version of Preview
13
+ def initialize(domain)
14
+ super
15
+ @version = 'DeployedDevices'
16
+ @fleets = nil
17
+ end
18
+
19
+ ##
20
+ # @param [String] sid Provides a 34 character string that uniquely identifies the
21
+ # requested Fleet resource.
22
+ # @return [Twilio::REST::Preview::DeployedDevices::FleetInstance] if sid was passed.
23
+ # @return [Twilio::REST::Preview::DeployedDevices::FleetList]
24
+ def fleets(sid=:unset)
25
+ if sid.nil?
26
+ raise ArgumentError, 'sid cannot be nil'
27
+ elsif sid == :unset
28
+ @fleets ||= FleetList.new self
29
+ else
30
+ FleetContext.new(self, sid)
31
+ end
32
+ end
33
+
34
+ ##
35
+ # Provide a user friendly representation
36
+ def to_s
37
+ '<Twilio::REST::Preview::DeployedDevices>'
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,531 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview < Domain
10
+ class DeployedDevices < Version
11
+ ##
12
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
13
+ class FleetList < ListResource
14
+ ##
15
+ # Initialize the FleetList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [FleetList] FleetList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Fleets"
24
+ end
25
+
26
+ ##
27
+ # Retrieve a single page of FleetInstance records from the API.
28
+ # Request is executed immediately.
29
+ # @param [String] friendly_name Provides a human readable descriptive text for
30
+ # this Fleet, up to 256 characters long.
31
+ # @return [FleetInstance] Newly created FleetInstance
32
+ def create(friendly_name: :unset)
33
+ data = Twilio::Values.of({
34
+ 'FriendlyName' => friendly_name,
35
+ })
36
+
37
+ payload = @version.create(
38
+ 'POST',
39
+ @uri,
40
+ data: data
41
+ )
42
+
43
+ FleetInstance.new(
44
+ @version,
45
+ payload,
46
+ )
47
+ end
48
+
49
+ ##
50
+ # Lists FleetInstance records from the API as a list.
51
+ # Unlike stream(), this operation is eager and will load `limit` records into
52
+ # memory before returning.
53
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
54
+ # guarantees to never return more than limit. Default is no limit
55
+ # @param [Integer] page_size Number of records to fetch per request, when
56
+ # not set will use the default value of 50 records. If no page_size is defined
57
+ # but a limit is defined, stream() will attempt to read the limit with the most
58
+ # efficient page size, i.e. min(limit, 1000)
59
+ # @return [Array] Array of up to limit results
60
+ def list(limit: nil, page_size: nil)
61
+ self.stream(
62
+ limit: limit,
63
+ page_size: page_size
64
+ ).entries
65
+ end
66
+
67
+ ##
68
+ # Streams FleetInstance records from the API as an Enumerable.
69
+ # This operation lazily loads records as efficiently as possible until the limit
70
+ # is reached.
71
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
72
+ # guarantees to never return more than limit. Default is no limit.
73
+ # @param [Integer] page_size Number of records to fetch per request, when
74
+ # not set will use the default value of 50 records. If no page_size is defined
75
+ # but a limit is defined, stream() will attempt to read the limit with the most
76
+ # efficient page size, i.e. min(limit, 1000)
77
+ # @return [Enumerable] Enumerable that will yield up to limit results
78
+ def stream(limit: nil, page_size: nil)
79
+ limits = @version.read_limits(limit, page_size)
80
+
81
+ page = self.page(
82
+ page_size: limits[:page_size],
83
+ )
84
+
85
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
86
+ end
87
+
88
+ ##
89
+ # When passed a block, yields FleetInstance records from the API.
90
+ # This operation lazily loads records as efficiently as possible until the limit
91
+ # is reached.
92
+ def each
93
+ limits = @version.read_limits
94
+
95
+ page = self.page(
96
+ page_size: limits[:page_size],
97
+ )
98
+
99
+ @version.stream(page,
100
+ limit: limits[:limit],
101
+ page_limit: limits[:page_limit]).each {|x| yield x}
102
+ end
103
+
104
+ ##
105
+ # Retrieve a single page of FleetInstance records from the API.
106
+ # Request is executed immediately.
107
+ # @param [String] page_token PageToken provided by the API
108
+ # @param [Integer] page_number Page Number, this value is simply for client state
109
+ # @param [Integer] page_size Number of records to return, defaults to 50
110
+ # @return [Page] Page of FleetInstance
111
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
112
+ params = Twilio::Values.of({
113
+ 'PageToken' => page_token,
114
+ 'Page' => page_number,
115
+ 'PageSize' => page_size,
116
+ })
117
+ response = @version.page(
118
+ 'GET',
119
+ @uri,
120
+ params
121
+ )
122
+ FleetPage.new(@version, response, @solution)
123
+ end
124
+
125
+ ##
126
+ # Retrieve a single page of FleetInstance records from the API.
127
+ # Request is executed immediately.
128
+ # @param [String] target_url API-generated URL for the requested results page
129
+ # @return [Page] Page of FleetInstance
130
+ def get_page(target_url)
131
+ response = @version.domain.request(
132
+ 'GET',
133
+ target_url
134
+ )
135
+ FleetPage.new(@version, response, @solution)
136
+ end
137
+
138
+ ##
139
+ # Provide a user friendly representation
140
+ def to_s
141
+ '#<Twilio.Preview.DeployedDevices.FleetList>'
142
+ end
143
+ end
144
+
145
+ ##
146
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
147
+ class FleetPage < Page
148
+ ##
149
+ # Initialize the FleetPage
150
+ # @param [Version] version Version that contains the resource
151
+ # @param [Response] response Response from the API
152
+ # @param [Hash] solution Path solution for the resource
153
+ # @return [FleetPage] FleetPage
154
+ def initialize(version, response, solution)
155
+ super(version, response)
156
+
157
+ # Path Solution
158
+ @solution = solution
159
+ end
160
+
161
+ ##
162
+ # Build an instance of FleetInstance
163
+ # @param [Hash] payload Payload response from the API
164
+ # @return [FleetInstance] FleetInstance
165
+ def get_instance(payload)
166
+ FleetInstance.new(
167
+ @version,
168
+ payload,
169
+ )
170
+ end
171
+
172
+ ##
173
+ # Provide a user friendly representation
174
+ def to_s
175
+ '<Twilio.Preview.DeployedDevices.FleetPage>'
176
+ end
177
+ end
178
+
179
+ ##
180
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
181
+ class FleetContext < InstanceContext
182
+ ##
183
+ # Initialize the FleetContext
184
+ # @param [Version] version Version that contains the resource
185
+ # @param [String] sid Provides a 34 character string that uniquely identifies the
186
+ # requested Fleet resource.
187
+ # @return [FleetContext] FleetContext
188
+ def initialize(version, sid)
189
+ super(version)
190
+
191
+ # Path Solution
192
+ @solution = {
193
+ sid: sid,
194
+ }
195
+ @uri = "/Fleets/#{@solution[:sid]}"
196
+
197
+ # Dependents
198
+ @devices = nil
199
+ @deployments = nil
200
+ @certificates = nil
201
+ @keys = nil
202
+ end
203
+
204
+ ##
205
+ # Fetch a FleetInstance
206
+ # @return [FleetInstance] Fetched FleetInstance
207
+ def fetch
208
+ params = Twilio::Values.of({})
209
+
210
+ payload = @version.fetch(
211
+ 'GET',
212
+ @uri,
213
+ params,
214
+ )
215
+
216
+ FleetInstance.new(
217
+ @version,
218
+ payload,
219
+ sid: @solution[:sid],
220
+ )
221
+ end
222
+
223
+ ##
224
+ # Deletes the FleetInstance
225
+ # @return [Boolean] true if delete succeeds, true otherwise
226
+ def delete
227
+ @version.delete('delete', @uri)
228
+ end
229
+
230
+ ##
231
+ # Update the FleetInstance
232
+ # @param [String] friendly_name Provides a human readable descriptive text for
233
+ # this Fleet, up to 256 characters long.
234
+ # @param [String] default_deployment_sid Provides a string identifier of a
235
+ # Deployment that is going to be used as a default one for this Fleet.
236
+ # @return [FleetInstance] Updated FleetInstance
237
+ def update(friendly_name: :unset, default_deployment_sid: :unset)
238
+ data = Twilio::Values.of({
239
+ 'FriendlyName' => friendly_name,
240
+ 'DefaultDeploymentSid' => default_deployment_sid,
241
+ })
242
+
243
+ payload = @version.update(
244
+ 'POST',
245
+ @uri,
246
+ data: data,
247
+ )
248
+
249
+ FleetInstance.new(
250
+ @version,
251
+ payload,
252
+ sid: @solution[:sid],
253
+ )
254
+ end
255
+
256
+ ##
257
+ # Access the devices
258
+ # @return [DeviceList]
259
+ # @return [DeviceContext] if sid was passed.
260
+ def devices(sid=:unset)
261
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
262
+
263
+ if sid != :unset
264
+ return DeviceContext.new(
265
+ @version,
266
+ @solution[:sid],
267
+ sid,
268
+ )
269
+ end
270
+
271
+ unless @devices
272
+ @devices = DeviceList.new(
273
+ @version,
274
+ fleet_sid: @solution[:sid],
275
+ )
276
+ end
277
+
278
+ @devices
279
+ end
280
+
281
+ ##
282
+ # Access the deployments
283
+ # @return [DeploymentList]
284
+ # @return [DeploymentContext] if sid was passed.
285
+ def deployments(sid=:unset)
286
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
287
+
288
+ if sid != :unset
289
+ return DeploymentContext.new(
290
+ @version,
291
+ @solution[:sid],
292
+ sid,
293
+ )
294
+ end
295
+
296
+ unless @deployments
297
+ @deployments = DeploymentList.new(
298
+ @version,
299
+ fleet_sid: @solution[:sid],
300
+ )
301
+ end
302
+
303
+ @deployments
304
+ end
305
+
306
+ ##
307
+ # Access the certificates
308
+ # @return [CertificateList]
309
+ # @return [CertificateContext] if sid was passed.
310
+ def certificates(sid=:unset)
311
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
312
+
313
+ if sid != :unset
314
+ return CertificateContext.new(
315
+ @version,
316
+ @solution[:sid],
317
+ sid,
318
+ )
319
+ end
320
+
321
+ unless @certificates
322
+ @certificates = CertificateList.new(
323
+ @version,
324
+ fleet_sid: @solution[:sid],
325
+ )
326
+ end
327
+
328
+ @certificates
329
+ end
330
+
331
+ ##
332
+ # Access the keys
333
+ # @return [KeyList]
334
+ # @return [KeyContext] if sid was passed.
335
+ def keys(sid=:unset)
336
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
337
+
338
+ if sid != :unset
339
+ return KeyContext.new(
340
+ @version,
341
+ @solution[:sid],
342
+ sid,
343
+ )
344
+ end
345
+
346
+ unless @keys
347
+ @keys = KeyList.new(
348
+ @version,
349
+ fleet_sid: @solution[:sid],
350
+ )
351
+ end
352
+
353
+ @keys
354
+ end
355
+
356
+ ##
357
+ # Provide a user friendly representation
358
+ def to_s
359
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
360
+ "#<Twilio.Preview.DeployedDevices.FleetContext #{context}>"
361
+ end
362
+ end
363
+
364
+ ##
365
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
366
+ class FleetInstance < InstanceResource
367
+ ##
368
+ # Initialize the FleetInstance
369
+ # @param [Version] version Version that contains the resource
370
+ # @param [Hash] payload payload that contains response from Twilio
371
+ # @param [String] sid Provides a 34 character string that uniquely identifies the
372
+ # requested Fleet resource.
373
+ # @return [FleetInstance] FleetInstance
374
+ def initialize(version, payload, sid: nil)
375
+ super(version)
376
+
377
+ # Marshaled Properties
378
+ @properties = {
379
+ 'sid' => payload['sid'],
380
+ 'url' => payload['url'],
381
+ 'unique_name' => payload['unique_name'],
382
+ 'friendly_name' => payload['friendly_name'],
383
+ 'account_sid' => payload['account_sid'],
384
+ 'default_deployment_sid' => payload['default_deployment_sid'],
385
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
386
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
387
+ 'links' => payload['links'],
388
+ }
389
+
390
+ # Context
391
+ @instance_context = nil
392
+ @params = {
393
+ 'sid' => sid || @properties['sid'],
394
+ }
395
+ end
396
+
397
+ ##
398
+ # Generate an instance context for the instance, the context is capable of
399
+ # performing various actions. All instance actions are proxied to the context
400
+ # @return [FleetContext] FleetContext for this FleetInstance
401
+ def context
402
+ unless @instance_context
403
+ @instance_context = FleetContext.new(
404
+ @version,
405
+ @params['sid'],
406
+ )
407
+ end
408
+ @instance_context
409
+ end
410
+
411
+ ##
412
+ # @return [String] A string that uniquely identifies this Fleet.
413
+ def sid
414
+ @properties['sid']
415
+ end
416
+
417
+ ##
418
+ # @return [String] URL of this Fleet.
419
+ def url
420
+ @properties['url']
421
+ end
422
+
423
+ ##
424
+ # @return [String] A unique, addressable name of this Fleet.
425
+ def unique_name
426
+ @properties['unique_name']
427
+ end
428
+
429
+ ##
430
+ # @return [String] A human readable description for this Fleet.
431
+ def friendly_name
432
+ @properties['friendly_name']
433
+ end
434
+
435
+ ##
436
+ # @return [String] The unique SID that identifies this Account.
437
+ def account_sid
438
+ @properties['account_sid']
439
+ end
440
+
441
+ ##
442
+ # @return [String] The unique SID that identifies this Fleet's default Deployment.
443
+ def default_deployment_sid
444
+ @properties['default_deployment_sid']
445
+ end
446
+
447
+ ##
448
+ # @return [Time] The date this Fleet was created.
449
+ def date_created
450
+ @properties['date_created']
451
+ end
452
+
453
+ ##
454
+ # @return [Time] The date this Fleet was updated.
455
+ def date_updated
456
+ @properties['date_updated']
457
+ end
458
+
459
+ ##
460
+ # @return [String] Nested resource URLs.
461
+ def links
462
+ @properties['links']
463
+ end
464
+
465
+ ##
466
+ # Fetch a FleetInstance
467
+ # @return [FleetInstance] Fetched FleetInstance
468
+ def fetch
469
+ context.fetch
470
+ end
471
+
472
+ ##
473
+ # Deletes the FleetInstance
474
+ # @return [Boolean] true if delete succeeds, true otherwise
475
+ def delete
476
+ context.delete
477
+ end
478
+
479
+ ##
480
+ # Update the FleetInstance
481
+ # @param [String] friendly_name Provides a human readable descriptive text for
482
+ # this Fleet, up to 256 characters long.
483
+ # @param [String] default_deployment_sid Provides a string identifier of a
484
+ # Deployment that is going to be used as a default one for this Fleet.
485
+ # @return [FleetInstance] Updated FleetInstance
486
+ def update(friendly_name: :unset, default_deployment_sid: :unset)
487
+ context.update(
488
+ friendly_name: friendly_name,
489
+ default_deployment_sid: default_deployment_sid,
490
+ )
491
+ end
492
+
493
+ ##
494
+ # Access the devices
495
+ # @return [devices] devices
496
+ def devices
497
+ context.devices
498
+ end
499
+
500
+ ##
501
+ # Access the deployments
502
+ # @return [deployments] deployments
503
+ def deployments
504
+ context.deployments
505
+ end
506
+
507
+ ##
508
+ # Access the certificates
509
+ # @return [certificates] certificates
510
+ def certificates
511
+ context.certificates
512
+ end
513
+
514
+ ##
515
+ # Access the keys
516
+ # @return [keys] keys
517
+ def keys
518
+ context.keys
519
+ end
520
+
521
+ ##
522
+ # Provide a user friendly representation
523
+ def to_s
524
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
525
+ "<Twilio.Preview.DeployedDevices.FleetInstance #{values}>"
526
+ end
527
+ end
528
+ end
529
+ end
530
+ end
531
+ end