public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonDataExchangeConfig config = new AmazonDataExchangeConfig();

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

            ListJobsResponse resp = new ListJobsResponse();

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

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

                foreach (var obj in resp.Jobs)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Пример #2
0
        protected IAmazonDataExchange CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonDataExchangeConfig {
                RegionEndpoint = region
            };

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

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