Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkflowContext::WorkflowStatisticsInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, workspace_sid: nil, workflow_sid: nil) ⇒ WorkflowStatisticsInstance

Initialize the WorkflowStatisticsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • workspace_sid (String) (defaults to: nil)

    The workspace_sid

  • workflow_sid (String) (defaults to: nil)

    The workflow_sid



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 136

def initialize(version, payload, workspace_sid: nil, workflow_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'cumulative' => payload['cumulative'],
      'realtime' => payload['realtime'],
      'workflow_sid' => payload['workflow_sid'],
      'workspace_sid' => payload['workspace_sid'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {
      'workspace_sid' => workspace_sid,
      'workflow_sid' => workflow_sid,
  }
end

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid



174
175
176
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 174

def 
  @properties['account_sid']
end

#contextWorkflowStatisticsContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



161
162
163
164
165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 161

def context
  unless @instance_context
    @instance_context = WorkflowStatisticsContext.new(
        @version,
        @params['workspace_sid'],
        @params['workflow_sid'],
    )
  end
  @instance_context
end

#cumulativeHash

Returns The cumulative.

Returns:

  • (Hash)

    The cumulative



180
181
182
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 180

def cumulative
  @properties['cumulative']
end

#fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_channel: :unset, split_by_wait_time: :unset) ⇒ WorkflowStatisticsInstance

Fetch a WorkflowStatisticsInstance

Parameters:

  • minutes (String) (defaults to: :unset)

    The minutes

  • start_date (Time) (defaults to: :unset)

    The start_date

  • end_date (Time) (defaults to: :unset)

    The end_date

  • task_channel (String) (defaults to: :unset)

    The task_channel

  • split_by_wait_time (String) (defaults to: :unset)

    The split_by_wait_time

Returns:



216
217
218
219
220
221
222
223
224
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 216

def fetch(minutes: :unset, start_date: :unset, end_date: :unset, task_channel: :unset, split_by_wait_time: :unset)
  context.fetch(
      minutes: minutes,
      start_date: start_date,
      end_date: end_date,
      task_channel: task_channel,
      split_by_wait_time: split_by_wait_time,
  )
end

#inspectObject

Provide a detailed, user friendly representation



235
236
237
238
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 235

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Taskrouter.V1.WorkflowStatisticsInstance #{values}>"
end

#realtimeHash

Returns The realtime.

Returns:

  • (Hash)

    The realtime



186
187
188
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 186

def realtime
  @properties['realtime']
end

#to_sObject

Provide a user friendly representation



228
229
230
231
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 228

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Taskrouter.V1.WorkflowStatisticsInstance #{values}>"
end

#urlString

Returns The url.

Returns:

  • (String)

    The url



204
205
206
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 204

def url
  @properties['url']
end

#workflow_sidString

Returns The workflow_sid.

Returns:

  • (String)

    The workflow_sid



192
193
194
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 192

def workflow_sid
  @properties['workflow_sid']
end

#workspace_sidString

Returns The workspace_sid.

Returns:

  • (String)

    The workspace_sid



198
199
200
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb', line 198

def workspace_sid
  @properties['workspace_sid']
end