com.twilio.sdk.resource.instance.taskrouter.TaskQueueStatistics 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;
/**
* Statistics about task distribution.
* See the TaskRouter documentation.
*/
public class TaskQueueStatistics extends NextGenInstanceResource {
private static final String CUMULATIVE_PROPERTY = "cumulative";
private static final String REALTIME_PROPERTY = "realtime";
private static final String TASKS_BY_STATUS_PROPERTY = "tasks_by_status";
private static final String TASK_QUEUE_SID_PROPERTY = "task_queue_sid";
private static final String WORKSPACE_SID_PROPERTY = "workspace_sid";
/**
* Instantiates a queue statistics.
*
* @param client the client
* @param workspaceSid the workspace sid
* @param queueSid the queue sid
*/
public TaskQueueStatistics(final TwilioTaskRouterClient client, final String workspaceSid, final String queueSid) {
this(client, workspaceSid, queueSid, null);
}
/**
* Instantiates a queue statistics.
*
* @param client the client
* @param workspaceSid the workspace sid
* @param queueSid the queue sid
* @param filters the filters
*/
public TaskQueueStatistics(final TwilioTaskRouterClient client, final String workspaceSid, final String queueSid,
final Map filters) {
this(client, workspaceSid, queueSid, filters, null);
}
/**
* Instantiates a queue statistics.
*
* @param client the client
* @param workspaceSid the workspace sid
* @param queueSid the queue sid
* @param filters the filters
* @param properties the properties
*/
public TaskQueueStatistics(final TwilioTaskRouterClient client, final String workspaceSid, final String queueSid,
final Map filters, final Map properties) {
super(client, properties);
if (workspaceSid == null || "".equals(workspaceSid)) {
throw new IllegalArgumentException("The workspaceSid for a TaskQueueStatistics cannot be null");
}
if (queueSid == null || "".equals(queueSid)) {
throw new IllegalArgumentException("The queueSid for a TaskQueueStatistics cannot be null");
}
setProperty(WORKSPACE_SID_PROPERTY, workspaceSid);
setProperty(TASK_QUEUE_SID_PROPERTY, queueSid);
this.filters = filters;
}
/**
* Get the activity statistics.
*
* @return the activity statistics
*/
public Set getActivityStatistics() {
try {
List