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

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

            ListAssessmentReportsResponse resp = new ListAssessmentReportsResponse();

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

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

                foreach (var obj in resp.AssessmentReports)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
 protected IAmazonAuditManager CreateClient(AWSCredentials credentials, RegionEndpoint region)
 {
     var config = new AmazonAuditManagerConfig { RegionEndpoint = region };
     Amazon.PowerShell.Utils.Common.PopulateConfig(this, config);
     this.CustomizeClientConfig(config);
     var client = new AmazonAuditManagerClient(credentials, config);
     client.BeforeRequestEvent += RequestEventHandler;
     client.AfterResponseEvent += ResponseEventHandler;
     return client;
 }