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
@@ -47,6 +47,8 @@ describe 'Service' do
47
47
  "notifications": {},
48
48
  "post_webhook_url": "post_webhook_url",
49
49
  "pre_webhook_url": "pre_webhook_url",
50
+ "pre_webhook_retry_count": 2,
51
+ "post_webhook_retry_count": 3,
50
52
  "reachability_enabled": false,
51
53
  "read_status_enabled": false,
52
54
  "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -138,6 +140,8 @@ describe 'Service' do
138
140
  "notifications": {},
139
141
  "post_webhook_url": "post_webhook_url",
140
142
  "pre_webhook_url": "pre_webhook_url",
143
+ "pre_webhook_retry_count": 2,
144
+ "post_webhook_retry_count": 3,
141
145
  "reachability_enabled": false,
142
146
  "read_status_enabled": false,
143
147
  "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -235,6 +239,8 @@ describe 'Service' do
235
239
  "notifications": {},
236
240
  "post_webhook_url": "post_webhook_url",
237
241
  "pre_webhook_url": "pre_webhook_url",
242
+ "pre_webhook_retry_count": 2,
243
+ "post_webhook_retry_count": 3,
238
244
  "reachability_enabled": false,
239
245
  "read_status_enabled": false,
240
246
  "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -317,6 +323,8 @@ describe 'Service' do
317
323
  },
318
324
  "post_webhook_url": "post_webhook_url",
319
325
  "pre_webhook_url": "pre_webhook_url",
326
+ "pre_webhook_retry_count": 2,
327
+ "post_webhook_retry_count": 3,
320
328
  "reachability_enabled": false,
321
329
  "read_status_enabled": false,
322
330
  "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -0,0 +1,94 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ require 'spec_helper.rb'
8
+
9
+ describe 'TaskQueueCumulativeStatistics' do
10
+ it "can fetch" do
11
+ @holodeck.mock(Twilio::Response.new(500, ''))
12
+
13
+ expect {
14
+ @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
15
+ .task_queues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
16
+ .task_queue_cumulative_statistics().fetch()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {}
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives fetch responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "reservations_created": 100,
33
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "reservations_rejected": 100,
35
+ "tasks_completed": 100,
36
+ "end_time": "2015-07-30T20:00:00Z",
37
+ "tasks_entered": 100,
38
+ "tasks_canceled": 100,
39
+ "reservations_accepted": 100,
40
+ "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41
+ "reservations_timed_out": 100,
42
+ "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics",
43
+ "wait_duration_until_canceled": {
44
+ "avg": 0,
45
+ "min": 0,
46
+ "max": 0,
47
+ "total": 0
48
+ },
49
+ "wait_duration_until_accepted": {
50
+ "avg": 0,
51
+ "min": 0,
52
+ "max": 0,
53
+ "total": 0
54
+ },
55
+ "split_by_wait_time": {
56
+ "5": {
57
+ "above": {
58
+ "tasks_canceled": 0,
59
+ "reservations_accepted": 0
60
+ },
61
+ "below": {
62
+ "tasks_canceled": 0,
63
+ "reservations_accepted": 0
64
+ }
65
+ },
66
+ "10": {
67
+ "above": {
68
+ "tasks_canceled": 0,
69
+ "reservations_accepted": 0
70
+ },
71
+ "below": {
72
+ "tasks_canceled": 0,
73
+ "reservations_accepted": 0
74
+ }
75
+ }
76
+ },
77
+ "start_time": "2015-07-30T20:00:00Z",
78
+ "tasks_moved": 100,
79
+ "reservations_canceled": 100,
80
+ "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
81
+ "tasks_deleted": 100,
82
+ "reservations_rescinded": 100,
83
+ "avg_task_acceptance_time": 100
84
+ }
85
+ ]
86
+ ))
87
+
88
+ actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
89
+ .task_queues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
90
+ .task_queue_cumulative_statistics().fetch()
91
+
92
+ expect(actual).to_not eq(nil)
93
+ end
94
+ end
@@ -0,0 +1,79 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ require 'spec_helper.rb'
8
+
9
+ describe 'TaskQueueRealTimeStatistics' do
10
+ it "can fetch" do
11
+ @holodeck.mock(Twilio::Response.new(500, ''))
12
+
13
+ expect {
14
+ @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
15
+ .task_queues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
16
+ .task_queue_real_time_statistics().fetch()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {}
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives fetch responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "longest_task_waiting_age": 100,
33
+ "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "tasks_by_status": {
35
+ "reserved": 0,
36
+ "pending": 0,
37
+ "assigned": 0,
38
+ "wrapping": 0
39
+ },
40
+ "total_eligible_workers": 100,
41
+ "activity_statistics": [
42
+ {
43
+ "friendly_name": "Idle",
44
+ "workers": 0,
45
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
46
+ },
47
+ {
48
+ "friendly_name": "Busy",
49
+ "workers": 9,
50
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
51
+ },
52
+ {
53
+ "friendly_name": "Offline",
54
+ "workers": 6,
55
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
56
+ },
57
+ {
58
+ "friendly_name": "Reserved",
59
+ "workers": 0,
60
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
61
+ }
62
+ ],
63
+ "tasks_by_priority": {},
64
+ "total_tasks": 100,
65
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
66
+ "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
67
+ "total_available_workers": 100,
68
+ "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics"
69
+ }
70
+ ]
71
+ ))
72
+
73
+ actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
74
+ .task_queues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
75
+ .task_queue_real_time_statistics().fetch()
76
+
77
+ expect(actual).to_not eq(nil)
78
+ end
79
+ end
@@ -41,6 +41,8 @@ describe 'TaskQueue' do
41
41
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
42
42
  "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
43
43
  "task_queue_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
44
+ "task_queue_real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
45
+ "task_queue_cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics",
44
46
  "task_queues_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics"
45
47
  },
46
48
  "reservation_activity_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73",
@@ -94,6 +96,8 @@ describe 'TaskQueue' do
94
96
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
95
97
  "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
96
98
  "task_queue_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
99
+ "task_queue_real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
100
+ "task_queue_cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics",
97
101
  "task_queues_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics"
98
102
  },
99
103
  "reservation_activity_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73",
@@ -158,6 +162,8 @@ describe 'TaskQueue' do
158
162
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
159
163
  "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
160
164
  "task_queue_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
165
+ "task_queue_real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
166
+ "task_queue_cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics",
161
167
  "task_queues_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics"
162
168
  },
163
169
  "reservation_activity_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73",
@@ -243,6 +249,8 @@ describe 'TaskQueue' do
243
249
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
244
250
  "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
245
251
  "task_queue_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
252
+ "task_queue_real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
253
+ "task_queue_cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics",
246
254
  "task_queues_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics"
247
255
  },
248
256
  "reservation_activity_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73",
@@ -29,71 +29,54 @@ describe 'WorkerStatistics' do
29
29
  200,
30
30
  %q[
31
31
  {
32
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
- "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
34
32
  "cumulative": {
33
+ "reservations_created": 100,
34
+ "reservations_accepted": 100,
35
+ "reservations_rejected": 100,
36
+ "reservations_timed_out": 100,
37
+ "reservations_canceled": 100,
38
+ "reservations_rescinded": 100,
35
39
  "activity_durations": [
36
40
  {
37
- "avg": 0.0,
38
- "friendly_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73",
39
41
  "max": 0,
40
- "min": 0,
42
+ "min": 900,
41
43
  "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
42
- "total": 0
44
+ "friendly_name": "Offline",
45
+ "avg": 1080,
46
+ "total": 5400
43
47
  },
44
48
  {
45
- "avg": 0.0,
46
- "friendly_name": "817ca1c5-3a05-11e5-9292-98e0d9a1eb73",
47
49
  "max": 0,
48
- "min": 0,
50
+ "min": 900,
49
51
  "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
50
- "total": 0
51
- },
52
- {
53
- "avg": 0.0,
54
52
  "friendly_name": "Busy",
55
- "max": 0,
56
- "min": 0,
57
- "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
58
- "total": 0
53
+ "avg": 1012,
54
+ "total": 8100
59
55
  },
60
56
  {
61
- "avg": 0.0,
62
- "friendly_name": "Idle",
63
57
  "max": 0,
64
58
  "min": 0,
65
59
  "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
60
+ "friendly_name": "Idle",
61
+ "avg": 0,
66
62
  "total": 0
67
63
  },
68
64
  {
69
- "avg": 0.0,
70
- "friendly_name": "Offline",
71
65
  "max": 0,
72
66
  "min": 0,
73
67
  "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
74
- "total": 0
75
- },
76
- {
77
- "avg": 0.0,
78
68
  "friendly_name": "Reserved",
79
- "max": 0,
80
- "min": 0,
81
- "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
69
+ "avg": 0,
82
70
  "total": 0
83
71
  }
84
72
  ],
85
- "end_time": "2015-08-18T16:36:19Z",
86
- "reservations_accepted": 0,
87
- "reservations_canceled": 0,
88
- "reservations_created": 0,
89
- "reservations_rejected": 0,
90
- "reservations_rescinded": 0,
91
- "reservations_timed_out": 0,
92
- "start_time": "2015-08-18T16:21:19Z",
93
- "tasks_assigned": 0
73
+ "start_time": "2008-01-02T00:00:00Z",
74
+ "end_time": "2008-01-02T00:00:00Z"
94
75
  },
76
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
77
+ "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
95
78
  "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
96
- "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
79
+ "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics"
97
80
  }
98
81
  ]
99
82
  ))
@@ -0,0 +1,87 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ require 'spec_helper.rb'
8
+
9
+ describe 'WorkersCumulativeStatistics' do
10
+ it "can fetch" do
11
+ @holodeck.mock(Twilio::Response.new(500, ''))
12
+
13
+ expect {
14
+ @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
15
+ .workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
16
+ .workers_cumulative_statistics().fetch()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {}
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives fetch responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
+ "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics",
35
+ "reservations_created": 100,
36
+ "reservations_accepted": 100,
37
+ "reservations_rejected": 100,
38
+ "reservations_timed_out": 100,
39
+ "reservations_canceled": 100,
40
+ "reservations_rescinded": 100,
41
+ "activity_durations": [
42
+ {
43
+ "max": 0,
44
+ "min": 900,
45
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
46
+ "friendly_name": "Offline",
47
+ "avg": 1080,
48
+ "total": 5400
49
+ },
50
+ {
51
+ "max": 0,
52
+ "min": 900,
53
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
54
+ "friendly_name": "Busy",
55
+ "avg": 1012,
56
+ "total": 8100
57
+ },
58
+ {
59
+ "max": 0,
60
+ "min": 0,
61
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
62
+ "friendly_name": "Idle",
63
+ "avg": 0,
64
+ "total": 0
65
+ },
66
+ {
67
+ "max": 0,
68
+ "min": 0,
69
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
70
+ "friendly_name": "Reserved",
71
+ "avg": 0,
72
+ "total": 0
73
+ }
74
+ ],
75
+ "start_time": "2015-07-30T20:00:00Z",
76
+ "end_time": "2015-07-30T20:00:00Z"
77
+ }
78
+ ]
79
+ ))
80
+
81
+ actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
82
+ .workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
83
+ .workers_cumulative_statistics().fetch()
84
+
85
+ expect(actual).to_not eq(nil)
86
+ end
87
+ end
@@ -0,0 +1,68 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ require 'spec_helper.rb'
8
+
9
+ describe 'WorkersRealTimeStatistics' do
10
+ it "can fetch" do
11
+ @holodeck.mock(Twilio::Response.new(500, ''))
12
+
13
+ expect {
14
+ @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
15
+ .workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
16
+ .workers_real_time_statistics().fetch()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {}
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives fetch responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
+ "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics",
35
+ "total_workers": 15,
36
+ "activity_statistics": [
37
+ {
38
+ "friendly_name": "Idle",
39
+ "workers": 0,
40
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
41
+ },
42
+ {
43
+ "friendly_name": "Busy",
44
+ "workers": 9,
45
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
46
+ },
47
+ {
48
+ "friendly_name": "Offline",
49
+ "workers": 6,
50
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
51
+ },
52
+ {
53
+ "friendly_name": "Reserved",
54
+ "workers": 0,
55
+ "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
56
+ }
57
+ ]
58
+ }
59
+ ]
60
+ ))
61
+
62
+ actual = @client.taskrouter.v1.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
63
+ .workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
64
+ .workers_real_time_statistics().fetch()
65
+
66
+ expect(actual).to_not eq(nil)
67
+ end
68
+ end