com.twilio.rest.taskrouter.v1.workspace.taskqueue.TaskQueueCumulativeStatistics Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio Show documentation
Show all versions of twilio Show documentation
Twilio Java Helper Library
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
package com.twilio.rest.taskrouter.v1.workspace.taskqueue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.MoreObjects;
import com.twilio.base.Resource;
import com.twilio.converter.Converter;
import com.twilio.converter.DateConverter;
import com.twilio.exception.ApiConnectionException;
import com.twilio.exception.ApiException;
import com.twilio.exception.RestException;
import com.twilio.http.HttpMethod;
import com.twilio.http.Request;
import com.twilio.http.Response;
import com.twilio.http.TwilioRestClient;
import com.twilio.rest.Domains;
import org.joda.time.DateTime;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Map;
import java.util.Objects;
@JsonIgnoreProperties(ignoreUnknown = true)
public class TaskQueueCumulativeStatistics extends Resource {
private static final long serialVersionUID = 150757949753643L;
/**
* Create a TaskQueueCumulativeStatisticsFetcher to execute fetch.
*
* @param pathWorkspaceSid The workspace_sid
* @param pathTaskQueueSid The task_queue_sid
* @return TaskQueueCumulativeStatisticsFetcher capable of executing the fetch
*/
public static TaskQueueCumulativeStatisticsFetcher fetcher(final String pathWorkspaceSid,
final String pathTaskQueueSid) {
return new TaskQueueCumulativeStatisticsFetcher(pathWorkspaceSid, pathTaskQueueSid);
}
/**
* Converts a JSON String into a TaskQueueCumulativeStatistics object using the
* provided ObjectMapper.
*
* @param json Raw JSON String
* @param objectMapper Jackson ObjectMapper
* @return TaskQueueCumulativeStatistics object represented by the provided JSON
*/
public static TaskQueueCumulativeStatistics fromJson(final String json, final ObjectMapper objectMapper) {
// Convert all checked exceptions to Runtime
try {
return objectMapper.readValue(json, TaskQueueCumulativeStatistics.class);
} catch (final JsonMappingException | JsonParseException e) {
throw new ApiException(e.getMessage(), e);
} catch (final IOException e) {
throw new ApiConnectionException(e.getMessage(), e);
}
}
/**
* Converts a JSON InputStream into a TaskQueueCumulativeStatistics object using
* the provided ObjectMapper.
*
* @param json Raw JSON InputStream
* @param objectMapper Jackson ObjectMapper
* @return TaskQueueCumulativeStatistics object represented by the provided JSON
*/
public static TaskQueueCumulativeStatistics fromJson(final InputStream json, final ObjectMapper objectMapper) {
// Convert all checked exceptions to Runtime
try {
return objectMapper.readValue(json, TaskQueueCumulativeStatistics.class);
} catch (final JsonMappingException | JsonParseException e) {
throw new ApiException(e.getMessage(), e);
} catch (final IOException e) {
throw new ApiConnectionException(e.getMessage(), e);
}
}
private final String accountSid;
private final Integer avgTaskAcceptanceTime;
private final DateTime startTime;
private final DateTime endTime;
private final Integer reservationsCreated;
private final Integer reservationsAccepted;
private final Integer reservationsRejected;
private final Integer reservationsTimedOut;
private final Integer reservationsCanceled;
private final Integer reservationsRescinded;
private final Map splitByWaitTime;
private final String taskQueueSid;
private final Map waitDurationUntilAccepted;
private final Map waitDurationUntilCanceled;
private final Integer tasksCanceled;
private final Integer tasksCompleted;
private final Integer tasksDeleted;
private final Integer tasksEntered;
private final Integer tasksMoved;
private final String workspaceSid;
private final URI url;
@JsonCreator
private TaskQueueCumulativeStatistics(@JsonProperty("account_sid")
final String accountSid,
@JsonProperty("avg_task_acceptance_time")
final Integer avgTaskAcceptanceTime,
@JsonProperty("start_time")
final String startTime,
@JsonProperty("end_time")
final String endTime,
@JsonProperty("reservations_created")
final Integer reservationsCreated,
@JsonProperty("reservations_accepted")
final Integer reservationsAccepted,
@JsonProperty("reservations_rejected")
final Integer reservationsRejected,
@JsonProperty("reservations_timed_out")
final Integer reservationsTimedOut,
@JsonProperty("reservations_canceled")
final Integer reservationsCanceled,
@JsonProperty("reservations_rescinded")
final Integer reservationsRescinded,
@JsonProperty("split_by_wait_time")
final Map splitByWaitTime,
@JsonProperty("task_queue_sid")
final String taskQueueSid,
@JsonProperty("wait_duration_until_accepted")
final Map waitDurationUntilAccepted,
@JsonProperty("wait_duration_until_canceled")
final Map waitDurationUntilCanceled,
@JsonProperty("tasks_canceled")
final Integer tasksCanceled,
@JsonProperty("tasks_completed")
final Integer tasksCompleted,
@JsonProperty("tasks_deleted")
final Integer tasksDeleted,
@JsonProperty("tasks_entered")
final Integer tasksEntered,
@JsonProperty("tasks_moved")
final Integer tasksMoved,
@JsonProperty("workspace_sid")
final String workspaceSid,
@JsonProperty("url")
final URI url) {
this.accountSid = accountSid;
this.avgTaskAcceptanceTime = avgTaskAcceptanceTime;
this.startTime = DateConverter.iso8601DateTimeFromString(startTime);
this.endTime = DateConverter.iso8601DateTimeFromString(endTime);
this.reservationsCreated = reservationsCreated;
this.reservationsAccepted = reservationsAccepted;
this.reservationsRejected = reservationsRejected;
this.reservationsTimedOut = reservationsTimedOut;
this.reservationsCanceled = reservationsCanceled;
this.reservationsRescinded = reservationsRescinded;
this.splitByWaitTime = splitByWaitTime;
this.taskQueueSid = taskQueueSid;
this.waitDurationUntilAccepted = waitDurationUntilAccepted;
this.waitDurationUntilCanceled = waitDurationUntilCanceled;
this.tasksCanceled = tasksCanceled;
this.tasksCompleted = tasksCompleted;
this.tasksDeleted = tasksDeleted;
this.tasksEntered = tasksEntered;
this.tasksMoved = tasksMoved;
this.workspaceSid = workspaceSid;
this.url = url;
}
/**
* Returns The The account_sid.
*
* @return The account_sid
*/
public final String getAccountSid() {
return this.accountSid;
}
/**
* Returns The The average time from Task creation to reservation acceptance
* while in this TaskQueue.
*
* @return The average time from Task creation to reservation acceptance while
* in this TaskQueue
*/
public final Integer getAvgTaskAcceptanceTime() {
return this.avgTaskAcceptanceTime;
}
/**
* Returns The The start_time.
*
* @return The start_time
*/
public final DateTime getStartTime() {
return this.startTime;
}
/**
* Returns The The end_time.
*
* @return The end_time
*/
public final DateTime getEndTime() {
return this.endTime;
}
/**
* Returns The The total number of Reservations that were created for Tasks
* while in this TaskQueue.
*
* @return The total number of Reservations that were created for Tasks while
* in this TaskQueue
*/
public final Integer getReservationsCreated() {
return this.reservationsCreated;
}
/**
* Returns The The total number of Reservations that were accepted for Tasks
* while in this TaskQueue.
*
* @return The total number of Reservations that were accepted for Tasks while
* in this TaskQueue
*/
public final Integer getReservationsAccepted() {
return this.reservationsAccepted;
}
/**
* Returns The The total number of Reservations that were rejected for Tasks
* while in this TaskQueue.
*
* @return The total number of Reservations that were rejected for Tasks while
* in this TaskQueue
*/
public final Integer getReservationsRejected() {
return this.reservationsRejected;
}
/**
* Returns The The total number of Reservations that were timed out for Tasks
* while in this TaskQueue.
*
* @return The total number of Reservations that were timed out for Tasks while
* in this TaskQueue
*/
public final Integer getReservationsTimedOut() {
return this.reservationsTimedOut;
}
/**
* Returns The The total number of Reservations that were canceled for Tasks
* while in this TaskQueue.
*
* @return The total number of Reservations that were canceled for Tasks while
* in this TaskQueue
*/
public final Integer getReservationsCanceled() {
return this.reservationsCanceled;
}
/**
* Returns The The total number of Reservations that were rescinded.
*
* @return The total number of Reservations that were rescinded
*/
public final Integer getReservationsRescinded() {
return this.reservationsRescinded;
}
/**
* Returns The The splits of the tasks canceled and accepted based on the
* provided SplitByWaitTime parameter.
*
* @return The splits of the tasks canceled and accepted based on the provided
* SplitByWaitTime parameter
*/
public final Map getSplitByWaitTime() {
return this.splitByWaitTime;
}
/**
* Returns The The task_queue_sid.
*
* @return The task_queue_sid
*/
public final String getTaskQueueSid() {
return this.taskQueueSid;
}
/**
* Returns The The wait duration stats for tasks that were accepted while in
* this TaskQueue.
*
* @return The wait duration stats for tasks that were accepted while in this
* TaskQueue
*/
public final Map getWaitDurationUntilAccepted() {
return this.waitDurationUntilAccepted;
}
/**
* Returns The The wait duration stats for tasks that were canceled while in
* this TaskQueue.
*
* @return The wait duration stats for tasks that were canceled while in this
* TaskQueue
*/
public final Map getWaitDurationUntilCanceled() {
return this.waitDurationUntilCanceled;
}
/**
* Returns The The total number of Tasks canceled while in this TaskQueue.
*
* @return The total number of Tasks canceled while in this TaskQueue
*/
public final Integer getTasksCanceled() {
return this.tasksCanceled;
}
/**
* Returns The The total number of Tasks completed while in this TaskQueue.
*
* @return The total number of Tasks completed while in this TaskQueue
*/
public final Integer getTasksCompleted() {
return this.tasksCompleted;
}
/**
* Returns The The total number of Tasks that were deleted while in this
* TaskQueue.
*
* @return The total number of Tasks that were deleted while in this TaskQueue
*/
public final Integer getTasksDeleted() {
return this.tasksDeleted;
}
/**
* Returns The The total number of Tasks entered into this TaskQueue.
*
* @return The total number of Tasks entered into this TaskQueue
*/
public final Integer getTasksEntered() {
return this.tasksEntered;
}
/**
* Returns The The total number of Tasks moved to another TaskQueue from this
* TaskQueue.
*
* @return The total number of Tasks moved to another TaskQueue from this
* TaskQueue
*/
public final Integer getTasksMoved() {
return this.tasksMoved;
}
/**
* Returns The The workspace_sid.
*
* @return The workspace_sid
*/
public final String getWorkspaceSid() {
return this.workspaceSid;
}
/**
* Returns The The url.
*
* @return The url
*/
public final URI getUrl() {
return this.url;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TaskQueueCumulativeStatistics other = (TaskQueueCumulativeStatistics) o;
return Objects.equals(accountSid, other.accountSid) &&
Objects.equals(avgTaskAcceptanceTime, other.avgTaskAcceptanceTime) &&
Objects.equals(startTime, other.startTime) &&
Objects.equals(endTime, other.endTime) &&
Objects.equals(reservationsCreated, other.reservationsCreated) &&
Objects.equals(reservationsAccepted, other.reservationsAccepted) &&
Objects.equals(reservationsRejected, other.reservationsRejected) &&
Objects.equals(reservationsTimedOut, other.reservationsTimedOut) &&
Objects.equals(reservationsCanceled, other.reservationsCanceled) &&
Objects.equals(reservationsRescinded, other.reservationsRescinded) &&
Objects.equals(splitByWaitTime, other.splitByWaitTime) &&
Objects.equals(taskQueueSid, other.taskQueueSid) &&
Objects.equals(waitDurationUntilAccepted, other.waitDurationUntilAccepted) &&
Objects.equals(waitDurationUntilCanceled, other.waitDurationUntilCanceled) &&
Objects.equals(tasksCanceled, other.tasksCanceled) &&
Objects.equals(tasksCompleted, other.tasksCompleted) &&
Objects.equals(tasksDeleted, other.tasksDeleted) &&
Objects.equals(tasksEntered, other.tasksEntered) &&
Objects.equals(tasksMoved, other.tasksMoved) &&
Objects.equals(workspaceSid, other.workspaceSid) &&
Objects.equals(url, other.url);
}
@Override
public int hashCode() {
return Objects.hash(accountSid,
avgTaskAcceptanceTime,
startTime,
endTime,
reservationsCreated,
reservationsAccepted,
reservationsRejected,
reservationsTimedOut,
reservationsCanceled,
reservationsRescinded,
splitByWaitTime,
taskQueueSid,
waitDurationUntilAccepted,
waitDurationUntilCanceled,
tasksCanceled,
tasksCompleted,
tasksDeleted,
tasksEntered,
tasksMoved,
workspaceSid,
url);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("accountSid", accountSid)
.add("avgTaskAcceptanceTime", avgTaskAcceptanceTime)
.add("startTime", startTime)
.add("endTime", endTime)
.add("reservationsCreated", reservationsCreated)
.add("reservationsAccepted", reservationsAccepted)
.add("reservationsRejected", reservationsRejected)
.add("reservationsTimedOut", reservationsTimedOut)
.add("reservationsCanceled", reservationsCanceled)
.add("reservationsRescinded", reservationsRescinded)
.add("splitByWaitTime", splitByWaitTime)
.add("taskQueueSid", taskQueueSid)
.add("waitDurationUntilAccepted", waitDurationUntilAccepted)
.add("waitDurationUntilCanceled", waitDurationUntilCanceled)
.add("tasksCanceled", tasksCanceled)
.add("tasksCompleted", tasksCompleted)
.add("tasksDeleted", tasksDeleted)
.add("tasksEntered", tasksEntered)
.add("tasksMoved", tasksMoved)
.add("workspaceSid", workspaceSid)
.add("url", url)
.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy