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.
- checksums.yaml +4 -4
- data/CHANGES.md +26 -0
- data/README.md +3 -3
- data/UPGRADE.md +30 -0
- data/lib/twilio-ruby.rb +0 -18
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service.rb +24 -2
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +5 -3
- data/lib/twilio-ruby/rest/client.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +24 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +5 -3
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +12 -12
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +40 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +350 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +264 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +10 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +15 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +38 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +6 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +274 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +213 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +14 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +40 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +357 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +243 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +10 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +339 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +239 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +10 -2
- data/lib/twilio-ruby/rest/video/v1/room.rb +7 -0
- data/lib/twilio-ruby/security/request_validator.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/chat/v2/service/channel/message_spec.rb +41 -7
- data/spec/integration/chat/v2/service_spec.rb +8 -0
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +41 -7
- data/spec/integration/ip_messaging/v2/service_spec.rb +8 -0
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics_spec.rb +94 -0
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics_spec.rb +79 -0
- data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +8 -0
- data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +21 -38
- data/spec/integration/taskrouter/v1/workspace/worker/workers_cumulative_statistics_spec.rb +87 -0
- data/spec/integration/taskrouter/v1/workspace/worker/workers_real_time_statistics_spec.rb +68 -0
- data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +34 -61
- data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +8 -0
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics_spec.rb +95 -0
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_real_time_statistics_spec.rb +55 -0
- data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +12 -4
- data/spec/integration/taskrouter/v1/workspace/workspace_cumulative_statistics_spec.rb +92 -0
- data/spec/integration/taskrouter/v1/workspace/workspace_real_time_statistics_spec.rb +70 -0
- data/spec/integration/taskrouter/v1/workspace_spec.rb +8 -0
- data/spec/integration/video/v1/room_spec.rb +12 -0
- data/spec/security/request_validator_spec.rb +0 -28
- data/spec/twilio_spec.rb +0 -15
- metadata +28 -9
- data/lib/rack/twilio_webhook_authentication.rb +0 -46
- data/lib/twilio-ruby/util/configuration.rb +0 -7
- data/spec/rack/twilio_webhook_authentication_spec.rb +0 -106
- data/spec/util/configuration_spec.rb +0 -15
@@ -0,0 +1,213 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Taskrouter < Domain
|
10
|
+
class V1 < Version
|
11
|
+
class WorkspaceContext < InstanceContext
|
12
|
+
class WorkerContext < InstanceContext
|
13
|
+
class WorkersRealTimeStatisticsList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the WorkersRealTimeStatisticsList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @param [String] workspace_sid The workspace_sid
|
18
|
+
# @return [WorkersRealTimeStatisticsList] WorkersRealTimeStatisticsList
|
19
|
+
def initialize(version, workspace_sid: nil)
|
20
|
+
super(version)
|
21
|
+
|
22
|
+
# Path Solution
|
23
|
+
@solution = {
|
24
|
+
workspace_sid: workspace_sid
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Provide a user friendly representation
|
30
|
+
def to_s
|
31
|
+
'#<Twilio.Taskrouter.V1.WorkersRealTimeStatisticsList>'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class WorkersRealTimeStatisticsPage < Page
|
36
|
+
##
|
37
|
+
# Initialize the WorkersRealTimeStatisticsPage
|
38
|
+
# @param [Version] version Version that contains the resource
|
39
|
+
# @param [Response] response Response from the API
|
40
|
+
# @param [Hash] solution Path solution for the resource
|
41
|
+
# @return [WorkersRealTimeStatisticsPage] WorkersRealTimeStatisticsPage
|
42
|
+
def initialize(version, response, solution)
|
43
|
+
super(version, response)
|
44
|
+
|
45
|
+
# Path Solution
|
46
|
+
@solution = solution
|
47
|
+
end
|
48
|
+
|
49
|
+
##
|
50
|
+
# Build an instance of WorkersRealTimeStatisticsInstance
|
51
|
+
# @param [Hash] payload Payload response from the API
|
52
|
+
# @return [WorkersRealTimeStatisticsInstance] WorkersRealTimeStatisticsInstance
|
53
|
+
def get_instance(payload)
|
54
|
+
WorkersRealTimeStatisticsInstance.new(
|
55
|
+
@version,
|
56
|
+
payload,
|
57
|
+
workspace_sid: @solution[:workspace_sid],
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
##
|
62
|
+
# Provide a user friendly representation
|
63
|
+
def to_s
|
64
|
+
'<Twilio.Taskrouter.V1.WorkersRealTimeStatisticsPage>'
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
class WorkersRealTimeStatisticsContext < InstanceContext
|
69
|
+
##
|
70
|
+
# Initialize the WorkersRealTimeStatisticsContext
|
71
|
+
# @param [Version] version Version that contains the resource
|
72
|
+
# @param [String] workspace_sid The workspace_sid
|
73
|
+
# @return [WorkersRealTimeStatisticsContext] WorkersRealTimeStatisticsContext
|
74
|
+
def initialize(version, workspace_sid)
|
75
|
+
super(version)
|
76
|
+
|
77
|
+
# Path Solution
|
78
|
+
@solution = {
|
79
|
+
workspace_sid: workspace_sid,
|
80
|
+
}
|
81
|
+
@uri = "/Workspaces/#{@solution[:workspace_sid]}/Workers/RealTimeStatistics"
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# Fetch a WorkersRealTimeStatisticsInstance
|
86
|
+
# @param [String] task_channel The task_channel
|
87
|
+
# @return [WorkersRealTimeStatisticsInstance] Fetched WorkersRealTimeStatisticsInstance
|
88
|
+
def fetch(task_channel: :unset)
|
89
|
+
params = Twilio::Values.of({
|
90
|
+
'TaskChannel' => task_channel,
|
91
|
+
})
|
92
|
+
|
93
|
+
payload = @version.fetch(
|
94
|
+
'GET',
|
95
|
+
@uri,
|
96
|
+
params,
|
97
|
+
)
|
98
|
+
|
99
|
+
WorkersRealTimeStatisticsInstance.new(
|
100
|
+
@version,
|
101
|
+
payload,
|
102
|
+
workspace_sid: @solution[:workspace_sid],
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Provide a user friendly representation
|
108
|
+
def to_s
|
109
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
110
|
+
"#<Twilio.Taskrouter.V1.WorkersRealTimeStatisticsContext #{context}>"
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
class WorkersRealTimeStatisticsInstance < InstanceResource
|
115
|
+
##
|
116
|
+
# Initialize the WorkersRealTimeStatisticsInstance
|
117
|
+
# @param [Version] version Version that contains the resource
|
118
|
+
# @param [Hash] payload payload that contains response from Twilio
|
119
|
+
# @param [String] workspace_sid The workspace_sid
|
120
|
+
# @return [WorkersRealTimeStatisticsInstance] WorkersRealTimeStatisticsInstance
|
121
|
+
def initialize(version, payload, workspace_sid: nil)
|
122
|
+
super(version)
|
123
|
+
|
124
|
+
# Marshaled Properties
|
125
|
+
@properties = {
|
126
|
+
'account_sid' => payload['account_sid'],
|
127
|
+
'activity_statistics' => payload['activity_statistics'],
|
128
|
+
'total_workers' => payload['total_workers'].to_i,
|
129
|
+
'workspace_sid' => payload['workspace_sid'],
|
130
|
+
'url' => payload['url'],
|
131
|
+
}
|
132
|
+
|
133
|
+
# Context
|
134
|
+
@instance_context = nil
|
135
|
+
@params = {
|
136
|
+
'workspace_sid' => workspace_sid,
|
137
|
+
}
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Generate an instance context for the instance, the context is capable of
|
142
|
+
# performing various actions. All instance actions are proxied to the context
|
143
|
+
# @return [WorkersRealTimeStatisticsContext] WorkersRealTimeStatisticsContext for this WorkersRealTimeStatisticsInstance
|
144
|
+
def context
|
145
|
+
unless @instance_context
|
146
|
+
@instance_context = WorkersRealTimeStatisticsContext.new(
|
147
|
+
@version,
|
148
|
+
@params['workspace_sid'],
|
149
|
+
)
|
150
|
+
end
|
151
|
+
@instance_context
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# @return [String] The account_sid
|
156
|
+
def account_sid
|
157
|
+
@properties['account_sid']
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# @return [Hash] The activity_statistics
|
162
|
+
def activity_statistics
|
163
|
+
@properties['activity_statistics']
|
164
|
+
end
|
165
|
+
|
166
|
+
##
|
167
|
+
# @return [String] The total_workers
|
168
|
+
def total_workers
|
169
|
+
@properties['total_workers']
|
170
|
+
end
|
171
|
+
|
172
|
+
##
|
173
|
+
# @return [String] The workspace_sid
|
174
|
+
def workspace_sid
|
175
|
+
@properties['workspace_sid']
|
176
|
+
end
|
177
|
+
|
178
|
+
##
|
179
|
+
# @return [String] The url
|
180
|
+
def url
|
181
|
+
@properties['url']
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# Fetch a WorkersRealTimeStatisticsInstance
|
186
|
+
# @param [String] task_channel The task_channel
|
187
|
+
# @return [WorkersRealTimeStatisticsInstance] Fetched WorkersRealTimeStatisticsInstance
|
188
|
+
def fetch(task_channel: :unset)
|
189
|
+
context.fetch(
|
190
|
+
task_channel: task_channel,
|
191
|
+
)
|
192
|
+
end
|
193
|
+
|
194
|
+
##
|
195
|
+
# Provide a user friendly representation
|
196
|
+
def to_s
|
197
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
198
|
+
"<Twilio.Taskrouter.V1.WorkersRealTimeStatisticsInstance #{values}>"
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# Provide a detailed, user friendly representation
|
203
|
+
def inspect
|
204
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
205
|
+
"<Twilio.Taskrouter.V1.WorkersRealTimeStatisticsInstance #{values}>"
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
@@ -89,8 +89,9 @@ module Twilio
|
|
89
89
|
# @param [String] task_queue_sid The task_queue_sid
|
90
90
|
# @param [String] task_queue_name The task_queue_name
|
91
91
|
# @param [String] friendly_name The friendly_name
|
92
|
+
# @param [String] task_channel The task_channel
|
92
93
|
# @return [WorkersStatisticsInstance] Fetched WorkersStatisticsInstance
|
93
|
-
def fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_queue_sid: :unset, task_queue_name: :unset, friendly_name: :unset)
|
94
|
+
def fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_queue_sid: :unset, task_queue_name: :unset, friendly_name: :unset, task_channel: :unset)
|
94
95
|
params = Twilio::Values.of({
|
95
96
|
'Minutes' => minutes,
|
96
97
|
'StartDate' => Twilio.serialize_iso8601_datetime(start_date),
|
@@ -98,6 +99,7 @@ module Twilio
|
|
98
99
|
'TaskQueueSid' => task_queue_sid,
|
99
100
|
'TaskQueueName' => task_queue_name,
|
100
101
|
'FriendlyName' => friendly_name,
|
102
|
+
'TaskChannel' => task_channel,
|
101
103
|
})
|
102
104
|
|
103
105
|
payload = @version.fetch(
|
@@ -133,9 +135,9 @@ module Twilio
|
|
133
135
|
|
134
136
|
# Marshaled Properties
|
135
137
|
@properties = {
|
136
|
-
'account_sid' => payload['account_sid'],
|
137
|
-
'cumulative' => payload['cumulative'],
|
138
138
|
'realtime' => payload['realtime'],
|
139
|
+
'cumulative' => payload['cumulative'],
|
140
|
+
'account_sid' => payload['account_sid'],
|
139
141
|
'workspace_sid' => payload['workspace_sid'],
|
140
142
|
'url' => payload['url'],
|
141
143
|
}
|
@@ -162,9 +164,9 @@ module Twilio
|
|
162
164
|
end
|
163
165
|
|
164
166
|
##
|
165
|
-
# @return [
|
166
|
-
def
|
167
|
-
@properties['
|
167
|
+
# @return [Hash] The realtime
|
168
|
+
def realtime
|
169
|
+
@properties['realtime']
|
168
170
|
end
|
169
171
|
|
170
172
|
##
|
@@ -174,9 +176,9 @@ module Twilio
|
|
174
176
|
end
|
175
177
|
|
176
178
|
##
|
177
|
-
# @return [
|
178
|
-
def
|
179
|
-
@properties['
|
179
|
+
# @return [String] The account_sid
|
180
|
+
def account_sid
|
181
|
+
@properties['account_sid']
|
180
182
|
end
|
181
183
|
|
182
184
|
##
|
@@ -199,8 +201,9 @@ module Twilio
|
|
199
201
|
# @param [String] task_queue_sid The task_queue_sid
|
200
202
|
# @param [String] task_queue_name The task_queue_name
|
201
203
|
# @param [String] friendly_name The friendly_name
|
204
|
+
# @param [String] task_channel The task_channel
|
202
205
|
# @return [WorkersStatisticsInstance] Fetched WorkersStatisticsInstance
|
203
|
-
def fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_queue_sid: :unset, task_queue_name: :unset, friendly_name: :unset)
|
206
|
+
def fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_queue_sid: :unset, task_queue_name: :unset, friendly_name: :unset, task_channel: :unset)
|
204
207
|
context.fetch(
|
205
208
|
minutes: minutes,
|
206
209
|
start_date: start_date,
|
@@ -208,6 +211,7 @@ module Twilio
|
|
208
211
|
task_queue_sid: task_queue_sid,
|
209
212
|
task_queue_name: task_queue_name,
|
210
213
|
friendly_name: friendly_name,
|
214
|
+
task_channel: task_channel,
|
211
215
|
)
|
212
216
|
end
|
213
217
|
|
@@ -211,6 +211,8 @@ module Twilio
|
|
211
211
|
|
212
212
|
# Dependents
|
213
213
|
@statistics = nil
|
214
|
+
@workflow_real_time_statistics = nil
|
215
|
+
@workflow_cumulative_statistics = nil
|
214
216
|
end
|
215
217
|
|
216
218
|
##
|
@@ -284,6 +286,30 @@ module Twilio
|
|
284
286
|
)
|
285
287
|
end
|
286
288
|
|
289
|
+
##
|
290
|
+
# Access the workflow_real_time_statistics
|
291
|
+
# @return [WorkflowRealTimeStatisticsList]
|
292
|
+
# @return [WorkflowRealTimeStatisticsContext]
|
293
|
+
def workflow_real_time_statistics
|
294
|
+
WorkflowRealTimeStatisticsContext.new(
|
295
|
+
@version,
|
296
|
+
@solution[:workspace_sid],
|
297
|
+
@solution[:sid],
|
298
|
+
)
|
299
|
+
end
|
300
|
+
|
301
|
+
##
|
302
|
+
# Access the workflow_cumulative_statistics
|
303
|
+
# @return [WorkflowCumulativeStatisticsList]
|
304
|
+
# @return [WorkflowCumulativeStatisticsContext]
|
305
|
+
def workflow_cumulative_statistics
|
306
|
+
WorkflowCumulativeStatisticsContext.new(
|
307
|
+
@version,
|
308
|
+
@solution[:workspace_sid],
|
309
|
+
@solution[:sid],
|
310
|
+
)
|
311
|
+
end
|
312
|
+
|
287
313
|
##
|
288
314
|
# Provide a user friendly representation
|
289
315
|
def to_s
|
@@ -461,6 +487,20 @@ module Twilio
|
|
461
487
|
context.statistics
|
462
488
|
end
|
463
489
|
|
490
|
+
##
|
491
|
+
# Access the workflow_real_time_statistics
|
492
|
+
# @return [workflow_real_time_statistics] workflow_real_time_statistics
|
493
|
+
def workflow_real_time_statistics
|
494
|
+
context.workflow_real_time_statistics
|
495
|
+
end
|
496
|
+
|
497
|
+
##
|
498
|
+
# Access the workflow_cumulative_statistics
|
499
|
+
# @return [workflow_cumulative_statistics] workflow_cumulative_statistics
|
500
|
+
def workflow_cumulative_statistics
|
501
|
+
context.workflow_cumulative_statistics
|
502
|
+
end
|
503
|
+
|
464
504
|
##
|
465
505
|
# Provide a user friendly representation
|
466
506
|
def to_s
|
@@ -0,0 +1,357 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Taskrouter < Domain
|
10
|
+
class V1 < Version
|
11
|
+
class WorkspaceContext < InstanceContext
|
12
|
+
class WorkflowContext < InstanceContext
|
13
|
+
class WorkflowCumulativeStatisticsList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the WorkflowCumulativeStatisticsList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @param [String] workspace_sid The workspace_sid
|
18
|
+
# @param [String] workflow_sid The workflow_sid
|
19
|
+
# @return [WorkflowCumulativeStatisticsList] WorkflowCumulativeStatisticsList
|
20
|
+
def initialize(version, workspace_sid: nil, workflow_sid: nil)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {
|
25
|
+
workspace_sid: workspace_sid,
|
26
|
+
workflow_sid: workflow_sid
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
##
|
31
|
+
# Provide a user friendly representation
|
32
|
+
def to_s
|
33
|
+
'#<Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsList>'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class WorkflowCumulativeStatisticsPage < Page
|
38
|
+
##
|
39
|
+
# Initialize the WorkflowCumulativeStatisticsPage
|
40
|
+
# @param [Version] version Version that contains the resource
|
41
|
+
# @param [Response] response Response from the API
|
42
|
+
# @param [Hash] solution Path solution for the resource
|
43
|
+
# @return [WorkflowCumulativeStatisticsPage] WorkflowCumulativeStatisticsPage
|
44
|
+
def initialize(version, response, solution)
|
45
|
+
super(version, response)
|
46
|
+
|
47
|
+
# Path Solution
|
48
|
+
@solution = solution
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# Build an instance of WorkflowCumulativeStatisticsInstance
|
53
|
+
# @param [Hash] payload Payload response from the API
|
54
|
+
# @return [WorkflowCumulativeStatisticsInstance] WorkflowCumulativeStatisticsInstance
|
55
|
+
def get_instance(payload)
|
56
|
+
WorkflowCumulativeStatisticsInstance.new(
|
57
|
+
@version,
|
58
|
+
payload,
|
59
|
+
workspace_sid: @solution[:workspace_sid],
|
60
|
+
workflow_sid: @solution[:workflow_sid],
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# Provide a user friendly representation
|
66
|
+
def to_s
|
67
|
+
'<Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsPage>'
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
class WorkflowCumulativeStatisticsContext < InstanceContext
|
72
|
+
##
|
73
|
+
# Initialize the WorkflowCumulativeStatisticsContext
|
74
|
+
# @param [Version] version Version that contains the resource
|
75
|
+
# @param [String] workspace_sid The workspace_sid
|
76
|
+
# @param [String] workflow_sid The workflow_sid
|
77
|
+
# @return [WorkflowCumulativeStatisticsContext] WorkflowCumulativeStatisticsContext
|
78
|
+
def initialize(version, workspace_sid, workflow_sid)
|
79
|
+
super(version)
|
80
|
+
|
81
|
+
# Path Solution
|
82
|
+
@solution = {
|
83
|
+
workspace_sid: workspace_sid,
|
84
|
+
workflow_sid: workflow_sid,
|
85
|
+
}
|
86
|
+
@uri = "/Workspaces/#{@solution[:workspace_sid]}/Workflows/#{@solution[:workflow_sid]}/CumulativeStatistics"
|
87
|
+
end
|
88
|
+
|
89
|
+
##
|
90
|
+
# Fetch a WorkflowCumulativeStatisticsInstance
|
91
|
+
# @param [Time] end_date The end_date
|
92
|
+
# @param [String] minutes The minutes
|
93
|
+
# @param [Time] start_date The start_date
|
94
|
+
# @param [String] task_channel The task_channel
|
95
|
+
# @param [String] split_by_wait_time The split_by_wait_time
|
96
|
+
# @return [WorkflowCumulativeStatisticsInstance] Fetched WorkflowCumulativeStatisticsInstance
|
97
|
+
def fetch(end_date: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset)
|
98
|
+
params = Twilio::Values.of({
|
99
|
+
'EndDate' => Twilio.serialize_iso8601_datetime(end_date),
|
100
|
+
'Minutes' => minutes,
|
101
|
+
'StartDate' => Twilio.serialize_iso8601_datetime(start_date),
|
102
|
+
'TaskChannel' => task_channel,
|
103
|
+
'SplitByWaitTime' => split_by_wait_time,
|
104
|
+
})
|
105
|
+
|
106
|
+
payload = @version.fetch(
|
107
|
+
'GET',
|
108
|
+
@uri,
|
109
|
+
params,
|
110
|
+
)
|
111
|
+
|
112
|
+
WorkflowCumulativeStatisticsInstance.new(
|
113
|
+
@version,
|
114
|
+
payload,
|
115
|
+
workspace_sid: @solution[:workspace_sid],
|
116
|
+
workflow_sid: @solution[:workflow_sid],
|
117
|
+
)
|
118
|
+
end
|
119
|
+
|
120
|
+
##
|
121
|
+
# Provide a user friendly representation
|
122
|
+
def to_s
|
123
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
124
|
+
"#<Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsContext #{context}>"
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
class WorkflowCumulativeStatisticsInstance < InstanceResource
|
129
|
+
##
|
130
|
+
# Initialize the WorkflowCumulativeStatisticsInstance
|
131
|
+
# @param [Version] version Version that contains the resource
|
132
|
+
# @param [Hash] payload payload that contains response from Twilio
|
133
|
+
# @param [String] workspace_sid The workspace_sid
|
134
|
+
# @param [String] workflow_sid The workflow_sid
|
135
|
+
# @return [WorkflowCumulativeStatisticsInstance] WorkflowCumulativeStatisticsInstance
|
136
|
+
def initialize(version, payload, workspace_sid: nil, workflow_sid: nil)
|
137
|
+
super(version)
|
138
|
+
|
139
|
+
# Marshaled Properties
|
140
|
+
@properties = {
|
141
|
+
'account_sid' => payload['account_sid'],
|
142
|
+
'avg_task_acceptance_time' => payload['avg_task_acceptance_time'].to_i,
|
143
|
+
'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']),
|
144
|
+
'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
|
145
|
+
'reservations_created' => payload['reservations_created'].to_i,
|
146
|
+
'reservations_accepted' => payload['reservations_accepted'].to_i,
|
147
|
+
'reservations_rejected' => payload['reservations_rejected'].to_i,
|
148
|
+
'reservations_timed_out' => payload['reservations_timed_out'].to_i,
|
149
|
+
'reservations_canceled' => payload['reservations_canceled'].to_i,
|
150
|
+
'reservations_rescinded' => payload['reservations_rescinded'].to_i,
|
151
|
+
'split_by_wait_time' => payload['split_by_wait_time'],
|
152
|
+
'wait_duration_until_accepted' => payload['wait_duration_until_accepted'],
|
153
|
+
'wait_duration_until_canceled' => payload['wait_duration_until_canceled'],
|
154
|
+
'tasks_canceled' => payload['tasks_canceled'].to_i,
|
155
|
+
'tasks_completed' => payload['tasks_completed'].to_i,
|
156
|
+
'tasks_entered' => payload['tasks_entered'].to_i,
|
157
|
+
'tasks_deleted' => payload['tasks_deleted'].to_i,
|
158
|
+
'tasks_moved' => payload['tasks_moved'].to_i,
|
159
|
+
'tasks_timed_out_in_workflow' => payload['tasks_timed_out_in_workflow'].to_i,
|
160
|
+
'workflow_sid' => payload['workflow_sid'],
|
161
|
+
'workspace_sid' => payload['workspace_sid'],
|
162
|
+
'url' => payload['url'],
|
163
|
+
}
|
164
|
+
|
165
|
+
# Context
|
166
|
+
@instance_context = nil
|
167
|
+
@params = {
|
168
|
+
'workspace_sid' => workspace_sid,
|
169
|
+
'workflow_sid' => workflow_sid,
|
170
|
+
}
|
171
|
+
end
|
172
|
+
|
173
|
+
##
|
174
|
+
# Generate an instance context for the instance, the context is capable of
|
175
|
+
# performing various actions. All instance actions are proxied to the context
|
176
|
+
# @return [WorkflowCumulativeStatisticsContext] WorkflowCumulativeStatisticsContext for this WorkflowCumulativeStatisticsInstance
|
177
|
+
def context
|
178
|
+
unless @instance_context
|
179
|
+
@instance_context = WorkflowCumulativeStatisticsContext.new(
|
180
|
+
@version,
|
181
|
+
@params['workspace_sid'],
|
182
|
+
@params['workflow_sid'],
|
183
|
+
)
|
184
|
+
end
|
185
|
+
@instance_context
|
186
|
+
end
|
187
|
+
|
188
|
+
##
|
189
|
+
# @return [String] The account_sid
|
190
|
+
def account_sid
|
191
|
+
@properties['account_sid']
|
192
|
+
end
|
193
|
+
|
194
|
+
##
|
195
|
+
# @return [String] The avg_task_acceptance_time
|
196
|
+
def avg_task_acceptance_time
|
197
|
+
@properties['avg_task_acceptance_time']
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# @return [Time] The start_time
|
202
|
+
def start_time
|
203
|
+
@properties['start_time']
|
204
|
+
end
|
205
|
+
|
206
|
+
##
|
207
|
+
# @return [Time] The end_time
|
208
|
+
def end_time
|
209
|
+
@properties['end_time']
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# @return [String] The reservations_created
|
214
|
+
def reservations_created
|
215
|
+
@properties['reservations_created']
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# @return [String] The reservations_accepted
|
220
|
+
def reservations_accepted
|
221
|
+
@properties['reservations_accepted']
|
222
|
+
end
|
223
|
+
|
224
|
+
##
|
225
|
+
# @return [String] The reservations_rejected
|
226
|
+
def reservations_rejected
|
227
|
+
@properties['reservations_rejected']
|
228
|
+
end
|
229
|
+
|
230
|
+
##
|
231
|
+
# @return [String] The reservations_timed_out
|
232
|
+
def reservations_timed_out
|
233
|
+
@properties['reservations_timed_out']
|
234
|
+
end
|
235
|
+
|
236
|
+
##
|
237
|
+
# @return [String] The reservations_canceled
|
238
|
+
def reservations_canceled
|
239
|
+
@properties['reservations_canceled']
|
240
|
+
end
|
241
|
+
|
242
|
+
##
|
243
|
+
# @return [String] The reservations_rescinded
|
244
|
+
def reservations_rescinded
|
245
|
+
@properties['reservations_rescinded']
|
246
|
+
end
|
247
|
+
|
248
|
+
##
|
249
|
+
# @return [Hash] The split_by_wait_time
|
250
|
+
def split_by_wait_time
|
251
|
+
@properties['split_by_wait_time']
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# @return [Hash] The wait_duration_until_accepted
|
256
|
+
def wait_duration_until_accepted
|
257
|
+
@properties['wait_duration_until_accepted']
|
258
|
+
end
|
259
|
+
|
260
|
+
##
|
261
|
+
# @return [Hash] The wait_duration_until_canceled
|
262
|
+
def wait_duration_until_canceled
|
263
|
+
@properties['wait_duration_until_canceled']
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# @return [String] The tasks_canceled
|
268
|
+
def tasks_canceled
|
269
|
+
@properties['tasks_canceled']
|
270
|
+
end
|
271
|
+
|
272
|
+
##
|
273
|
+
# @return [String] The tasks_completed
|
274
|
+
def tasks_completed
|
275
|
+
@properties['tasks_completed']
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# @return [String] The tasks_entered
|
280
|
+
def tasks_entered
|
281
|
+
@properties['tasks_entered']
|
282
|
+
end
|
283
|
+
|
284
|
+
##
|
285
|
+
# @return [String] The tasks_deleted
|
286
|
+
def tasks_deleted
|
287
|
+
@properties['tasks_deleted']
|
288
|
+
end
|
289
|
+
|
290
|
+
##
|
291
|
+
# @return [String] The tasks_moved
|
292
|
+
def tasks_moved
|
293
|
+
@properties['tasks_moved']
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# @return [String] The tasks_timed_out_in_workflow
|
298
|
+
def tasks_timed_out_in_workflow
|
299
|
+
@properties['tasks_timed_out_in_workflow']
|
300
|
+
end
|
301
|
+
|
302
|
+
##
|
303
|
+
# @return [String] The workflow_sid
|
304
|
+
def workflow_sid
|
305
|
+
@properties['workflow_sid']
|
306
|
+
end
|
307
|
+
|
308
|
+
##
|
309
|
+
# @return [String] The workspace_sid
|
310
|
+
def workspace_sid
|
311
|
+
@properties['workspace_sid']
|
312
|
+
end
|
313
|
+
|
314
|
+
##
|
315
|
+
# @return [String] The url
|
316
|
+
def url
|
317
|
+
@properties['url']
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# Fetch a WorkflowCumulativeStatisticsInstance
|
322
|
+
# @param [Time] end_date The end_date
|
323
|
+
# @param [String] minutes The minutes
|
324
|
+
# @param [Time] start_date The start_date
|
325
|
+
# @param [String] task_channel The task_channel
|
326
|
+
# @param [String] split_by_wait_time The split_by_wait_time
|
327
|
+
# @return [WorkflowCumulativeStatisticsInstance] Fetched WorkflowCumulativeStatisticsInstance
|
328
|
+
def fetch(end_date: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset)
|
329
|
+
context.fetch(
|
330
|
+
end_date: end_date,
|
331
|
+
minutes: minutes,
|
332
|
+
start_date: start_date,
|
333
|
+
task_channel: task_channel,
|
334
|
+
split_by_wait_time: split_by_wait_time,
|
335
|
+
)
|
336
|
+
end
|
337
|
+
|
338
|
+
##
|
339
|
+
# Provide a user friendly representation
|
340
|
+
def to_s
|
341
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
342
|
+
"<Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsInstance #{values}>"
|
343
|
+
end
|
344
|
+
|
345
|
+
##
|
346
|
+
# Provide a detailed, user friendly representation
|
347
|
+
def inspect
|
348
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
349
|
+
"<Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsInstance #{values}>"
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
353
|
+
end
|
354
|
+
end
|
355
|
+
end
|
356
|
+
end
|
357
|
+
end
|