class Twilio::REST::Taskrouter::V1::WorkspaceContext::ActivityInstance

Public Class Methods

new(version, payload, workspace_sid: nil, sid: nil) click to toggle source

Initialize the ActivityInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] workspace_sid The SID of the Workspace that contains the

Activity.

@param [String] sid The SID of the Activity resource to fetch. @return [ActivityInstance] ActivityInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
272 def initialize(version, payload, workspace_sid: nil, sid: nil)
273   super(version)
274 
275   # Marshaled Properties
276   @properties = {
277       'account_sid' => payload['account_sid'],
278       'available' => payload['available'],
279       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
280       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
281       'friendly_name' => payload['friendly_name'],
282       'sid' => payload['sid'],
283       'workspace_sid' => payload['workspace_sid'],
284       'url' => payload['url'],
285       'links' => payload['links'],
286   }
287 
288   # Context
289   @instance_context = nil
290   @params = {'workspace_sid' => workspace_sid, 'sid' => sid || @properties['sid'], }
291 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
306 def account_sid
307   @properties['account_sid']
308 end
available() click to toggle source

@return [Boolean] Whether the Worker should be eligible to receive a Task when it occupies the Activity

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
312 def available
313   @properties['available']
314 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ActivityContext] ActivityContext for this ActivityInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
297 def context
298   unless @instance_context
299     @instance_context = ActivityContext.new(@version, @params['workspace_sid'], @params['sid'], )
300   end
301   @instance_context
302 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
318 def date_created
319   @properties['date_created']
320 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
324 def date_updated
325   @properties['date_updated']
326 end
delete() click to toggle source

Delete the ActivityInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
380 def delete
381   context.delete
382 end
fetch() click to toggle source

Fetch the ActivityInstance @return [ActivityInstance] Fetched ActivityInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
361 def fetch
362   context.fetch
363 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the Activity resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
330 def friendly_name
331   @properties['friendly_name']
332 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
393 def inspect
394   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
395   "<Twilio.Taskrouter.V1.ActivityInstance #{values}>"
396 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
336 def sid
337   @properties['sid']
338 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
386 def to_s
387   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
388   "<Twilio.Taskrouter.V1.ActivityInstance #{values}>"
389 end
update(friendly_name: :unset) click to toggle source

Update the ActivityInstance @param [String] friendly_name A descriptive string that you create to describe

the Activity resource. It can be up to 64 characters long. These names are used
to calculate and expose statistics about Workers, and provide visibility into
the state of each Worker. Examples of friendly names include: `on-call`,
`break`, and `email`.

@return [ActivityInstance] Updated ActivityInstance

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
373 def update(friendly_name: :unset)
374   context.update(friendly_name: friendly_name, )
375 end
url() click to toggle source

@return [String] The absolute URL of the Activity resource

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
348 def url
349   @properties['url']
350 end
workspace_sid() click to toggle source

@return [String] The SID of the Workspace that contains the Activity

    # File lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb
342 def workspace_sid
343   @properties['workspace_sid']
344 end