Example #1
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathCountryCode"> The country_code </param>
        /// <param name="pathAccountSid"> The 34 character string that uniquely identifies your account. </param>
        /// <param name="areaCode"> Find phone numbers in the specified area code. </param>
        /// <param name="contains"> A pattern on which to match phone numbers. </param>
        /// <param name="smsEnabled"> This indicates whether the phone numbers can receive text messages. </param>
        /// <param name="mmsEnabled"> This indicates whether the phone numbers can receive MMS messages. </param>
        /// <param name="voiceEnabled"> This indicates whether the phone numbers can receive calls. </param>
        /// <param name="excludeAllAddressRequired"> Indicates whether the response includes phone numbers which require any
        ///                                 Address. </param>
        /// <param name="excludeLocalAddressRequired"> Indicates whether the response includes phone numbers which require a
        ///                                   local Address. </param>
        /// <param name="excludeForeignAddressRequired"> Indicates whether the response includes phone numbers which require a
        ///                                     foreign Address. </param>
        /// <param name="beta"> Include phone numbers new to the Twilio platform. </param>
        /// <param name="nearNumber"> Given a phone number, find a geographically close number within Distance miles.
        ///                  (US/Canada only) </param>
        /// <param name="nearLatLong"> Given a latitude/longitude pair lat,long find geographically close numbers within
        ///                   Distance miles. (US/Canada only) </param>
        /// <param name="distance"> Specifies the search radius for a Near- query in miles. (US/Canada only) </param>
        /// <param name="inPostalCode"> Limit results to a particular postal code. (US/Canada only) </param>
        /// <param name="inRegion"> Limit results to a particular region. (US/Canada only) </param>
        /// <param name="inRateCenter"> Limit results to a specific rate center, or given a phone number search within the same
        ///                    rate center as that number. (US/Canada only) </param>
        /// <param name="inLata"> Limit results to a specific Local access and transport area. (US/Canada only) </param>
        /// <param name="inLocality"> Limit results to a particular locality. (US/Canada only) </param>
        /// <param name="faxEnabled"> This indicates whether the phone numbers can receive faxes. </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 Local </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <LocalResource> > ReadAsync(string pathCountryCode,
                                                                                                 string pathAccountSid              = null,
                                                                                                 int?areaCode                       = null,
                                                                                                 string contains                    = null,
                                                                                                 bool?smsEnabled                    = null,
                                                                                                 bool?mmsEnabled                    = null,
                                                                                                 bool?voiceEnabled                  = null,
                                                                                                 bool?excludeAllAddressRequired     = null,
                                                                                                 bool?excludeLocalAddressRequired   = null,
                                                                                                 bool?excludeForeignAddressRequired = null,
                                                                                                 bool?beta = null,
                                                                                                 Types.PhoneNumber nearNumber = null,
                                                                                                 string nearLatLong           = null,
                                                                                                 int?distance             = null,
                                                                                                 string inPostalCode      = null,
                                                                                                 string inRegion          = null,
                                                                                                 string inRateCenter      = null,
                                                                                                 string inLata            = null,
                                                                                                 string inLocality        = null,
                                                                                                 bool?faxEnabled          = null,
                                                                                                 int?pageSize             = null,
                                                                                                 long?limit               = null,
                                                                                                 ITwilioRestClient client = null)
        {
            var options = new ReadLocalOptions(pathCountryCode)
            {
                PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Example #2
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read Local parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Local </returns>
        public static ResourceSet <LocalResource> Read(ReadLocalOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <LocalResource> .FromJson("available_phone_numbers", response.Content);

            return(new ResourceSet <LocalResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadLocalOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/AvailablePhoneNumbers/" + options.PathCountryCode + "/Local.json",
                queryParams: options.GetParams()
                ));
 }
Example #4
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read Local parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Local </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <LocalResource> > ReadAsync(ReadLocalOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <LocalResource> .FromJson("available_phone_numbers", response.Content);

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