From 2696cf9b01845a6f6d760a3f07b85d17bac03515 Mon Sep 17 00:00:00 2001 From: Jassen Tawil Date: Fri, 29 Jul 2022 08:10:42 -0400 Subject: [PATCH] Added missing model definitions for statistics --- .../Worker/WorkerStatisticsResource.cs | 46 +++++++++++- .../WorkersCumulativeStatisticsResource.cs | 19 ++++- .../WorkersRealTimeStatisticsResource.cs | 74 +++++++++++++------ 3 files changed, 113 insertions(+), 26 deletions(-) diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs index f95d84c2b..bb392bb62 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsResource.cs @@ -135,7 +135,7 @@ public static WorkerStatisticsResource FromJson(string json) /// An object that contains the cumulative statistics for the Worker /// [JsonProperty("cumulative")] - public object Cumulative { get; private set; } + public CumulativeStatistics Cumulative { get; private set; } /// /// The SID of the Worker that contains the WorkerChannel /// @@ -152,6 +152,50 @@ public static WorkerStatisticsResource FromJson(string json) [JsonProperty("url")] public Uri Url { get; private set; } + public class CumulativeStatistics + { + [JsonProperty("reservations_timed_out")] + public int ReservationsTimedOut { get; set; } + [JsonProperty("reservations_rejected")] + public int ReservationsRejected { get; set; } + [JsonProperty("reservations_created")] + public int ReservationsCreated { get; set; } + [JsonProperty("reservations_rescinded")] + public int ReservationsRescinded { get; set; } + [JsonProperty("tasks_assigned")] + public int TasksAssigned { get; set; } + [JsonProperty("start_time")] + public DateTime StartTime { get; set; } + [JsonProperty("reservations_wrapup ")] + public int ReservationsWrapup { get; set; } + [JsonProperty("end_time")] + public DateTime EndTime { get; set; } + [JsonProperty("reservations_accepted")] + public int ReservationsAccepted { get; set; } + [JsonProperty("activity_durations")] + public List ActivityDurations { get; set; } + [JsonProperty("reservations_canceled")] + public int ReservationsCanceled { get; set; } + [JsonProperty("reservations_completed")] + public int ReservationsCompleted { get; set; } + } + + public class ActivityDuration + { + [JsonProperty("avg")] + public int Avg { get; set; } + [JsonProperty("min")] + public int Min { get; set; } + [JsonProperty("max")] + public int Max { get; set; } + [JsonProperty("friendly_name")] + public string FriendlyName { get; set; } + [JsonProperty("sid")] + public string Sid { get; set; } + [JsonProperty("total")] + public int Total { get; set; } + } + private WorkerStatisticsResource() { diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs index ece29b00a..9c3044629 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsResource.cs @@ -142,7 +142,7 @@ public static WorkersCumulativeStatisticsResource FromJson(string json) /// The minimum, average, maximum, and total time that Workers spent in each Activity /// [JsonProperty("activity_durations")] - public List ActivityDurations { get; private set; } + public List ActivityDurations { get; private set; } /// /// The total number of Reservations that were created /// @@ -184,6 +184,23 @@ public static WorkersCumulativeStatisticsResource FromJson(string json) [JsonProperty("url")] public Uri Url { get; private set; } + + public class ActivityDuration + { + [JsonProperty("avg")] + public int Avg { get; set; } + [JsonProperty("min")] + public int Min { get; set; } + [JsonProperty("max")] + public int Max { get; set; } + [JsonProperty("friendly_name")] + public string FriendlyName { get; set; } + [JsonProperty("sid")] + public string Sid { get; set; } + [JsonProperty("total")] + public int Total { get; set; } + } + private WorkersCumulativeStatisticsResource() { diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs index 860cd6bb9..34a3a0670 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsResource.cs @@ -112,30 +112,56 @@ public static WorkersRealTimeStatisticsResource FromJson(string json) } /// - /// The SID of the Account that created the resource - /// - [JsonProperty("account_sid")] - public string AccountSid { get; private set; } - /// - /// The number of current Workers by Activity - /// - [JsonProperty("activity_statistics")] - public List ActivityStatistics { get; private set; } - /// - /// The total number of Workers - /// - [JsonProperty("total_workers")] - public int? TotalWorkers { get; private set; } - /// - /// The SID of the Workspace that contains the Workers - /// - [JsonProperty("workspace_sid")] - public string WorkspaceSid { get; private set; } - /// - /// The absolute URL of the Workers statistics resource - /// - [JsonProperty("url")] - public Uri Url { get; private set; } + /// The SID of the Account that created the resource + /// + [JsonProperty("account_sid")] + public string AccountSid { get; private set; } + /// + /// The number of current Workers by Activity + /// + [JsonProperty("activity_statistics")] + public List ActivityStatistics { get; private set; } + /// + /// The total number of Workers + /// + [JsonProperty("total_workers")] + public int? TotalWorkers { get; private set; } + /// + /// The SID of the Workspace that contains the Workers + /// + [JsonProperty("workspace_sid")] + public string WorkspaceSid { get; private set; } + /// + /// The absolute URL of the Workers statistics resource + /// + [JsonProperty("url")] + public Uri Url { get; private set; } + + public class ActivityStatistic + { + [JsonProperty("workers")] + public int Workers { get; set; } + [JsonProperty("friendly_name")] + public string Friendlyname { get; set; } + [JsonProperty("sid")] + public string Sid { get; set; } + } + + public class TasksByStatusType + { + [JsonProperty("reserved")] + public int Reserved { get; set; } + [JsonProperty("completed")] + public int Completed { get; set; } + [JsonProperty("wrapping")] + public int Wrapping { get; set; } + [JsonProperty("assigned")] + public int Assigned { get; set; } + [JsonProperty("canceled")] + public int Canceled { get; set; } + [JsonProperty("pending")] + public int Pending { get; set; } + } private WorkersRealTimeStatisticsResource() {