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

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

            ListNotificationRulesResponse resp = new ListNotificationRulesResponse();

            do
            {
                ListNotificationRulesRequest req = new ListNotificationRulesRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

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

                foreach (var obj in resp.NotificationRules)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Ejemplo n.º 2
0
        protected IAmazonCodeStarNotifications CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonCodeStarNotificationsConfig {
                RegionEndpoint = region
            };

            Amazon.PowerShell.Utils.Common.PopulateConfig(this, config);
            this.CustomizeClientConfig(config);
            var client = new AmazonCodeStarNotificationsClient(credentials, config);

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }