private static Request BuildFetchRequest(FetchFaxMediaOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Fax, "/v1/Faxes/" + options.PathFaxSid + "/Media/" + options.PathSid + "", client.Region, queryParams: options.GetParams() )); }
/// <summary> /// Fetch a specific fax media instance. /// </summary> /// <param name="pathFaxSid"> The SID of the fax with the FaxMedia 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 FaxMedia </returns> public static FaxMediaResource Fetch(string pathFaxSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchFaxMediaOptions(pathFaxSid, pathSid); return(Fetch(options, client)); }
/// <summary> /// Fetch a specific fax media instance. /// </summary> /// <param name="options"> Fetch FaxMedia parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of FaxMedia </returns> public static async System.Threading.Tasks.Task <FaxMediaResource> FetchAsync(FetchFaxMediaOptions 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 media instance. /// </summary> /// /// <param name="pathFaxSid"> Fax SID </param> /// <param name="pathSid"> A string that uniquely identifies this fax media </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of FaxMedia </returns> public static async System.Threading.Tasks.Task <FaxMediaResource> FetchAsync(string pathFaxSid, string pathSid, ITwilioRestClient client = null) { var options = new FetchFaxMediaOptions(pathFaxSid, pathSid); return(await FetchAsync(options, client)); }