Exemplo n.º 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonSimpleNotificationServiceConfig config = new AmazonSimpleNotificationServiceConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonSimpleNotificationServiceClient client = new AmazonSimpleNotificationServiceClient(creds, config);

            ListSubscriptionsResponse resp = new ListSubscriptionsResponse();

            do
            {
                ListSubscriptionsRequest req = new ListSubscriptionsRequest
                {
                    NextToken = resp.NextToken
                };

                resp = client.ListSubscriptions(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Subscriptions)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Exemplo n.º 2
0
        public static void SNSListSubscriptions()
        {
            #region SNSListSubscriptions
            var snsClient = new AmazonSimpleNotificationServiceClient();
            var request   = new ListSubscriptionsRequest();
            var response  = new ListSubscriptionsResponse();

            do
            {
                response = snsClient.ListSubscriptions(request);

                foreach (var sub in response.Subscriptions)
                {
                    Console.WriteLine("Subscription: {0}", sub.SubscriptionArn);
                }

                request.NextToken = response.NextToken;
            } while (!string.IsNullOrEmpty(response.NextToken));
            #endregion

            Console.ReadLine();
        }