Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkspaceStatisticsContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkspaceStatisticsContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb
Instance Method Summary collapse
-
#fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_channel: :unset, split_by_wait_time: :unset) ⇒ WorkspaceStatisticsInstance
Fetch the WorkspaceStatisticsInstance.
-
#initialize(version, workspace_sid) ⇒ WorkspaceStatisticsContext
constructor
Initialize the WorkspaceStatisticsContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, workspace_sid) ⇒ WorkspaceStatisticsContext
Initialize the WorkspaceStatisticsContext
50 51 52 53 54 55 56 57 58 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb', line 50 def initialize(version, workspace_sid) super(version) # Path Solution @solution = { workspace_sid: workspace_sid, } @uri = "/Workspaces/#{@solution[:workspace_sid]}/Statistics" end |
Instance Method Details
#fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_channel: :unset, split_by_wait_time: :unset) ⇒ WorkspaceStatisticsInstance
Fetch the WorkspaceStatisticsInstance
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb', line 67 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, }) payload = @version.fetch('GET', @uri, params: params) WorkspaceStatisticsInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
100 101 102 103 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb', line 100 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkspaceStatisticsContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
93 94 95 96 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb', line 93 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkspaceStatisticsContext #{context}>" end |