/// <summary> /// fetch /// </summary> /// /// <param name="options"> Fetch WorkflowStatistics parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of WorkflowStatistics </returns> public static WorkflowStatisticsResource Fetch(FetchWorkflowStatisticsOptions 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="pathWorkflowSid"> The workflow_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 WorkflowStatistics </returns> public static async System.Threading.Tasks.Task <WorkflowStatisticsResource> FetchAsync(string pathWorkspaceSid, string pathWorkflowSid, int?minutes = null, DateTime?startDate = null, DateTime?endDate = null, ITwilioRestClient client = null) { var options = new FetchWorkflowStatisticsOptions(pathWorkspaceSid, pathWorkflowSid) { Minutes = minutes, StartDate = startDate, EndDate = endDate }; return(await FetchAsync(options, client)); }
/// <summary> /// fetch /// </summary> /// /// <param name="pathWorkspaceSid"> The workspace_sid </param> /// <param name="pathWorkflowSid"> The workflow_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 WorkflowStatistics </returns> public static WorkflowStatisticsResource Fetch(string pathWorkspaceSid, string pathWorkflowSid, int?minutes = null, DateTime?startDate = null, DateTime?endDate = null, ITwilioRestClient client = null) { var options = new FetchWorkflowStatisticsOptions(pathWorkspaceSid, pathWorkflowSid) { Minutes = minutes, StartDate = startDate, EndDate = endDate }; return(Fetch(options, client)); }
private static Request BuildFetchRequest(FetchWorkflowStatisticsOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Taskrouter, "/v1/Workspaces/" + options.PathWorkspaceSid + "/Workflows/" + options.PathWorkflowSid + "/Statistics", queryParams: options.GetParams() )); }
/// <summary> /// fetch /// </summary> /// <param name="options"> Fetch WorkflowStatistics parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of WorkflowStatistics </returns> public static async System.Threading.Tasks.Task <WorkflowStatisticsResource> FetchAsync(FetchWorkflowStatisticsOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }