/// <summary> /// Fetch an incoming-phone-number belonging to the account used to make the request /// </summary> /// /// <param name="options"> Fetch IncomingPhoneNumber parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of IncomingPhoneNumber </returns> public static IncomingPhoneNumberResource Fetch(FetchIncomingPhoneNumberOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch an incoming-phone-number belonging to the account used to make the request /// </summary> /// /// <param name="pathSid"> Fetch by unique incoming-phone-number Sid </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of IncomingPhoneNumber </returns> public static async System.Threading.Tasks.Task <IncomingPhoneNumberResource> FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIncomingPhoneNumberOptions(pathSid) { PathAccountSid = pathAccountSid }; return(await FetchAsync(options, client)); }
/// <summary> /// Fetch an incoming-phone-number belonging to the account used to make the request /// </summary> /// /// <param name="pathSid"> Fetch by unique incoming-phone-number Sid </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of IncomingPhoneNumber </returns> public static IncomingPhoneNumberResource Fetch(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIncomingPhoneNumberOptions(pathSid) { PathAccountSid = pathAccountSid }; return(Fetch(options, client)); }
private static Request BuildFetchRequest(FetchIncomingPhoneNumberOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/IncomingPhoneNumbers/" + options.PathSid + ".json", client.Region, queryParams: options.GetParams() )); }
/// <summary> /// Fetch an incoming-phone-number belonging to the account used to make the request /// </summary> /// /// <param name="options"> Fetch IncomingPhoneNumber parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of IncomingPhoneNumber </returns> public static async System.Threading.Tasks.Task <IncomingPhoneNumberResource> FetchAsync(FetchIncomingPhoneNumberOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }