Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ public HierarchicalModel()
/// <summary>
/// Initializes a new instance of the HierarchicalModel class.
/// </summary>
public HierarchicalModel(string name = default(string), IList<string> children = default(IList<string>), PrebuiltDomainObject inherits = default(PrebuiltDomainObject), IList<string> roles = default(IList<string>))
public HierarchicalModel(string name = default(string), IList<JsonChild> children = default(IList<JsonChild>), IList<JsonModelFeatureInformation> features = default(IList<JsonModelFeatureInformation>), IList<string> roles = default(IList<string>), PrebuiltDomainObject inherits = default(PrebuiltDomainObject))
{
Name = name;
Children = children;
Inherits = inherits;
Features = features;
Roles = roles;
Inherits = inherits;
CustomInit();
}

Expand All @@ -50,17 +51,22 @@ public HierarchicalModel()
/// <summary>
/// </summary>
[JsonProperty(PropertyName = "children")]
public IList<string> Children { get; set; }
public IList<JsonChild> Children { get; set; }

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "inherits")]
public PrebuiltDomainObject Inherits { get; set; }
[JsonProperty(PropertyName = "features")]
public IList<JsonModelFeatureInformation> Features { get; set; }

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "roles")]
public IList<string> Roles { get; set; }

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "inherits")]
public PrebuiltDomainObject Inherits { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ public JSONModelFeature()
/// add to LUIS existing vocabulary features. It is used as a lexicon
/// lookup feature where its value is 1 if the lexicon contains a given
/// word or 0 if it doesn’t. Default value is true.</param>
public JSONModelFeature(bool? activated = default(bool?), string name = default(string), string words = default(string), bool? mode = default(bool?))
/// <param name="enabledForAllModels">Indicates if the Phraselist is
/// enabled for all models in the application.</param>
public JSONModelFeature(bool? activated = default(bool?), string name = default(string), string words = default(string), bool? mode = default(bool?), bool? enabledForAllModels = default(bool?))
{
Activated = activated;
Name = name;
Words = words;
Mode = mode;
EnabledForAllModels = enabledForAllModels;
CustomInit();
}

Expand Down Expand Up @@ -90,5 +93,12 @@ public JSONModelFeature()
[JsonProperty(PropertyName = "mode")]
public bool? Mode { get; set; }

/// <summary>
/// Gets or sets indicates if the Phraselist is enabled for all models
/// in the application.
/// </summary>
[JsonProperty(PropertyName = "enabledForAllModels")]
public bool? EnabledForAllModels { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

public partial class JsonChild
{
/// <summary>
/// Initializes a new instance of the JsonChild class.
/// </summary>
public JsonChild()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the JsonChild class.
/// </summary>
public JsonChild(string name = default(string), string instanceOf = default(string), IList<JsonChild> children = default(IList<JsonChild>), IList<JsonModelFeatureInformation> features = default(IList<JsonModelFeatureInformation>))
{
Name = name;
InstanceOf = instanceOf;
Children = children;
Features = features;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "instanceOf")]
public string InstanceOf { get; set; }

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "children")]
public IList<JsonChild> Children { get; set; }

/// <summary>
/// </summary>
[JsonProperty(PropertyName = "features")]
public IList<JsonModelFeatureInformation> Features { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring.Models
{
using Newtonsoft.Json;
using System.Linq;

/// <summary>
/// An object containing the model feature information either the model
/// name or feature name.
/// </summary>
public partial class JsonModelFeatureInformation
{
/// <summary>
/// Initializes a new instance of the JsonModelFeatureInformation
/// class.
/// </summary>
public JsonModelFeatureInformation()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the JsonModelFeatureInformation
/// class.
/// </summary>
/// <param name="modelName">The name of the model used.</param>
/// <param name="featureName">The name of the feature used.</param>
public JsonModelFeatureInformation(string modelName = default(string), string featureName = default(string))
{
ModelName = modelName;
FeatureName = featureName;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets the name of the model used.
/// </summary>
[JsonProperty(PropertyName = "modelName")]
public string ModelName { get; set; }

/// <summary>
/// Gets or sets the name of the feature used.
/// </summary>
[JsonProperty(PropertyName = "featureName")]
public string FeatureName { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,17 @@ public LuisApp()
/// <param name="entities">List of entities.</param>
/// <param name="closedLists">List of list entities.</param>
/// <param name="composites">List of composite entities.</param>
/// <param name="hierarchicals">List of hierarchical entities.</param>
/// <param name="patternAnyEntities">List of Pattern.Any
/// entities.</param>
/// <param name="regexEntities">List of regular expression
/// entities.</param>
/// <param name="prebuiltEntities">List of prebuilt entities.</param>
/// <param name="regexFeatures">List of pattern features.</param>
/// <param name="modelFeatures">List of model features.</param>
/// <param name="phraselists">List of model features.</param>
/// <param name="patterns">List of patterns.</param>
/// <param name="utterances">List of example utterances.</param>
public LuisApp(IDictionary<string, object> additionalProperties = default(IDictionary<string, object>), string name = default(string), string versionId = default(string), string desc = default(string), string culture = default(string), IList<HierarchicalModel> intents = default(IList<HierarchicalModel>), IList<HierarchicalModel> entities = default(IList<HierarchicalModel>), IList<ClosedList> closedLists = default(IList<ClosedList>), IList<HierarchicalModel> composites = default(IList<HierarchicalModel>), IList<PatternAny> patternAnyEntities = default(IList<PatternAny>), IList<RegexEntity> regexEntities = default(IList<RegexEntity>), IList<PrebuiltEntity> prebuiltEntities = default(IList<PrebuiltEntity>), IList<JSONRegexFeature> regexFeatures = default(IList<JSONRegexFeature>), IList<JSONModelFeature> modelFeatures = default(IList<JSONModelFeature>), IList<PatternRule> patterns = default(IList<PatternRule>), IList<JSONUtterance> utterances = default(IList<JSONUtterance>))
public LuisApp(IDictionary<string, object> additionalProperties = default(IDictionary<string, object>), string name = default(string), string versionId = default(string), string desc = default(string), string culture = default(string), IList<HierarchicalModel> intents = default(IList<HierarchicalModel>), IList<HierarchicalModel> entities = default(IList<HierarchicalModel>), IList<ClosedList> closedLists = default(IList<ClosedList>), IList<HierarchicalModel> composites = default(IList<HierarchicalModel>), IList<HierarchicalModel> hierarchicals = default(IList<HierarchicalModel>), IList<PatternAny> patternAnyEntities = default(IList<PatternAny>), IList<RegexEntity> regexEntities = default(IList<RegexEntity>), IList<PrebuiltEntity> prebuiltEntities = default(IList<PrebuiltEntity>), IList<JSONRegexFeature> regexFeatures = default(IList<JSONRegexFeature>), IList<JSONModelFeature> phraselists = default(IList<JSONModelFeature>), IList<PatternRule> patterns = default(IList<PatternRule>), IList<JSONUtterance> utterances = default(IList<JSONUtterance>))
{
AdditionalProperties = additionalProperties;
Name = name;
Expand All @@ -63,11 +64,12 @@ public LuisApp()
Entities = entities;
ClosedLists = closedLists;
Composites = composites;
Hierarchicals = hierarchicals;
PatternAnyEntities = patternAnyEntities;
RegexEntities = regexEntities;
PrebuiltEntities = prebuiltEntities;
RegexFeatures = regexFeatures;
ModelFeatures = modelFeatures;
Phraselists = phraselists;
Patterns = patterns;
Utterances = utterances;
CustomInit();
Expand Down Expand Up @@ -133,6 +135,12 @@ public LuisApp()
[JsonProperty(PropertyName = "composites")]
public IList<HierarchicalModel> Composites { get; set; }

/// <summary>
/// Gets or sets list of hierarchical entities.
/// </summary>
[JsonProperty(PropertyName = "hierarchicals")]
public IList<HierarchicalModel> Hierarchicals { get; set; }

/// <summary>
/// Gets or sets list of Pattern.Any entities.
/// </summary>
Expand Down Expand Up @@ -160,8 +168,8 @@ public LuisApp()
/// <summary>
/// Gets or sets list of model features.
/// </summary>
[JsonProperty(PropertyName = "model_features")]
public IList<JSONModelFeature> ModelFeatures { get; set; }
[JsonProperty(PropertyName = "phraselists")]
public IList<JSONModelFeature> Phraselists { get; set; }

/// <summary>
/// Gets or sets list of patterns.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,21 @@ public void ImportApp()
Assert.NotNull(testApp);
});
}

[Fact]
public void ImportAppWithEnabledForAllModels()
{
var appJson = File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "SessionRecords/ImportAppWithEnabledForAllModels.json"));
var app = JsonConvert.DeserializeObject<LuisApp>(appJson);

UseClientFor(async client =>
{
var testAppId = await client.Apps.ImportAsync(app, "Test Import LUIS App With Enabled For All Models");
var testApp = await client.Apps.GetAsync(testAppId);
await client.Apps.DeleteAsync(testAppId);

Assert.NotNull(testApp);
});
}
}
}
Loading