Exemple #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonAccessAnalyzerConfig config = new AmazonAccessAnalyzerConfig();

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

            ListPolicyGenerationsResponse resp = new ListPolicyGenerationsResponse();

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

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

                foreach (var obj in resp.PolicyGenerations)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Exemple #2
0
        protected IAmazonAccessAnalyzer CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonAccessAnalyzerConfig {
                RegionEndpoint = region
            };

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

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