com.twilio.sdk.resource.instance.taskrouter.WorkersStatistics Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio-java-sdk Show documentation
Show all versions of twilio-java-sdk Show documentation
Release Candidate for Next-Gen Twilio Java Helper Library
package com.twilio.sdk.resource.instance.taskrouter;
import com.twilio.sdk.TwilioTaskRouterClient;
import com.twilio.sdk.resource.NextGenInstanceResource;
import java.util.Calendar;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
/**
* Statistics about workers.
* See the TaskRouter documentation.
*/
public class WorkersStatistics extends NextGenInstanceResource {
private static final String CUMULATIVE_PROPERTY = "cumulative";
private static final String REALTIME_PROPERTY = "realtime";
private static final String WORKSPACE_SID_PROPERTY = "workspace_sid";
/**
* Instantiates a worker statistics.
*
* @param client the client
* @param workspaceSid the workspace sid
*/
public WorkersStatistics(final TwilioTaskRouterClient client, final String workspaceSid) {
this(client, workspaceSid, null);
}
/**
* Instantiates a worker statistics.
*
* @param client the client
* @param workspaceSid the workspace sid
* @param filters the filters
*/
public WorkersStatistics(final TwilioTaskRouterClient client, final String workspaceSid,
final Map filters) {
super(client);
if (StringUtils.isBlank(workspaceSid)) {
throw new IllegalArgumentException("The workspaceSid for a WorkerStatistics cannot be null");
}
setProperty(WORKSPACE_SID_PROPERTY, workspaceSid);
this.filters = filters;
}
/**
* Get the activity durations.
*
* @return the activity durations
*/
public Set getActivityDurations() {
try {
List