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