Exemplo n.º 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonGreengrassV2Config config = new AmazonGreengrassV2Config();

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

            ListComponentsResponse resp = new ListComponentsResponse();

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

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

                foreach (var obj in resp.Components)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        protected IAmazonGreengrassV2 CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonGreengrassV2Config {
                RegionEndpoint = region
            };

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

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