public class Worker extends NextGenInstanceResource<TwilioTaskRouterClient>
| Constructor and Description |
|---|
Worker(TwilioTaskRouterClient client)
Instantiates a worker.
|
Worker(TwilioTaskRouterClient client,
Map<String,Object> properties)
Instantiates a worker.
|
Worker(TwilioTaskRouterClient client,
String workspaceSid,
String workerSid)
Instantiates a worker.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAccountSid()
The ID of the
Account that owns this worker. |
String |
getActivityName()
String describing the worker's current activity, for example 'on-call', 'after-call-work', 'break', etc.
|
String |
getActivitySid()
The ID of the
Activity this Worker is currently performing. |
String |
getAttributes()
A user-defined JSON object describing this Worker.
|
Date |
getDateCreated()
The date and time this Worker was created.
|
Date |
getDateStatusChanged()
The date and time this Worker's Activity status last changed.
|
Date |
getDateUpdated()
The date and time this Worker was last updated.
|
String |
getFriendlyName()
A human-readable name for this Worker.
|
WorkerReservationList |
getReservations()
Retrieves the
WorkerReservationList for this Workspace. |
WorkerReservationList |
getReservations(Map<String,String> filters)
Retrieves the
WorkerReservationList for this Workspace. |
String |
getSid()
This Worker's unique ID.
|
WorkerStatistics |
getStatistics()
Get worker statistics.
|
WorkerStatistics |
getWorkerStatistics(Map<String,String> filters)
Get worker statistics.
|
WorkerStatistics |
getWorkerStatistics(StatisticsQueryBuilder queryBuilder)
Get worker statistics.
|
String |
getWorkspaceSid()
The ID of the
Workspace containing this Worker. |
boolean |
isAvailable()
Whether this Worker can be assigned another
Task. |
Map<String,Object> |
parseAttributes()
A map that represents the JSON describing this Worker.
|
void |
update(Map<String,String> attributes,
String friendlyName,
String activitySid)
Update a worker's attributes and/or friendly name and/or activity
|
void |
updateActivity(String activitySid)
Update a worker's activity
|
getCastedObject, getObject, getProperty, getPropertyAsInteger, toJSON, update, updatesetRequestAccountSidpublic Worker(TwilioTaskRouterClient client)
client - the clientpublic Worker(TwilioTaskRouterClient client, Map<String,Object> properties)
client - the clientproperties - the propertiespublic Worker(TwilioTaskRouterClient client, String workspaceSid, String workerSid)
client - the clientworkspaceSid - the workspace sidworkerSid - the worker sidpublic void update(Map<String,String> attributes, String friendlyName, String activitySid) throws TwilioRestException
attributes - attributes of a workerfriendlyName - friendly name of a workeractivitySid - activity of a workerTwilioRestExceptionpublic void updateActivity(String activitySid) throws TwilioRestException
activitySid - the activitysid to update the worker toTwilioRestExceptionpublic String getAccountSid()
Account that owns this worker.public String getActivityName()
public String getActivitySid()
Activity this Worker is currently performing.public String getAttributes()
public Map<String,Object> parseAttributes() throws org.json.simple.parser.ParseException
org.json.simple.parser.ParseExceptionpublic Date getDateCreated()
public Date getDateStatusChanged()
public Date getDateUpdated()
public String getFriendlyName()
public String getSid()
public String getWorkspaceSid()
Workspace containing this Worker.public boolean isAvailable()
Task.public WorkerStatistics getStatistics()
public WorkerStatistics getWorkerStatistics(StatisticsQueryBuilder queryBuilder)
queryBuilder - query builder which contains all parameters for the stats query requestpublic WorkerStatistics getWorkerStatistics(Map<String,String> filters)
filters - the filterspublic WorkerReservationList getReservations()
WorkerReservationList for this Workspace.WorkerReservationListpublic WorkerReservationList getReservations(Map<String,String> filters)
WorkerReservationList for this Workspace.filters - for reservationsWorkerReservationListCopyright © 2011 Twilio, Inc. All Rights Reserved.