예제 #1
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch WorkerStatistics parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of WorkerStatistics </returns>
        public static WorkerStatisticsResource Fetch(FetchWorkerStatisticsOptions 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="pathWorkerSid"> The worker_sid </param>
        /// <param name="minutes"> The minutes </param>
        /// <param name="startDate"> The start_date </param>
        /// <param name="endDate"> The end_date </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of WorkerStatistics </returns>
        public static WorkerStatisticsResource Fetch(string pathWorkspaceSid, string pathWorkerSid, int?minutes = null, DateTime?startDate = null, DateTime?endDate = null, ITwilioRestClient client = null)
        {
            var options = new FetchWorkerStatisticsOptions(pathWorkspaceSid, pathWorkerSid)
            {
                Minutes = minutes, StartDate = startDate, EndDate = endDate
            };

            return(Fetch(options, client));
        }
예제 #3
0
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathWorkerSid"> The worker_sid </param>
        /// <param name="minutes"> The minutes </param>
        /// <param name="startDate"> The start_date </param>
        /// <param name="endDate"> The end_date </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of WorkerStatistics </returns>
        public static async System.Threading.Tasks.Task <WorkerStatisticsResource> FetchAsync(string pathWorkspaceSid, string pathWorkerSid, int?minutes = null, DateTime?startDate = null, DateTime?endDate = null, ITwilioRestClient client = null)
        {
            var options = new FetchWorkerStatisticsOptions(pathWorkspaceSid, pathWorkerSid)
            {
                Minutes = minutes, StartDate = startDate, EndDate = endDate
            };

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

            return(FromJson(response.Content));
        }