Example #1
0
 private static Request BuildReadRequest(ReadHighriskSpecialPrefixOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Voice,
                "/v1/DialingPermissions/Countries/" + options.PathIsoCode + "/HighRiskSpecialPrefixes",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
Example #2
0
        /// <summary>
        /// Fetch the high-risk special services prefixes from the country resource corresponding to the [ISO country
        /// code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
        /// </summary>
        /// <param name="options"> Read HighriskSpecialPrefix parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of HighriskSpecialPrefix </returns>
        public static ResourceSet <HighriskSpecialPrefixResource> Read(ReadHighriskSpecialPrefixOptions options,
                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <HighriskSpecialPrefixResource> .FromJson("content", response.Content);

            return(new ResourceSet <HighriskSpecialPrefixResource>(page, options, client));
        }
Example #3
0
        /// <summary>
        /// Fetch the high-risk special services prefixes from the country resource corresponding to the [ISO country
        /// code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
        /// </summary>
        /// <param name="pathIsoCode"> The ISO 3166-1 country code </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of HighriskSpecialPrefix </returns>
        public static ResourceSet <HighriskSpecialPrefixResource> Read(string pathIsoCode,
                                                                       int?pageSize             = null,
                                                                       long?limit               = null,
                                                                       ITwilioRestClient client = null)
        {
            var options = new ReadHighriskSpecialPrefixOptions(pathIsoCode)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Example #4
0
        /// <summary>
        /// Fetch the high-risk special services prefixes from the country resource corresponding to the [ISO country
        /// code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
        /// </summary>
        /// <param name="pathIsoCode"> The ISO 3166-1 country code </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 HighriskSpecialPrefix </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <HighriskSpecialPrefixResource> > ReadAsync(string pathIsoCode,
                                                                                                                 int?pageSize             = null,
                                                                                                                 long?limit               = null,
                                                                                                                 ITwilioRestClient client = null)
        {
            var options = new ReadHighriskSpecialPrefixOptions(pathIsoCode)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Example #5
0
        /// <summary>
        /// Fetch the high-risk special services prefixes from the country resource corresponding to the [ISO country
        /// code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
        /// </summary>
        /// <param name="options"> Read HighriskSpecialPrefix parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of HighriskSpecialPrefix </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <HighriskSpecialPrefixResource> > ReadAsync(ReadHighriskSpecialPrefixOptions options,
                                                                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <HighriskSpecialPrefixResource> .FromJson("content", response.Content);

            return(new ResourceSet <HighriskSpecialPrefixResource>(page, options, client));
        }