Beispiel #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonLocationServiceConfig config = new AmazonLocationServiceConfig();

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

            ListGeofenceCollectionsResponse resp = new ListGeofenceCollectionsResponse();

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

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

                foreach (var obj in resp.Entries)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Beispiel #2
0
        protected IAmazonLocationService CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonLocationServiceConfig {
                RegionEndpoint = region
            };

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

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