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

            int?limit  = 10;
            int?offset = 0;

            RoutesController routes = client.Routes;

            do
            {
                dynamic route_data = routes.ListInboundRoutes(limit, offset);
                Console.WriteLine(route_data);

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

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

            return(return_list);
        }