示例#1
0
 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()
                ));
 }
示例#2
0
        /// <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));
        }
示例#3
0
        /// <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));
        }
示例#4
0
        /// <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));
        }