Beispiel #1
0
        public void UpdateIntent()
        {
            UseClientFor(async client =>
            {
                var intentId = await client.Model.AddIntentAsync(GlobalAppId, versionId, new ModelCreateObject
                {
                    Name = "TestIntent"
                });

                var newName = new ModelUpdateObject
                {
                    Name = "UpdateTest"
                };

                var intent = await client.Model.GetIntentAsync(GlobalAppId, versionId, intentId);
                await client.Model.UpdateIntentAsync(GlobalAppId, versionId, intentId, newName);
                var newIntent = await client.Model.GetIntentAsync(GlobalAppId, versionId, intentId);
                await client.Model.DeleteIntentAsync(GlobalAppId, versionId, intentId);

                Assert.Equal(intent.Id, newIntent.Id);
                Assert.NotEqual(intent.Name, newIntent.Name);
                Assert.Equal(newName.Name, newIntent.Name);
            });
        }
 public async Task RenameIntentAsync(Guid id, string name)
 {
     var update = new ModelUpdateObject(name);
     await _luisAuthoringClient.Model.UpdateIntentAsync(_luisSettings.AppId, _luisSettings.LuisVersion, id, update);
 }