Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkflowContext::WorkflowStatisticsContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkflowContext::WorkflowStatisticsContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb
Instance Method Summary collapse
-
#fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_channel: :unset, split_by_wait_time: :unset) ⇒ WorkflowStatisticsInstance
Fetch the WorkflowStatisticsInstance.
-
#initialize(version, workspace_sid, workflow_sid) ⇒ WorkflowStatisticsContext
constructor
Initialize the WorkflowStatisticsContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, workspace_sid, workflow_sid) ⇒ WorkflowStatisticsContext
Initialize the WorkflowStatisticsContext
53 54 55 56 57 58 59 60 61 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 53 def initialize(version, workspace_sid, workflow_sid) super(version) # Path Solution @solution = { workspace_sid: workspace_sid, workflow_sid: workflow_sid, } @uri = "/Workspaces/#{@solution[:workspace_sid]}/Workflows/#{@solution[:workflow_sid]}/Statistics" end |
Instance Method Details
#fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_channel: :unset, split_by_wait_time: :unset) ⇒ WorkflowStatisticsInstance
Fetch the WorkflowStatisticsInstance
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 70 def fetch( minutes: :unset, start_date: :unset, end_date: :unset, task_channel: :unset, split_by_wait_time: :unset ) params = Twilio::Values.of({ 'Minutes' => minutes, 'StartDate' => Twilio.serialize_iso8601_datetime(start_date), 'EndDate' => Twilio.serialize_iso8601_datetime(end_date), 'TaskChannel' => task_channel, 'SplitByWaitTime' => split_by_wait_time, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) WorkflowStatisticsInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], workflow_sid: @solution[:workflow_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
110 111 112 113 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 110 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkflowStatisticsContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
103 104 105 106 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 103 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkflowStatisticsContext #{context}>" end |