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