示例#1
0
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="options"> Fetch TaskQueueStatistics parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskQueueStatistics </returns>
        public static TaskQueueStatisticsResource Fetch(FetchTaskQueueStatisticsOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
示例#2
0
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathTaskQueueSid"> The task_queue_sid </param>
        /// <param name="endDate"> The end_date </param>
        /// <param name="minutes"> The minutes </param>
        /// <param name="startDate"> The start_date </param>
        /// <param name="taskChannel"> The task_channel </param>
        /// <param name="splitByWaitTime"> The split_by_wait_time </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskQueueStatistics </returns>
        public static TaskQueueStatisticsResource Fetch(string pathWorkspaceSid, string pathTaskQueueSid, DateTime?endDate = null, int?minutes = null, DateTime?startDate = null, string taskChannel = null, string splitByWaitTime = null, ITwilioRestClient client = null)
        {
            var options = new FetchTaskQueueStatisticsOptions(pathWorkspaceSid, pathTaskQueueSid)
            {
                EndDate = endDate, Minutes = minutes, StartDate = startDate, TaskChannel = taskChannel, SplitByWaitTime = splitByWaitTime
            };

            return(Fetch(options, client));
        }
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathTaskQueueSid"> The task_queue_sid </param>
        /// <param name="endDate"> The end_date </param>
        /// <param name="minutes"> The minutes </param>
        /// <param name="startDate"> The start_date </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskQueueStatistics </returns>
        public static async System.Threading.Tasks.Task <TaskQueueStatisticsResource> FetchAsync(string pathWorkspaceSid, string pathTaskQueueSid, DateTime?endDate = null, int?minutes = null, DateTime?startDate = null, ITwilioRestClient client = null)
        {
            var options = new FetchTaskQueueStatisticsOptions(pathWorkspaceSid, pathTaskQueueSid)
            {
                EndDate = endDate, Minutes = minutes, StartDate = startDate
            };

            return(await FetchAsync(options, client));
        }
示例#4
0
 private static Request BuildFetchRequest(FetchTaskQueueStatisticsOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/TaskQueues/" + options.PathTaskQueueSid + "/Statistics",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch TaskQueueStatistics parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskQueueStatistics </returns>
        public static async System.Threading.Tasks.Task <TaskQueueStatisticsResource> FetchAsync(FetchTaskQueueStatisticsOptions options,
                                                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }