示例#1
0
        private static ArrayList GetAvailableExchangeCodes(FlowrouteNumbersAndMessagingClient client)
        {
            ArrayList return_list = new ArrayList();

            int?   limit        = 10;
            int?   offset       = 0;
            double?maxSetupCost = 174.40;
            string areacode     = "206";

            // User the Numbers Controller from our Client
            NumbersController numbers = client.Numbers;

            do
            {
                dynamic exchanges_data = numbers.ListAvailableExchangeCodes(limit, offset, maxSetupCost, areacode);
                Console.WriteLine(exchanges_data);

                foreach (var item in exchanges_data.data)
                {
                    Console.WriteLine("---------------------------\nAvailable Exchange:\n");
                    Console.WriteLine("Attributes:{0}\nId:{1}\nLinks:{2}\nType:{3}\n", item.attributes, item.id, item.links, item.type);
                    return_list.Add((string)item.id);
                }

                // See if there is more data to process
                var links = exchanges_data.links;
                if (links.next != null)
                {
                    // more data to pull
                    offset += limit;
                }
                else
                {
                    break;   // no more data
                }
            }while (true);

            return(return_list);
        }