/// <summary> /// fetch /// </summary> /// <param name="options"> Fetch Task parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Task </returns> public static TaskResource Fetch(FetchTaskOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// fetch /// </summary> /// <param name="pathAssistantSid"> The SID of the Assistant that is the parent of the resource to fetch </param> /// <param name="pathSid"> The unique string that identifies the resource to fetch </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Task </returns> public static async System.Threading.Tasks.Task<TaskResource> FetchAsync(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchTaskOptions(pathAssistantSid, pathSid); return await FetchAsync(options, client); }
/// <summary> /// fetch /// </summary> /// <param name="options"> Fetch Task parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Task </returns> public static async System.Threading.Tasks.Task<TaskResource> FetchAsync(FetchTaskOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return FromJson(response.Content); }
private static Request BuildFetchRequest(FetchTaskOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Autopilot, "/v1/Assistants/" + options.PathAssistantSid + "/Tasks/" + options.PathSid + "", queryParams: options.GetParams() )); }
/// <summary> /// fetch /// </summary> /// <param name="pathAssistantSid"> The SID of the Assistant that is the parent of the resource to fetch </param> /// <param name="pathSid"> The unique string that identifies the resource to fetch </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Task </returns> public static TaskResource Fetch(string pathAssistantSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchTaskOptions(pathAssistantSid, pathSid); return(Fetch(options, client)); }