예제 #1
0
        /// <summary>
        /// Gets available phone numbers.
        /// </summary>
        /// <param name="areaCode">Area code.</param>
        /// <param name="inPostalCode">In postal code.</param>
        /// <param name="inRegion">In region.</param>
        /// <param name="contains">Contains.</param>
        /// <param name="localNumber">Local number.</param>
        /// <param name="limit">Limit.</param>
        /// <param name="client">REST client.</param>
        /// <returns></returns>
        public static List <NumberAvailable> FindAvailable(string areaCode      = null,
                                                           string inPostalCode  = null,
                                                           RegionEnum?inRegion  = null,
                                                           string contains      = null,
                                                           string localNumber   = null,
                                                           int limit            = DefaultPageSize,
                                                           IVcRestClient client = null)
        {
            NumbersAvailableQueryParams queryParams = new NumbersAvailableQueryParams(areaCode)
            {
                InPostalCode = inPostalCode,
                InRegion     = inRegion,
                Contains     = contains,
                LocalNumber  = localNumber,
                Limit        = limit
            };

            return(GetAvailable(VcClient.AccountId, queryParams, client));
        }
예제 #2
0
 /// <summary>
 /// Gets available phone numbers.
 /// </summary>
 /// <param name="accountId">Account ID.</param>
 /// <param name="queryParams">Query parameters.</param>
 /// <param name="client">REST client.</param>
 /// <returns></returns>
 private static List <NumberAvailable> GetAvailable(int accountId, NumbersAvailableQueryParams queryParams, IVcRestClient client = null)
 {
     return(Get <NumberAvailable>(BuildGetAvailableUrl(accountId), queryParams, client: client));
 }