/// <summary> /// Retrieve all voice dialing country permissions for this account /// </summary> /// <param name="options"> Read Country parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Country </returns> public static ResourceSet <CountryResource> Read(ReadCountryOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <CountryResource> .FromJson("content", response.Content); return(new ResourceSet <CountryResource>(page, options, client)); }
private static Request BuildReadRequest(ReadCountryOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Voice, "/v1/DialingPermissions/Countries", client.Region, queryParams: options.GetParams() )); }
/// <summary> /// Retrieve all voice dialing country permissions for this account /// </summary> /// <param name="isoCode"> Filter to retrieve the country permissions by specifying the ISO country code </param> /// <param name="continent"> Filter to retrieve the country permissions by specifying the continent </param> /// <param name="countryCode"> Country code filter </param> /// <param name="lowRiskNumbersEnabled"> Filter to retrieve the country permissions with dialing to low-risk numbers /// enabled </param> /// <param name="highRiskSpecialNumbersEnabled"> Filter to retrieve the country permissions with dialing to high-risk /// special service numbers enabled </param> /// <param name="highRiskTollfraudNumbersEnabled"> Filter to retrieve the country permissions with dialing to high-risk /// toll fraud numbers enabled </param> /// <param name="pageSize"> Page size </param> /// <param name="limit"> Record limit </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Country </returns> public static async System.Threading.Tasks.Task <ResourceSet <CountryResource> > ReadAsync(string isoCode = null, string continent = null, string countryCode = null, bool?lowRiskNumbersEnabled = null, bool?highRiskSpecialNumbersEnabled = null, bool?highRiskTollfraudNumbersEnabled = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadCountryOptions() { IsoCode = isoCode, Continent = continent, CountryCode = countryCode, LowRiskNumbersEnabled = lowRiskNumbersEnabled, HighRiskSpecialNumbersEnabled = highRiskSpecialNumbersEnabled, HighRiskTollfraudNumbersEnabled = highRiskTollfraudNumbersEnabled, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve all voice dialing country permissions for this account /// </summary> /// <param name="options"> Read Country parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Country </returns> public static async System.Threading.Tasks.Task <ResourceSet <CountryResource> > ReadAsync(ReadCountryOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <CountryResource> .FromJson("content", response.Content); return(new ResourceSet <CountryResource>(page, options, client)); }