/// <summary> /// fetch /// </summary> /// <param name="options"> Fetch Activity parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Activity </returns> public static ActivityResource Fetch(FetchActivityOptions 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 SID of the Workspace with the Activity resources to fetch </param> /// <param name="pathSid"> The SID of the resource to fetch </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Activity </returns> public static async System.Threading.Tasks.Task <ActivityResource> FetchAsync(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchActivityOptions(pathWorkspaceSid, pathSid); return(await FetchAsync(options, client)); }
private static Request BuildFetchRequest(FetchActivityOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Taskrouter, "/v1/Workspaces/" + options.PathWorkspaceSid + "/Activities/" + options.PathSid + "", queryParams: options.GetParams() )); }
/// <summary> /// fetch /// </summary> /// <param name="pathWorkspaceSid"> The SID of the Workspace with the Activity resources to fetch </param> /// <param name="pathSid"> The SID of the resource to fetch </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Activity </returns> public static ActivityResource Fetch(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchActivityOptions(pathWorkspaceSid, pathSid); return(Fetch(options, client)); }
/// <summary> /// fetch /// </summary> /// <param name="options"> Fetch Activity parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Activity </returns> public static async System.Threading.Tasks.Task <ActivityResource> FetchAsync(FetchActivityOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }