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

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

            GetSlotTypesResponse resp = new GetSlotTypesResponse();

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

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

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

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

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