Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkflowContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkflowContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb,
lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb
Defined Under Namespace
Classes: WorkflowCumulativeStatisticsContext, WorkflowCumulativeStatisticsInstance, WorkflowCumulativeStatisticsList, WorkflowCumulativeStatisticsPage, WorkflowRealTimeStatisticsContext, WorkflowRealTimeStatisticsInstance, WorkflowRealTimeStatisticsList, WorkflowRealTimeStatisticsPage, WorkflowStatisticsContext, WorkflowStatisticsInstance, WorkflowStatisticsList, WorkflowStatisticsPage
Instance Method Summary collapse
-
#cumulative_statistics ⇒ WorkflowCumulativeStatisticsList, WorkflowCumulativeStatisticsContext
Access the cumulative_statistics.
-
#delete ⇒ Boolean
Delete the WorkflowInstance.
-
#fetch ⇒ WorkflowInstance
Fetch the WorkflowInstance.
-
#initialize(version, workspace_sid, sid) ⇒ WorkflowContext
constructor
Initialize the WorkflowContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#real_time_statistics ⇒ WorkflowRealTimeStatisticsList, WorkflowRealTimeStatisticsContext
Access the real_time_statistics.
-
#statistics ⇒ WorkflowStatisticsList, WorkflowStatisticsContext
Access the statistics.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, assignment_callback_url: :unset, fallback_assignment_callback_url: :unset, configuration: :unset, task_reservation_timeout: :unset, re_evaluate_tasks: :unset) ⇒ WorkflowInstance
Update the WorkflowInstance.
Constructor Details
#initialize(version, workspace_sid, sid) ⇒ WorkflowContext
Initialize the WorkflowContext
183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 183 def initialize(version, workspace_sid, sid) super(version) # Path Solution @solution = { workspace_sid: workspace_sid, sid: sid, } @uri = "/Workspaces/#{@solution[:workspace_sid]}/Workflows/#{@solution[:sid]}" # Dependents @statistics = nil @cumulative_statistics = nil @real_time_statistics = nil end |
Instance Method Details
#cumulative_statistics ⇒ WorkflowCumulativeStatisticsList, WorkflowCumulativeStatisticsContext
Access the cumulative_statistics
284 285 286 287 288 289 290 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 284 def cumulative_statistics WorkflowCumulativeStatisticsContext.new( @version, @solution[:workspace_sid], @solution[:sid] ) end |
#delete ⇒ Boolean
Delete the WorkflowInstance
198 199 200 201 202 203 204 205 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 198 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ WorkflowInstance
Fetch the WorkflowInstance
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 210 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) WorkflowInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
312 313 314 315 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 312 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkflowContext #{context}>" end |
#real_time_statistics ⇒ WorkflowRealTimeStatisticsList, WorkflowRealTimeStatisticsContext
Access the real_time_statistics
295 296 297 298 299 300 301 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 295 def real_time_statistics WorkflowRealTimeStatisticsContext.new( @version, @solution[:workspace_sid], @solution[:sid] ) end |
#statistics ⇒ WorkflowStatisticsList, WorkflowStatisticsContext
Access the statistics
273 274 275 276 277 278 279 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 273 def statistics WorkflowStatisticsContext.new( @version, @solution[:workspace_sid], @solution[:sid] ) end |
#to_s ⇒ Object
Provide a user friendly representation
305 306 307 308 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 305 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkflowContext #{context}>" end |
#update(friendly_name: :unset, assignment_callback_url: :unset, fallback_assignment_callback_url: :unset, configuration: :unset, task_reservation_timeout: :unset, re_evaluate_tasks: :unset) ⇒ WorkflowInstance
Update the WorkflowInstance
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 236 def update( friendly_name: :unset, assignment_callback_url: :unset, fallback_assignment_callback_url: :unset, configuration: :unset, task_reservation_timeout: :unset, re_evaluate_tasks: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'AssignmentCallbackUrl' => assignment_callback_url, 'FallbackAssignmentCallbackUrl' => fallback_assignment_callback_url, 'Configuration' => configuration, 'TaskReservationTimeout' => task_reservation_timeout, 'ReEvaluateTasks' => re_evaluate_tasks, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) WorkflowInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |