twilio-ruby 5.2.3 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +26 -0
  3. data/README.md +3 -3
  4. data/UPGRADE.md +30 -0
  5. data/lib/twilio-ruby.rb +0 -18
  6. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +2 -2
  7. data/lib/twilio-ruby/rest/chat/v2/service.rb +24 -2
  8. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +5 -3
  9. data/lib/twilio-ruby/rest/client.rb +3 -3
  10. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +24 -2
  11. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +5 -3
  12. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +12 -12
  13. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -0
  14. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +40 -0
  15. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +350 -0
  16. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +264 -0
  17. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +10 -2
  18. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +15 -3
  19. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +38 -0
  20. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +6 -2
  21. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +274 -0
  22. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +213 -0
  23. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +14 -10
  24. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +40 -0
  25. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +357 -0
  26. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +243 -0
  27. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +10 -2
  28. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +339 -0
  29. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +239 -0
  30. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +10 -2
  31. data/lib/twilio-ruby/rest/video/v1/room.rb +7 -0
  32. data/lib/twilio-ruby/security/request_validator.rb +1 -1
  33. data/lib/twilio-ruby/version.rb +1 -1
  34. data/spec/integration/chat/v2/service/channel/message_spec.rb +41 -7
  35. data/spec/integration/chat/v2/service_spec.rb +8 -0
  36. data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +41 -7
  37. data/spec/integration/ip_messaging/v2/service_spec.rb +8 -0
  38. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics_spec.rb +94 -0
  39. data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics_spec.rb +79 -0
  40. data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +8 -0
  41. data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +21 -38
  42. data/spec/integration/taskrouter/v1/workspace/worker/workers_cumulative_statistics_spec.rb +87 -0
  43. data/spec/integration/taskrouter/v1/workspace/worker/workers_real_time_statistics_spec.rb +68 -0
  44. data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +34 -61
  45. data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +8 -0
  46. data/spec/integration/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics_spec.rb +95 -0
  47. data/spec/integration/taskrouter/v1/workspace/workflow/workflow_real_time_statistics_spec.rb +55 -0
  48. data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +12 -4
  49. data/spec/integration/taskrouter/v1/workspace/workspace_cumulative_statistics_spec.rb +92 -0
  50. data/spec/integration/taskrouter/v1/workspace/workspace_real_time_statistics_spec.rb +70 -0
  51. data/spec/integration/taskrouter/v1/workspace_spec.rb +8 -0
  52. data/spec/integration/video/v1/room_spec.rb +12 -0
  53. data/spec/security/request_validator_spec.rb +0 -28
  54. data/spec/twilio_spec.rb +0 -15
  55. metadata +28 -9
  56. data/lib/rack/twilio_webhook_authentication.rb +0 -46
  57. data/lib/twilio-ruby/util/configuration.rb +0 -7
  58. data/spec/rack/twilio_webhook_authentication_spec.rb +0 -106
  59. data/spec/util/configuration_spec.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d9b5316ccdb29c8d31c1e65cb9d193b17b468ab
4
- data.tar.gz: 23f357ff05acc9e3dfe144560634c607325e9d09
3
+ metadata.gz: 088b6c58d49ae8c6b5aab315bccc32e9660daaba
4
+ data.tar.gz: 9c3e344611be8f54f83c719d8c56e79a2008112f
5
5
  SHA512:
6
- metadata.gz: 1ec8e3579ab72d8e42a075e552025e0c97145eb0d13ce659167445b0f42fa66ebf0e7e9dee638c89272553b08e13cf6d4393ed9570c5c6361ea001f23f344b22
7
- data.tar.gz: 981d8ba5cd8c9e2f53ac60c2492eda489c98b796cc6ccefb30fc908a45eedc163be10a3a5c53725fc0e2765504299bc883f10040f09aacf1442ad6e278aaf34b
6
+ metadata.gz: f160ffb9e3c889ee406c611c98f8870e925bc78ea91a397911f6ba888dc5c342516cae66455237f153cdff01313096c8e54ecf60efb45d2648057b0342653a67
7
+ data.tar.gz: f3aeabd256f24bd9f60cf77dc7fa2e659446a2d5eb88f91e385613c836254afdd83efe089546c33d8fc0e4b272329d5db14e5d7f48e17a9e2703c43759af54f1
data/CHANGES.md CHANGED
@@ -1,6 +1,32 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2017-09-29] Version 5.3.0
5
+ ---------------------------
6
+ **Library**
7
+ - Remove left over files from legacy 4.x library
8
+
9
+ **Chat**
10
+ - Make member accessible through identity
11
+ - Make channel subresources accessible by channel unique name
12
+ - Set get list 'max_page_size' parameter to 100
13
+ - Add service instance webhook retry configuration
14
+ - Add media message capability
15
+ - Make `body` an optional parameter on Message creation. *(breaking change)*
16
+
17
+ **Notify**
18
+ - `data`, `apn`, `gcm`, `fcm`, `sms` parameters in `Notifications` create resource now accept objects (hashes) instead of strings. Passing manually stringified json will continue to work.
19
+
20
+ **Taskrouter**
21
+ - Add new query ability by TaskChannelSid or TaskChannelUniqueName
22
+ - Move Events, Worker, Workers endpoint over to CPR
23
+ - Add new RealTime and Cumulative Statistics endpoints
24
+
25
+ **Video**
26
+ - Create should allow an array of video_codecs.
27
+ - Add video_codecs as a property of room to make it externally visible.
28
+
29
+
4
30
  [2017-09-15] Version 5.2.3
5
31
  ---------------------------
6
32
  **Api**
data/README.md CHANGED
@@ -9,7 +9,7 @@ A module for using the Twilio REST API and generating valid [TwiML](http://www.t
9
9
  ## Recent Update
10
10
 
11
11
  As of release 5.1.0, Beta and Developer Preview products are now exposed via
12
- the main `twilio-java` artifact. Releases of the `alpha` branch have been
12
+ the main `twilio-ruby` artifact. Releases of the `alpha` branch have been
13
13
  discontinued.
14
14
 
15
15
  If you were using the `alpha` release line, you should be able to switch back
@@ -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.2.3'
30
+ gem 'twilio-ruby', '~> 5.3.0'
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.2.3
36
+ gem install twilio-ruby -v 5.3.0
37
37
  ```
38
38
 
39
39
  To build and install the development branch yourself from the latest source:
data/UPGRADE.md ADDED
@@ -0,0 +1,30 @@
1
+ # Upgrade Guide
2
+
3
+ _After `5.0.0` all `MINOR` and `MAJOR` version bumps will have upgrade notes
4
+ posted here._
5
+
6
+ [2017-09-29] 5.x.x to 5.3.x
7
+ ---------------------------
8
+
9
+ ### CHANGED - `Body` parameter on Chat `Message` creation is no longer required.
10
+
11
+ #### Rationale
12
+ This was changed to add support for sending media in Chat messages, users can now either provide a `body` or a `media_sid`.
13
+
14
+ #### 5.x.x
15
+ ```ruby
16
+ require 'twilio-ruby'
17
+
18
+ @client = Twilio::REST::Client.new "AC123", "auth"
19
+ @client.chat.v2.service('IS123').channel('CH123').message.create("this is the body", "from")
20
+ ```
21
+
22
+ #### 5.3.x
23
+ ```ruby
24
+ require 'twilio-ruby'
25
+
26
+ @client = Twilio::REST::Client.new "AC123", "auth"
27
+ @client.chat.v2.service('IS123').channel('CH123').message.create("from", body:"this is the body")
28
+ ```
29
+
30
+
data/lib/twilio-ruby.rb CHANGED
@@ -10,7 +10,6 @@ require 'time'
10
10
  require 'json'
11
11
 
12
12
  require 'twilio-ruby/version' unless defined?(Twilio::VERSION)
13
- require 'rack/twilio_webhook_authentication'
14
13
 
15
14
  require 'twilio-ruby/util'
16
15
  require 'twilio-ruby/jwt/jwt'
@@ -18,7 +17,6 @@ require 'twilio-ruby/jwt/access_token'
18
17
  require 'twilio-ruby/jwt/client_capability'
19
18
  require 'twilio-ruby/jwt/task_router'
20
19
  require 'twilio-ruby/security/request_validator'
21
- require 'twilio-ruby/util/configuration'
22
20
 
23
21
  require 'twilio-ruby/twiml/twiml'
24
22
  require 'twilio-ruby/twiml/voice_response'
@@ -42,20 +40,4 @@ end
42
40
 
43
41
  module Twilio
44
42
  extend SingleForwardable
45
-
46
- def_delegators :configuration, :account_sid, :auth_token
47
-
48
- ##
49
- # Pre-configure with account SID and auth token so that you don't need to
50
- # pass them to various initializers each time.
51
- def self.configure(&block)
52
- yield configuration
53
- end
54
-
55
- ##
56
- # Returns an existing or instantiates a new configuration object.
57
- def self.configuration
58
- @configuration ||= Util::Configuration.new
59
- end
60
- private_class_method :configuration
61
43
  end
@@ -338,7 +338,7 @@ module Twilio
338
338
  ##
339
339
  # Update the IncomingPhoneNumberInstance
340
340
  # @param [String] account_sid The unique id of the Account to which you wish to
341
- # transfer this phnoe number
341
+ # transfer this phone number
342
342
  # @param [String] api_version Calls to this phone number will start a new TwiML
343
343
  # session with this API version.
344
344
  # @param [String] friendly_name A human readable descriptive text for this
@@ -726,7 +726,7 @@ module Twilio
726
726
  ##
727
727
  # Update the IncomingPhoneNumberInstance
728
728
  # @param [String] account_sid The unique id of the Account to which you wish to
729
- # transfer this phnoe number
729
+ # transfer this phone number
730
730
  # @param [String] api_version Calls to this phone number will start a new TwiML
731
731
  # session with this API version.
732
732
  # @param [String] friendly_name A human readable descriptive text for this
@@ -262,8 +262,10 @@ module Twilio
262
262
  # @param [String] limits_channel_members The limits.channel_members
263
263
  # @param [String] limits_user_channels The limits.user_channels
264
264
  # @param [String] media_compatibility_message The media.compatibility_message
265
+ # @param [String] pre_webhook_retry_count The pre_webhook_retry_count
266
+ # @param [String] post_webhook_retry_count The post_webhook_retry_count
265
267
  # @return [ServiceInstance] Updated ServiceInstance
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)
268
+ 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, pre_webhook_retry_count: :unset, post_webhook_retry_count: :unset)
267
269
  data = Twilio::Values.of({
268
270
  'FriendlyName' => friendly_name,
269
271
  'DefaultServiceRoleSid' => default_service_role_sid,
@@ -293,6 +295,8 @@ module Twilio
293
295
  'Limits.ChannelMembers' => limits_channel_members,
294
296
  'Limits.UserChannels' => limits_user_channels,
295
297
  'Media.CompatibilityMessage' => media_compatibility_message,
298
+ 'PreWebhookRetryCount' => pre_webhook_retry_count,
299
+ 'PostWebhookRetryCount' => post_webhook_retry_count,
296
300
  })
297
301
 
298
302
  payload = @version.update(
@@ -420,6 +424,8 @@ module Twilio
420
424
  'post_webhook_url' => payload['post_webhook_url'],
421
425
  'webhook_method' => payload['webhook_method'],
422
426
  'webhook_filters' => payload['webhook_filters'],
427
+ 'pre_webhook_retry_count' => payload['pre_webhook_retry_count'].to_i,
428
+ 'post_webhook_retry_count' => payload['post_webhook_retry_count'].to_i,
423
429
  'notifications' => payload['notifications'],
424
430
  'media' => payload['media'],
425
431
  'url' => payload['url'],
@@ -549,6 +555,18 @@ module Twilio
549
555
  @properties['webhook_filters']
550
556
  end
551
557
 
558
+ ##
559
+ # @return [String] The pre_webhook_retry_count
560
+ def pre_webhook_retry_count
561
+ @properties['pre_webhook_retry_count']
562
+ end
563
+
564
+ ##
565
+ # @return [String] The post_webhook_retry_count
566
+ def post_webhook_retry_count
567
+ @properties['post_webhook_retry_count']
568
+ end
569
+
552
570
  ##
553
571
  # @return [Hash] The notifications
554
572
  def notifications
@@ -631,8 +649,10 @@ module Twilio
631
649
  # @param [String] limits_channel_members The limits.channel_members
632
650
  # @param [String] limits_user_channels The limits.user_channels
633
651
  # @param [String] media_compatibility_message The media.compatibility_message
652
+ # @param [String] pre_webhook_retry_count The pre_webhook_retry_count
653
+ # @param [String] post_webhook_retry_count The post_webhook_retry_count
634
654
  # @return [ServiceInstance] Updated ServiceInstance
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)
655
+ 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, pre_webhook_retry_count: :unset, post_webhook_retry_count: :unset)
636
656
  context.update(
637
657
  friendly_name: friendly_name,
638
658
  default_service_role_sid: default_service_role_sid,
@@ -662,6 +682,8 @@ module Twilio
662
682
  limits_channel_members: limits_channel_members,
663
683
  limits_user_channels: limits_user_channels,
664
684
  media_compatibility_message: media_compatibility_message,
685
+ pre_webhook_retry_count: pre_webhook_retry_count,
686
+ post_webhook_retry_count: post_webhook_retry_count,
665
687
  )
666
688
  end
667
689
 
@@ -31,21 +31,23 @@ module Twilio
31
31
  ##
32
32
  # Retrieve a single page of MessageInstance records from the API.
33
33
  # Request is executed immediately.
34
- # @param [String] body The body
35
34
  # @param [String] from The from
36
35
  # @param [String] attributes The attributes
37
36
  # @param [Time] date_created The date_created
38
37
  # @param [Time] date_updated The date_updated
39
38
  # @param [String] last_updated_by The last_updated_by
39
+ # @param [String] body The body
40
+ # @param [String] media_sid The media_sid
40
41
  # @return [MessageInstance] Newly created MessageInstance
41
- def create(body: nil, from: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, last_updated_by: :unset)
42
+ def create(from: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, last_updated_by: :unset, body: :unset, media_sid: :unset)
42
43
  data = Twilio::Values.of({
43
- 'Body' => body,
44
44
  'From' => from,
45
45
  'Attributes' => attributes,
46
46
  'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
47
47
  'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated),
48
48
  'LastUpdatedBy' => last_updated_by,
49
+ 'Body' => body,
50
+ 'MediaSid' => media_sid,
49
51
  })
50
52
 
51
53
  payload = @version.create(
@@ -14,8 +14,8 @@ module Twilio
14
14
  ##
15
15
  # Initializes the Twilio Client
16
16
  def initialize(username=nil, password=nil, account_sid=nil, region=nil, http_client=Twilio::HTTP::Client.new)
17
- @username = username || Twilio.account_sid
18
- @password = password || Twilio.auth_token
17
+ @username = username
18
+ @password = password
19
19
  @region = region
20
20
  @account_sid = account_sid || @username
21
21
  @auth_token = @password
@@ -394,4 +394,4 @@ module Twilio
394
394
  # Dummy client which provides no functionality. Please use Twilio::REST::Client instead.
395
395
  class TrunkingClient < ObsoleteClient; end
396
396
  end
397
- end
397
+ end
@@ -262,8 +262,10 @@ module Twilio
262
262
  # @param [String] limits_channel_members The limits.channel_members
263
263
  # @param [String] limits_user_channels The limits.user_channels
264
264
  # @param [String] media_compatibility_message The media.compatibility_message
265
+ # @param [String] pre_webhook_retry_count The pre_webhook_retry_count
266
+ # @param [String] post_webhook_retry_count The post_webhook_retry_count
265
267
  # @return [ServiceInstance] Updated ServiceInstance
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)
268
+ 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, pre_webhook_retry_count: :unset, post_webhook_retry_count: :unset)
267
269
  data = Twilio::Values.of({
268
270
  'FriendlyName' => friendly_name,
269
271
  'DefaultServiceRoleSid' => default_service_role_sid,
@@ -293,6 +295,8 @@ module Twilio
293
295
  'Limits.ChannelMembers' => limits_channel_members,
294
296
  'Limits.UserChannels' => limits_user_channels,
295
297
  'Media.CompatibilityMessage' => media_compatibility_message,
298
+ 'PreWebhookRetryCount' => pre_webhook_retry_count,
299
+ 'PostWebhookRetryCount' => post_webhook_retry_count,
296
300
  })
297
301
 
298
302
  payload = @version.update(
@@ -420,6 +424,8 @@ module Twilio
420
424
  'post_webhook_url' => payload['post_webhook_url'],
421
425
  'webhook_method' => payload['webhook_method'],
422
426
  'webhook_filters' => payload['webhook_filters'],
427
+ 'pre_webhook_retry_count' => payload['pre_webhook_retry_count'].to_i,
428
+ 'post_webhook_retry_count' => payload['post_webhook_retry_count'].to_i,
423
429
  'notifications' => payload['notifications'],
424
430
  'media' => payload['media'],
425
431
  'url' => payload['url'],
@@ -549,6 +555,18 @@ module Twilio
549
555
  @properties['webhook_filters']
550
556
  end
551
557
 
558
+ ##
559
+ # @return [String] The pre_webhook_retry_count
560
+ def pre_webhook_retry_count
561
+ @properties['pre_webhook_retry_count']
562
+ end
563
+
564
+ ##
565
+ # @return [String] The post_webhook_retry_count
566
+ def post_webhook_retry_count
567
+ @properties['post_webhook_retry_count']
568
+ end
569
+
552
570
  ##
553
571
  # @return [Hash] The notifications
554
572
  def notifications
@@ -631,8 +649,10 @@ module Twilio
631
649
  # @param [String] limits_channel_members The limits.channel_members
632
650
  # @param [String] limits_user_channels The limits.user_channels
633
651
  # @param [String] media_compatibility_message The media.compatibility_message
652
+ # @param [String] pre_webhook_retry_count The pre_webhook_retry_count
653
+ # @param [String] post_webhook_retry_count The post_webhook_retry_count
634
654
  # @return [ServiceInstance] Updated ServiceInstance
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)
655
+ 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, pre_webhook_retry_count: :unset, post_webhook_retry_count: :unset)
636
656
  context.update(
637
657
  friendly_name: friendly_name,
638
658
  default_service_role_sid: default_service_role_sid,
@@ -662,6 +682,8 @@ module Twilio
662
682
  limits_channel_members: limits_channel_members,
663
683
  limits_user_channels: limits_user_channels,
664
684
  media_compatibility_message: media_compatibility_message,
685
+ pre_webhook_retry_count: pre_webhook_retry_count,
686
+ post_webhook_retry_count: post_webhook_retry_count,
665
687
  )
666
688
  end
667
689
 
@@ -31,21 +31,23 @@ module Twilio
31
31
  ##
32
32
  # Retrieve a single page of MessageInstance records from the API.
33
33
  # Request is executed immediately.
34
- # @param [String] body The body
35
34
  # @param [String] from The from
36
35
  # @param [String] attributes The attributes
37
36
  # @param [Time] date_created The date_created
38
37
  # @param [Time] date_updated The date_updated
39
38
  # @param [String] last_updated_by The last_updated_by
39
+ # @param [String] body The body
40
+ # @param [String] media_sid The media_sid
40
41
  # @return [MessageInstance] Newly created MessageInstance
41
- def create(body: nil, from: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, last_updated_by: :unset)
42
+ def create(from: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, last_updated_by: :unset, body: :unset, media_sid: :unset)
42
43
  data = Twilio::Values.of({
43
- 'Body' => body,
44
44
  'From' => from,
45
45
  'Attributes' => attributes,
46
46
  'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
47
47
  'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated),
48
48
  'LastUpdatedBy' => last_updated_by,
49
+ 'Body' => body,
50
+ 'MediaSid' => media_sid,
49
51
  })
50
52
 
51
53
  payload = @version.create(
@@ -36,14 +36,14 @@ module Twilio
36
36
  # @param [String] title The title
37
37
  # @param [String] sound The sound
38
38
  # @param [String] action The action
39
- # @param [String] data The data
40
- # @param [String] apn The apn
41
- # @param [String] gcm The gcm
42
- # @param [String] sms The sms
39
+ # @param [Hash] data The data
40
+ # @param [Hash] apn The apn
41
+ # @param [Hash] gcm The gcm
42
+ # @param [Hash] sms The sms
43
43
  # @param [Hash] facebook_messenger The facebook_messenger
44
- # @param [String] fcm The fcm
44
+ # @param [Hash] fcm The fcm
45
45
  # @param [String] segment The segment
46
- # @param [String] alexa The alexa
46
+ # @param [Hash] alexa The alexa
47
47
  # @param [String] to_binding The to_binding
48
48
  # @param [String] identity The identity
49
49
  # @param [String] tag The tag
@@ -58,14 +58,14 @@ module Twilio
58
58
  'Title' => title,
59
59
  'Sound' => sound,
60
60
  'Action' => action,
61
- 'Data' => data,
62
- 'Apn' => apn,
63
- 'Gcm' => gcm,
64
- 'Sms' => sms,
61
+ 'Data' => Twilio.serialize_object(data),
62
+ 'Apn' => Twilio.serialize_object(apn),
63
+ 'Gcm' => Twilio.serialize_object(gcm),
64
+ 'Sms' => Twilio.serialize_object(sms),
65
65
  'FacebookMessenger' => Twilio.serialize_object(facebook_messenger),
66
- 'Fcm' => fcm,
66
+ 'Fcm' => Twilio.serialize_object(fcm),
67
67
  'Segment' => segment,
68
- 'Alexa' => alexa,
68
+ 'Alexa' => Twilio.serialize_object(alexa),
69
69
  'ToBinding' => to_binding,
70
70
  })
71
71
 
@@ -210,6 +210,8 @@ module Twilio
210
210
  @workers = nil
211
211
  @workflows = nil
212
212
  @statistics = nil
213
+ @workspace_real_time_statistics = nil
214
+ @workspace_cumulative_statistics = nil
213
215
  @task_channels = nil
214
216
  end
215
217
 
@@ -434,6 +436,28 @@ module Twilio
434
436
  )
435
437
  end
436
438
 
439
+ ##
440
+ # Access the workspace_real_time_statistics
441
+ # @return [WorkspaceRealTimeStatisticsList]
442
+ # @return [WorkspaceRealTimeStatisticsContext]
443
+ def workspace_real_time_statistics
444
+ WorkspaceRealTimeStatisticsContext.new(
445
+ @version,
446
+ @solution[:sid],
447
+ )
448
+ end
449
+
450
+ ##
451
+ # Access the workspace_cumulative_statistics
452
+ # @return [WorkspaceCumulativeStatisticsList]
453
+ # @return [WorkspaceCumulativeStatisticsContext]
454
+ def workspace_cumulative_statistics
455
+ WorkspaceCumulativeStatisticsContext.new(
456
+ @version,
457
+ @solution[:sid],
458
+ )
459
+ end
460
+
437
461
  ##
438
462
  # Access the task_channels
439
463
  # @return [TaskChannelList]
@@ -692,6 +716,20 @@ module Twilio
692
716
  context.statistics
693
717
  end
694
718
 
719
+ ##
720
+ # Access the workspace_real_time_statistics
721
+ # @return [workspace_real_time_statistics] workspace_real_time_statistics
722
+ def workspace_real_time_statistics
723
+ context.workspace_real_time_statistics
724
+ end
725
+
726
+ ##
727
+ # Access the workspace_cumulative_statistics
728
+ # @return [workspace_cumulative_statistics] workspace_cumulative_statistics
729
+ def workspace_cumulative_statistics
730
+ context.workspace_cumulative_statistics
731
+ end
732
+
695
733
  ##
696
734
  # Access the task_channels
697
735
  # @return [task_channels] task_channels