Example #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);

            GetIntentsResponse resp = new GetIntentsResponse();

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

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

                foreach (var obj in resp.Intents)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
Example #2
0
        public void LexModelBuildingServiceGetIntents()
        {
            #region to-get-a-list-of-intents-1494432416363

            var client   = new AmazonLexModelBuildingServiceClient();
            var response = client.GetIntents(new GetIntentsRequest
            {
                MaxResults = 10,
                NextToken  = ""
            });

            List <IntentMetadata> intents = response.Intents;

            #endregion
        }