public static async Task <ResourceSet <LocalResource> > GetAvailableLocalPhoneNumberAsync(ITwilioRestClient client, CountryCode countryCode, string accountSid = null, int?areaCode = null, bool?smsEnabled = null, bool?mmsEnabled = null, bool?faxEnabled = null, bool?voiceEnabled = null, bool?beta = null, string containsPattern = null, string lata = null, string latLong = null, string nearNumber = null, int?distance = null, string locality = null, string postalCode = null, string rateCenter = null, string region = null, bool?excludeAllAddressRequired = null, bool?excludeForeignAddressRequired = null, bool?excludeLocalAddressRequired = null, long?limit = null) { var nearPhoneNumber = nearNumber != null ? new PhoneNumber(nearNumber) : null; var options = new ReadLocalOptions($"{countryCode:G}") { PathAccountSid = accountSid, AreaCode = areaCode, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, FaxEnabled = faxEnabled, VoiceEnabled = voiceEnabled, Beta = beta, Contains = containsPattern, InLata = lata, NearLatLong = latLong, NearNumber = nearPhoneNumber, Distance = distance, InLocality = locality, InPostalCode = postalCode, InRateCenter = rateCenter, InRegion = region, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, Limit = limit, PageSize = null }; return(await LocalResource.ReadAsync(options, client)); }
public async Task <IEnumerable <LocalResource> > SearchPhoneNumbersAsync(string areaCode = "415") { var localNumbers = await LocalResource.ReadAsync( pathCountryCode : "US", areaCode : int.Parse(areaCode), client : _client); return(localNumbers.ToList()); }
public virtual async Task <ResourceSet <LocalResource> > GetLocalPhoneNumber(string areaCode = null) { var code = areaCode.ToNullableInt(); ResourceSet <LocalResource> result; try { result = await LocalResource.ReadAsync(pathCountryCode : "US", areaCode : code); } catch (ApiException) { result = null; } return(result); }