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

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

            ListSuiteDefinitionsResponse resp = new ListSuiteDefinitionsResponse();

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

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

                foreach (var obj in resp.SuiteDefinitionInformationList)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Esempio n. 2
0
        protected IAmazonIoTDeviceAdvisor CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonIoTDeviceAdvisorConfig {
                RegionEndpoint = region
            };

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

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