/// <summary> /// Fetch a Command instance from your account. /// </summary> /// <param name="pathSid"> The SID 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 Command </returns> public static async System.Threading.Tasks.Task <CommandResource> FetchAsync(string pathSid, ITwilioRestClient client = null) { var options = new FetchCommandOptions(pathSid); return(await FetchAsync(options, client)); }
/// <summary> /// Fetch a Command instance from your account. /// </summary> /// <param name="options"> Fetch Command parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Command </returns> public static CommandResource Fetch(FetchCommandOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch a Command instance from your account. /// </summary> /// <param name="options"> Fetch Command parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Command </returns> public static async System.Threading.Tasks.Task <CommandResource> FetchAsync(FetchCommandOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildFetchRequest(FetchCommandOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Supersim, "/v1/Commands/" + options.PathSid + "", queryParams: options.GetParams() )); }
/// <summary> /// Fetch a Command instance from your account. /// </summary> /// <param name="pathSid"> The SID that identifies the resource to fetch </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Command </returns> public static CommandResource Fetch(string pathSid, ITwilioRestClient client = null) { var options = new FetchCommandOptions(pathSid); return(Fetch(options, client)); }