/// <summary> /// Fetch a specific instance of an IpAccessControlList /// </summary> /// /// <param name="options"> Fetch IpAccessControlList parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of IpAccessControlList </returns> public static IpAccessControlListResource Fetch(FetchIpAccessControlListOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Fetch a specific instance of an IpAccessControlList /// </summary> /// /// <param name="pathSid"> Fetch by unique ip-access-control-list 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 IpAccessControlList </returns> public static async System.Threading.Tasks.Task <IpAccessControlListResource> FetchAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIpAccessControlListOptions(pathSid) { PathAccountSid = pathAccountSid }; return(await FetchAsync(options, client)); }
/// <summary> /// Fetch a specific instance of an IpAccessControlList /// </summary> /// /// <param name="pathSid"> Fetch by unique ip-access-control-list Sid </param> /// <param name="pathAccountSid"> The account_sid </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of IpAccessControlList </returns> public static IpAccessControlListResource Fetch(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new FetchIpAccessControlListOptions(pathSid) { PathAccountSid = pathAccountSid }; return(Fetch(options, client)); }
private static Request BuildFetchRequest(FetchIpAccessControlListOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SIP/IpAccessControlLists/" + options.PathSid + ".json", queryParams: options.GetParams() )); }
/// <summary> /// Fetch a specific instance of an IpAccessControlList /// </summary> /// /// <param name="options"> Fetch IpAccessControlList parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of IpAccessControlList </returns> public static async System.Threading.Tasks.Task <IpAccessControlListResource> FetchAsync(FetchIpAccessControlListOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }