/// <summary> /// fetch /// </summary> /// /// <param name="options"> Fetch IpAddress parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of IpAddress </returns> public static IpAddressResource Fetch(FetchIpAddressOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// fetch /// </summary> /// /// <param name="pathIpAccessControlListSid"> The ip_access_control_list_sid </param> /// <param name="pathSid"> The 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 IpAddress </returns> public static async System.Threading.Tasks.Task <IpAddressResource> FetchAsync(string pathIpAccessControlListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIpAddressOptions(pathIpAccessControlListSid, pathSid) { PathAccountSid = pathAccountSid }; return(await FetchAsync(options, client)); }
/// <summary> /// fetch /// </summary> /// /// <param name="pathIpAccessControlListSid"> The ip_access_control_list_sid </param> /// <param name="pathSid"> The sid </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of IpAddress </returns> public static IpAddressResource Fetch(string pathIpAccessControlListSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIpAddressOptions(pathIpAccessControlListSid, pathSid) { PathAccountSid = pathAccountSid }; return(Fetch(options, client)); }
private static Request BuildFetchRequest(FetchIpAddressOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SIP/IpAccessControlLists/" + options.PathIpAccessControlListSid + "/IpAddresses/" + options.PathSid + ".json", queryParams: options.GetParams() )); }
/// <summary> /// fetch /// </summary> /// /// <param name="options"> Fetch IpAddress parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of IpAddress </returns> public static async System.Threading.Tasks.Task <IpAddressResource> FetchAsync(FetchIpAddressOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }