/// <summary> /// fetch /// </summary> /// /// <param name="options"> Fetch WorkersRealTimeStatistics parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of WorkersRealTimeStatistics </returns> public static WorkersRealTimeStatisticsResource Fetch(FetchWorkersRealTimeStatisticsOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// fetch /// </summary> /// /// <param name="pathWorkspaceSid"> The workspace_sid </param> /// <param name="taskChannel"> The task_channel </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of WorkersRealTimeStatistics </returns> public static async System.Threading.Tasks.Task <WorkersRealTimeStatisticsResource> FetchAsync(string pathWorkspaceSid, string taskChannel = null, ITwilioRestClient client = null) { var options = new FetchWorkersRealTimeStatisticsOptions(pathWorkspaceSid) { TaskChannel = taskChannel }; return(await FetchAsync(options, client)); }
/// <summary> /// fetch /// </summary> /// /// <param name="pathWorkspaceSid"> The workspace_sid </param> /// <param name="taskChannel"> The task_channel </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of WorkersRealTimeStatistics </returns> public static WorkersRealTimeStatisticsResource Fetch(string pathWorkspaceSid, string taskChannel = null, ITwilioRestClient client = null) { var options = new FetchWorkersRealTimeStatisticsOptions(pathWorkspaceSid) { TaskChannel = taskChannel }; return(Fetch(options, client)); }
private static Request BuildFetchRequest(FetchWorkersRealTimeStatisticsOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Taskrouter, "/v1/Workspaces/" + options.PathWorkspaceSid + "/Workers/RealTimeStatistics", queryParams: options.GetParams() )); }
/// <summary> /// fetch /// </summary> /// <param name="options"> Fetch WorkersRealTimeStatistics parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of WorkersRealTimeStatistics </returns> public static async System.Threading.Tasks.Task <WorkersRealTimeStatisticsResource> FetchAsync(FetchWorkersRealTimeStatisticsOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }