public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonSecurityHubConfig config = new AmazonSecurityHubConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonSecurityHubClient client = new AmazonSecurityHubClient(creds, config); ListEnabledProductsForImportResponse resp = new ListEnabledProductsForImportResponse(); do { ListEnabledProductsForImportRequest req = new ListEnabledProductsForImportRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListEnabledProductsForImport(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.ProductSubscriptions) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonSecurityHubConfig config = new AmazonSecurityHubConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonSecurityHubClient client = new AmazonSecurityHubClient(creds, config); DescribeStandardsResponse resp = new DescribeStandardsResponse(); do { DescribeStandardsRequest req = new DescribeStandardsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.DescribeStandards(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Standards) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonSecurityHub CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonSecurityHubConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonSecurityHubClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }