public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonMigrationHubConfig config = new AmazonMigrationHubConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonMigrationHubClient client = new AmazonMigrationHubClient(creds, config); ListMigrationTasksResponse resp = new ListMigrationTasksResponse(); do { ListMigrationTasksRequest req = new ListMigrationTasksRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListMigrationTasks(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.MigrationTaskSummaryList) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonMigrationHub CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonMigrationHubConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonMigrationHubClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }