diff --git a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/Features.cs b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/Features.cs
index c0939ca4d880..d76caa0bde63 100644
--- a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/Features.cs
+++ b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/Features.cs
@@ -51,8 +51,7 @@ public Features(LUISAuthoringClient client)
public LUISAuthoringClient Client { get; private set; }
///
- /// [DEPRECATED NOTICE: This operation will soon be removed] Gets all the
- /// pattern features.
+ /// Creates a new phraselist feature in a version of the application.
///
///
/// The application ID.
@@ -60,11 +59,9 @@ public Features(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// The number of entries to skip. Default value is 0.
- ///
- ///
- /// The number of entries to return. Maximum page size is 500. Default is 100.
+ ///
+ /// A Phraselist object containing Name, comma-separated Phrases and the
+ /// isExchangeable boolean. Default value for isExchangeable is true.
///
///
/// Headers that will be added to request.
@@ -87,8 +84,7 @@ public Features(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- [System.Obsolete("This operation is deprecated. Please do not use it any longer.")]
- public async Task>> ListApplicationVersionPatternFeaturesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> AddPhraseListWithHttpMessagesAsync(System.Guid appId, string versionId, PhraselistCreateObject phraselistCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -98,17 +94,9 @@ public Features(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (skip < 0)
- {
- throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
- }
- if (take > 500)
- {
- throw new ValidationException(ValidationRules.InclusiveMaximum, "take", 500);
- }
- if (take < 0)
+ if (phraselistCreateObject == null)
{
- throw new ValidationException(ValidationRules.InclusiveMinimum, "take", 0);
+ throw new ValidationException(ValidationRules.CannotBeNull, "phraselistCreateObject");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -119,34 +107,20 @@ public Features(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("skip", skip);
- tracingParameters.Add("take", take);
+ tracingParameters.Add("phraselistCreateObject", phraselistCreateObject);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListApplicationVersionPatternFeatures", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "AddPhraseList", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/patterns";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/phraselists";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
- List _queryParameters = new List();
- if (skip != null)
- {
- _queryParameters.Add(string.Format("skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
- }
- if (take != null)
- {
- _queryParameters.Add(string.Format("take={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(take, Client.SerializationSettings).Trim('"'))));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + string.Join("&", _queryParameters);
- }
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -165,6 +139,12 @@ public Features(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
+ if(phraselistCreateObject != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(phraselistCreateObject, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -185,7 +165,7 @@ public Features(LUISAuthoringClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 201)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -215,16 +195,16 @@ public Features(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse>();
+ var _result = new HttpOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
- if ((int)_statusCode == 200)
+ if ((int)_statusCode == 201)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -244,7 +224,7 @@ public Features(LUISAuthoringClient client)
}
///
- /// Creates a new phraselist feature in a version of the application.
+ /// Gets all the phraselist features in a version of the application.
///
///
/// The application ID.
@@ -252,9 +232,11 @@ public Features(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// A Phraselist object containing Name, comma-separated Phrases and the
- /// isExchangeable boolean. Default value for isExchangeable is true.
+ ///
+ /// The number of entries to skip. Default value is 0.
+ ///
+ ///
+ /// The number of entries to return. Maximum page size is 500. Default is 100.
///
///
/// Headers that will be added to request.
@@ -277,7 +259,7 @@ public Features(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> AddPhraseListWithHttpMessagesAsync(System.Guid appId, string versionId, PhraselistCreateObject phraselistCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListPhraseListsWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -287,9 +269,17 @@ public Features(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (phraselistCreateObject == null)
+ if (skip < 0)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "phraselistCreateObject");
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
+ }
+ if (take > 500)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMaximum, "take", 500);
+ }
+ if (take < 0)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "take", 0);
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -300,9 +290,10 @@ public Features(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("phraselistCreateObject", phraselistCreateObject);
+ tracingParameters.Add("skip", skip);
+ tracingParameters.Add("take", take);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "AddPhraseList", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListPhraseLists", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
@@ -310,10 +301,23 @@ public Features(LUISAuthoringClient client)
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
+ List _queryParameters = new List();
+ if (skip != null)
+ {
+ _queryParameters.Add(string.Format("skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
+ }
+ if (take != null)
+ {
+ _queryParameters.Add(string.Format("take={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(take, Client.SerializationSettings).Trim('"'))));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -332,12 +336,6 @@ public Features(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
- if(phraselistCreateObject != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(phraselistCreateObject, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -358,7 +356,7 @@ public Features(LUISAuthoringClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -388,16 +386,16 @@ public Features(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
- if ((int)_statusCode == 201)
+ if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -417,7 +415,8 @@ public Features(LUISAuthoringClient client)
}
///
- /// Gets all the phraselist features in a version of the application.
+ /// Gets all the extraction phraselist and pattern features in a version of the
+ /// application.
///
///
/// The application ID.
@@ -452,7 +451,7 @@ public Features(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListPhraseListsWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> ListWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -486,11 +485,11 @@ public Features(LUISAuthoringClient client)
tracingParameters.Add("skip", skip);
tracingParameters.Add("take", take);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListPhraseLists", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/phraselists";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/features";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
@@ -579,7 +578,7 @@ public Features(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse>();
+ var _result = new HttpOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
@@ -588,7 +587,7 @@ public Features(LUISAuthoringClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -608,8 +607,7 @@ public Features(LUISAuthoringClient client)
}
///
- /// Gets all the extraction phraselist and pattern features in a version of the
- /// application.
+ /// Gets phraselist feature info in a version of the application.
///
///
/// The application ID.
@@ -617,11 +615,8 @@ public Features(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// The number of entries to skip. Default value is 0.
- ///
- ///
- /// The number of entries to return. Maximum page size is 500. Default is 100.
+ ///
+ /// The ID of the feature to be retrieved.
///
///
/// Headers that will be added to request.
@@ -644,7 +639,7 @@ public Features(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetPhraseListWithHttpMessagesAsync(System.Guid appId, string versionId, int phraselistId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -654,18 +649,6 @@ public Features(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (skip < 0)
- {
- throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
- }
- if (take > 500)
- {
- throw new ValidationException(ValidationRules.InclusiveMaximum, "take", 500);
- }
- if (take < 0)
- {
- throw new ValidationException(ValidationRules.InclusiveMinimum, "take", 0);
- }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -675,34 +658,191 @@ public Features(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("skip", skip);
- tracingParameters.Add("take", take);
+ tracingParameters.Add("phraselistId", phraselistId);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "GetPhraseList", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/features";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/phraselists/{phraselistId}";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
- List _queryParameters = new List();
- if (skip != null)
+ _url = _url.Replace("{phraselistId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(phraselistId, Client.SerializationSettings).Trim('"')));
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+
+
+ if (customHeaders != null)
{
- _queryParameters.Add(string.Format("skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
}
- if (take != null)
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
{
- _queryParameters.Add(string.Format("take={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(take, Client.SerializationSettings).Trim('"'))));
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
- if (_queryParameters.Count > 0)
+ // Send Request
+ if (_shouldTrace)
{
- _url += "?" + string.Join("&", _queryParameters);
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new HttpOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Updates the phrases, the state and the name of the phraselist feature in a
+ /// version of the application.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The ID of the feature to be updated.
+ ///
+ ///
+ /// The new values for: - Just a boolean called IsActive, in which case the
+ /// status of the feature will be changed. - Name, Pattern, Mode, and a boolean
+ /// called IsActive to update the feature.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdatePhraseListWithHttpMessagesAsync(System.Guid appId, string versionId, int phraselistId, PhraselistUpdateObject phraselistUpdateObject = default(PhraselistUpdateObject), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.Endpoint == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.Endpoint");
+ }
+ if (versionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("appId", appId);
+ tracingParameters.Add("versionId", versionId);
+ tracingParameters.Add("phraselistId", phraselistId);
+ tracingParameters.Add("phraselistUpdateObject", phraselistUpdateObject);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdatePhraseList", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri;
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/phraselists/{phraselistId}";
+ _url = _url.Replace("{Endpoint}", Client.Endpoint);
+ _url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
+ _url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
+ _url = _url.Replace("{phraselistId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(phraselistId, Client.SerializationSettings).Trim('"')));
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -721,6 +861,12 @@ public Features(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
+ if(phraselistUpdateObject != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(phraselistUpdateObject, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -771,7 +917,7 @@ public Features(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse();
+ var _result = new HttpOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
@@ -780,7 +926,7 @@ public Features(LUISAuthoringClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -800,7 +946,7 @@ public Features(LUISAuthoringClient client)
}
///
- /// Gets phraselist feature info in a version of the application.
+ /// Deletes a phraselist feature from a version of the application.
///
///
/// The application ID.
@@ -809,7 +955,7 @@ public Features(LUISAuthoringClient client)
/// The version ID.
///
///
- /// The ID of the feature to be retrieved.
+ /// The ID of the feature to be deleted.
///
///
/// Headers that will be added to request.
@@ -832,7 +978,7 @@ public Features(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetPhraseListWithHttpMessagesAsync(System.Guid appId, string versionId, int phraselistId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> DeletePhraseListWithHttpMessagesAsync(System.Guid appId, string versionId, int phraselistId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -853,7 +999,7 @@ public Features(LUISAuthoringClient client)
tracingParameters.Add("versionId", versionId);
tracingParameters.Add("phraselistId", phraselistId);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetPhraseList", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "DeletePhraseList", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
@@ -865,7 +1011,7 @@ public Features(LUISAuthoringClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -934,7 +1080,7 @@ public Features(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse();
+ var _result = new HttpOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
@@ -943,7 +1089,7 @@ public Features(LUISAuthoringClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -963,8 +1109,8 @@ public Features(LUISAuthoringClient client)
}
///
- /// Updates the phrases, the state and the name of the phraselist feature in a
- /// version of the application.
+ /// Adds a new feature relation to be used by the intent in a version of the
+ /// application.
///
///
/// The application ID.
@@ -972,13 +1118,11 @@ public Features(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// The ID of the feature to be updated.
+ ///
+ /// The intent classifier ID.
///
- ///
- /// The new values for: - Just a boolean called IsActive, in which case the
- /// status of the feature will be changed. - Name, Pattern, Mode, and a boolean
- /// called IsActive to update the feature.
+ ///
+ /// A Feature relation information object.
///
///
/// Headers that will be added to request.
@@ -1001,7 +1145,7 @@ public Features(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> UpdatePhraseListWithHttpMessagesAsync(System.Guid appId, string versionId, int phraselistId, PhraselistUpdateObject phraselistUpdateObject = default(PhraselistUpdateObject), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> AddIntentFeatureWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid intentId, ModelFeatureInformation featureRelationCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -1011,6 +1155,10 @@ public Features(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
+ if (featureRelationCreateObject == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "featureRelationCreateObject");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1020,22 +1168,22 @@ public Features(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("phraselistId", phraselistId);
- tracingParameters.Add("phraselistUpdateObject", phraselistUpdateObject);
+ tracingParameters.Add("intentId", intentId);
+ tracingParameters.Add("featureRelationCreateObject", featureRelationCreateObject);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "UpdatePhraseList", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "AddIntentFeature", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/phraselists/{phraselistId}";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/intents/{intentId}/features";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
- _url = _url.Replace("{phraselistId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(phraselistId, Client.SerializationSettings).Trim('"')));
+ _url = _url.Replace("{intentId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(intentId, Client.SerializationSettings).Trim('"')));
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -1054,9 +1202,9 @@ public Features(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
- if(phraselistUpdateObject != null)
+ if(featureRelationCreateObject != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(phraselistUpdateObject, Client.SerializationSettings);
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(featureRelationCreateObject, Client.SerializationSettings);
_httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
@@ -1139,7 +1287,8 @@ public Features(LUISAuthoringClient client)
}
///
- /// Deletes a phraselist feature from a version of the application.
+ /// Adds a new feature relation to be used by the entity in a version of the
+ /// application.
///
///
/// The application ID.
@@ -1147,8 +1296,11 @@ public Features(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// The ID of the feature to be deleted.
+ ///
+ /// The entity extractor ID.
+ ///
+ ///
+ /// A Feature relation information object.
///
///
/// Headers that will be added to request.
@@ -1171,7 +1323,7 @@ public Features(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> DeletePhraseListWithHttpMessagesAsync(System.Guid appId, string versionId, int phraselistId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> AddEntityFeatureWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, ModelFeatureInformation featureRelationCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -1181,6 +1333,10 @@ public Features(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
+ if (featureRelationCreateObject == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "featureRelationCreateObject");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1190,21 +1346,22 @@ public Features(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("phraselistId", phraselistId);
+ tracingParameters.Add("entityId", entityId);
+ tracingParameters.Add("featureRelationCreateObject", featureRelationCreateObject);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "DeletePhraseList", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "AddEntityFeature", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/phraselists/{phraselistId}";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/entities/{entityId}/features";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
- _url = _url.Replace("{phraselistId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(phraselistId, Client.SerializationSettings).Trim('"')));
+ _url = _url.Replace("{entityId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(entityId, Client.SerializationSettings).Trim('"')));
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -1223,6 +1380,12 @@ public Features(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
+ if(featureRelationCreateObject != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(featureRelationCreateObject, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
diff --git a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/FeaturesExtensions.cs b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/FeaturesExtensions.cs
index 4cf513f50045..22f8f77764e0 100644
--- a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/FeaturesExtensions.cs
+++ b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/FeaturesExtensions.cs
@@ -21,37 +21,6 @@ namespace Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring
///
public static partial class FeaturesExtensions
{
- ///
- /// [DEPRECATED NOTICE: This operation will soon be removed] Gets all the
- /// pattern features.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The application ID.
- ///
- ///
- /// The version ID.
- ///
- ///
- /// The number of entries to skip. Default value is 0.
- ///
- ///
- /// The number of entries to return. Maximum page size is 500. Default is 100.
- ///
- ///
- /// The cancellation token.
- ///
- [System.Obsolete("This operation is deprecated. Please do not use it any longer.")]
- public static async Task> ListApplicationVersionPatternFeaturesAsync(this IFeatures operations, System.Guid appId, string versionId, int? skip = 0, int? take = 100, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListApplicationVersionPatternFeaturesWithHttpMessagesAsync(appId, versionId, skip, take, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
///
/// Creates a new phraselist feature in a version of the application.
///
@@ -222,5 +191,65 @@ public static partial class FeaturesExtensions
}
}
+ ///
+ /// Adds a new feature relation to be used by the intent in a version of the
+ /// application.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The intent classifier ID.
+ ///
+ ///
+ /// A Feature relation information object.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task AddIntentFeatureAsync(this IFeatures operations, System.Guid appId, string versionId, System.Guid intentId, ModelFeatureInformation featureRelationCreateObject, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.AddIntentFeatureWithHttpMessagesAsync(appId, versionId, intentId, featureRelationCreateObject, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Adds a new feature relation to be used by the entity in a version of the
+ /// application.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The entity extractor ID.
+ ///
+ ///
+ /// A Feature relation information object.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task AddEntityFeatureAsync(this IFeatures operations, System.Guid appId, string versionId, System.Guid entityId, ModelFeatureInformation featureRelationCreateObject, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.AddEntityFeatureWithHttpMessagesAsync(appId, versionId, entityId, featureRelationCreateObject, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
}
}
diff --git a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/IFeatures.cs b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/IFeatures.cs
index f87b2df3b8df..53abb9f4d4a5 100644
--- a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/IFeatures.cs
+++ b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/IFeatures.cs
@@ -22,40 +22,6 @@ namespace Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring
///
public partial interface IFeatures
{
- ///
- /// [DEPRECATED NOTICE: This operation will soon be removed] Gets all
- /// the pattern features.
- ///
- ///
- /// The application ID.
- ///
- ///
- /// The version ID.
- ///
- ///
- /// The number of entries to skip. Default value is 0.
- ///
- ///
- /// The number of entries to return. Maximum page size is 500. Default
- /// is 100.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- [System.Obsolete("This operation is deprecated. Please do not use it any longer.")]
- Task>> ListApplicationVersionPatternFeaturesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Creates a new phraselist feature in a version of the application.
///
@@ -241,5 +207,69 @@ public partial interface IFeatures
/// Thrown when a required parameter is null
///
Task> DeletePhraseListWithHttpMessagesAsync(System.Guid appId, string versionId, int phraselistId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Adds a new feature relation to be used by the intent in a version
+ /// of the application.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The intent classifier ID.
+ ///
+ ///
+ /// A Feature relation information object.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> AddIntentFeatureWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid intentId, ModelFeatureInformation featureRelationCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Adds a new feature relation to be used by the entity in a version
+ /// of the application.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The entity extractor ID.
+ ///
+ ///
+ /// A Feature relation information object.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> AddEntityFeatureWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, ModelFeatureInformation featureRelationCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/IModel.cs b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/IModel.cs
index 4e3abf48133e..3d95927a129b 100644
--- a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/IModel.cs
+++ b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/IModel.cs
@@ -40,7 +40,7 @@ public partial interface IModel
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -84,7 +84,7 @@ public partial interface IModel
///
Task>> ListIntentsWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Adds a simple entity extractor to a version of the application.
+ /// Adds an entity extractor to a version of the application.
///
///
/// The application ID.
@@ -92,9 +92,9 @@ public partial interface IModel
///
/// The version ID.
///
- ///
- /// A model object containing the name for the new simple entity
- /// extractor.
+ ///
+ /// A model object containing the name of the new entity extractor and
+ /// its children.
///
///
/// The headers that will be added to request.
@@ -111,7 +111,7 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task> AddEntityWithHttpMessagesAsync(System.Guid appId, string versionId, ModelCreateObject modelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> AddEntityWithHttpMessagesAsync(System.Guid appId, string versionId, EntityModelCreateObject entityModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Gets information about all the simple entity models in a version of
/// the application.
@@ -144,37 +144,7 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task>> ListEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Adds a hierarchical entity extractor to a version of the
- /// application.
- ///
- ///
- /// The application ID.
- ///
- ///
- /// The version ID.
- ///
- ///
- /// A model containing the name and children of the new entity
- /// extractor.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> AddHierarchicalEntityWithHttpMessagesAsync(System.Guid appId, string versionId, HierarchicalEntityModel hierarchicalModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Gets information about all the hierarchical entity models in a
/// version of the application.
@@ -209,35 +179,6 @@ public partial interface IModel
///
Task>> ListHierarchicalEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Adds a composite entity extractor to a version of the application.
- ///
- ///
- /// The application ID.
- ///
- ///
- /// The version ID.
- ///
- ///
- /// A model containing the name and children of the new entity
- /// extractor.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> AddCompositeEntityWithHttpMessagesAsync(System.Guid appId, string versionId, CompositeEntityModel compositeModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
/// Gets information about all the composite entity models in a version
/// of the application.
///
@@ -609,9 +550,166 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task> GetEntityWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetEntityWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes an entity or a child from a version of the application.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The entity extractor or the child entity extractor ID.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> DeleteEntityWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Updates the name of an entity in a version of the application.
+ /// Updates the name of an entity extractor or the name and instanceOf
+ /// model of a child entity extractor.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The entity extractor or the child entity extractor ID.
+ ///
+ ///
+ /// A model object containing the name new entity extractor or the name
+ /// and instance of model of a child entity extractor
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateEntityChildWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, EntityModelUpdateObject entityModelUpdateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the information of the features used by the intent in a
+ /// version of the application.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The intent classifier ID.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> GetIntentFeaturesWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid intentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates the information of the features used by the intent in a
+ /// version of the application.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The intent classifier ID.
+ ///
+ ///
+ /// A list of feature information objects containing the new feature
+ /// relations.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> ReplaceIntentFeaturesWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid intentId, IList featureRelationsUpdateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Deletes a relation from the feature relations used by the intent in
+ /// a version of the application.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The intent classifier ID.
+ ///
+ ///
+ /// A feature information object containing the feature relation to
+ /// delete.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> DeleteIntentFeatureWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid intentId, ModelFeatureInformation featureRelationDeleteObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Gets the information of the features used by the entity in a
+ /// version of the application.
///
///
/// The application ID.
@@ -622,8 +720,38 @@ public partial interface IModel
///
/// The entity extractor ID.
///
- ///
- /// A model object containing the new entity extractor name.
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> GetEntityFeaturesWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates the information of the features used by the entity in a
+ /// version of the application.
+ ///
+ ///
+ /// The application ID.
+ ///
+ ///
+ /// The version ID.
+ ///
+ ///
+ /// The entity extractor ID.
+ ///
+ ///
+ /// A list of feature information objects containing the new feature
+ /// relations.
///
///
/// The headers that will be added to request.
@@ -640,9 +768,10 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task> UpdateEntityWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, ModelUpdateObject modelUpdateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> ReplaceEntityFeaturesWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, IList featureRelationsUpdateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Deletes an entity from a version of the application.
+ /// Deletes a relation from the feature relations used by the entity in
+ /// a version of the application.
///
///
/// The application ID.
@@ -653,6 +782,10 @@ public partial interface IModel
///
/// The entity extractor ID.
///
+ ///
+ /// A feature information object containing the feature relation to
+ /// delete.
+ ///
///
/// The headers that will be added to request.
///
@@ -668,7 +801,7 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task> DeleteEntityWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> DeleteEntityFeatureWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, ModelFeatureInformation featureRelationDeleteObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Gets information about a hierarchical entity in a version of the
/// application.
@@ -699,8 +832,8 @@ public partial interface IModel
///
Task> GetHierarchicalEntityWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Updates the name and children of a hierarchical entity model in a
- /// version of the application.
+ /// Updates the name of a hierarchical entity model in a version of the
+ /// application.
///
///
/// The application ID.
@@ -711,8 +844,8 @@ public partial interface IModel
///
/// The hierarchical entity extractor ID.
///
- ///
- /// Model containing names of the children of the hierarchical entity.
+ ///
+ /// Model containing names of the hierarchical entity.
///
///
/// The headers that will be added to request.
@@ -729,7 +862,7 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task> UpdateHierarchicalEntityWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, HierarchicalEntityModel hierarchicalModelUpdateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> UpdateHierarchicalEntityWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, ModelUpdateObject modelUpdateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Deletes a hierarchical entity from a version of the application.
///
@@ -1385,8 +1518,8 @@ public partial interface IModel
///
Task> DeleteCustomPrebuiltDomainWithHttpMessagesAsync(System.Guid appId, string versionId, string domainName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Gets information about the child's model contained in an
- /// hierarchical entity child model in a version of the application.
+ /// Creates a single child in an existing entity model hierarchy in a
+ /// version of the application.
///
///
/// The application ID.
@@ -1394,11 +1527,12 @@ public partial interface IModel
///
/// The version ID.
///
- ///
- /// The hierarchical entity extractor ID.
+ ///
+ /// The entity extractor ID.
///
- ///
- /// The hierarchical entity extractor child ID.
+ ///
+ /// A model object containing the name of the new child model and its
+ /// children.
///
///
/// The headers that will be added to request.
@@ -1415,10 +1549,10 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task> GetHierarchicalEntityChildWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, System.Guid hChildId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> AddEntityChildWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid entityId, ChildEntityModelCreateObject childEntityModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Renames a single child in an existing hierarchical entity model in
- /// a version of the application.
+ /// Gets information about the child's model contained in an
+ /// hierarchical entity child model in a version of the application.
///
///
/// The application ID.
@@ -1432,9 +1566,6 @@ public partial interface IModel
///
/// The hierarchical entity extractor child ID.
///
- ///
- /// Model object containing new name of the hierarchical entity child.
- ///
///
/// The headers that will be added to request.
///
@@ -1450,10 +1581,10 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task> UpdateHierarchicalEntityChildWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, System.Guid hChildId, HierarchicalChildModelUpdateObject hierarchicalChildModelUpdateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetHierarchicalEntityChildWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, System.Guid hChildId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Deletes a hierarchical entity extractor child in a version of the
- /// application.
+ /// Renames a single child in an existing hierarchical entity model in
+ /// a version of the application.
///
///
/// The application ID.
@@ -1467,6 +1598,9 @@ public partial interface IModel
///
/// The hierarchical entity extractor child ID.
///
+ ///
+ /// Model object containing new name of the hierarchical entity child.
+ ///
///
/// The headers that will be added to request.
///
@@ -1482,10 +1616,10 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task> DeleteHierarchicalEntityChildWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, System.Guid hChildId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> UpdateHierarchicalEntityChildWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, System.Guid hChildId, HierarchicalChildModelUpdateObject hierarchicalChildModelUpdateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Creates a single child in an existing hierarchical entity model in
- /// a version of the application.
+ /// Deletes a hierarchical entity extractor child in a version of the
+ /// application.
///
///
/// The application ID.
@@ -1496,9 +1630,8 @@ public partial interface IModel
///
/// The hierarchical entity extractor ID.
///
- ///
- /// A model object containing the name of the new hierarchical child
- /// model.
+ ///
+ /// The hierarchical entity extractor child ID.
///
///
/// The headers that will be added to request.
@@ -1515,7 +1648,7 @@ public partial interface IModel
///
/// Thrown when a required parameter is null
///
- Task> AddHierarchicalEntityChildWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, HierarchicalChildModelCreateObject hierarchicalChildModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> DeleteHierarchicalEntityChildWithHttpMessagesAsync(System.Guid appId, string versionId, System.Guid hEntityId, System.Guid hChildId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Creates a single child in an existing composite entity model in a
/// version of the application.
diff --git a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/LUISAuthoringClient.cs b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/LUISAuthoringClient.cs
index 3688c4eb7f47..4820cc329ee3 100644
--- a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/LUISAuthoringClient.cs
+++ b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/LUISAuthoringClient.cs
@@ -234,7 +234,7 @@ private void Initialize()
Pattern = new Pattern(this);
Settings = new Settings(this);
AzureAccounts = new AzureAccounts(this);
- BaseUri = "{Endpoint}/luis/api/v2.0";
+ BaseUri = "{Endpoint}/luis/authoring/v3.0-preview";
SerializationSettings = new JsonSerializerSettings
{
Formatting = Newtonsoft.Json.Formatting.Indented,
diff --git a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/Model.cs b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/Model.cs
index 2ced64aad804..44b8ca690257 100644
--- a/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/Model.cs
+++ b/sdk/cognitiveservices/Language.LUIS.Authoring/src/Generated/Model.cs
@@ -68,7 +68,7 @@ public Model(LUISAuthoringClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -166,12 +166,19 @@ public Model(LUISAuthoringClient client)
string _responseContent = null;
if ((int)_statusCode != 201)
{
- var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
- if (_httpResponse.Content != null) {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
}
- else {
- _responseContent = string.Empty;
+ catch (JsonException)
+ {
+ // Ignore the exception
}
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
@@ -407,7 +414,7 @@ public Model(LUISAuthoringClient client)
}
///
- /// Adds a simple entity extractor to a version of the application.
+ /// Adds an entity extractor to a version of the application.
///
///
/// The application ID.
@@ -415,8 +422,9 @@ public Model(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// A model object containing the name for the new simple entity extractor.
+ ///
+ /// A model object containing the name of the new entity extractor and its
+ /// children.
///
///
/// Headers that will be added to request.
@@ -439,7 +447,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> AddEntityWithHttpMessagesAsync(System.Guid appId, string versionId, ModelCreateObject modelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> AddEntityWithHttpMessagesAsync(System.Guid appId, string versionId, EntityModelCreateObject entityModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -449,9 +457,9 @@ public Model(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (modelCreateObject == null)
+ if (entityModelCreateObject == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "modelCreateObject");
+ throw new ValidationException(ValidationRules.CannotBeNull, "entityModelCreateObject");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -462,7 +470,7 @@ public Model(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("modelCreateObject", modelCreateObject);
+ tracingParameters.Add("entityModelCreateObject", entityModelCreateObject);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "AddEntity", tracingParameters);
}
@@ -494,9 +502,9 @@ public Model(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
- if(modelCreateObject != null)
+ if(entityModelCreateObject != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(modelCreateObject, Client.SerializationSettings);
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(entityModelCreateObject, Client.SerializationSettings);
_httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
@@ -615,7 +623,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -742,7 +750,7 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse>();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
@@ -751,7 +759,7 @@ public Model(LUISAuthoringClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -771,7 +779,8 @@ public Model(LUISAuthoringClient client)
}
///
- /// Adds a hierarchical entity extractor to a version of the application.
+ /// Gets information about all the hierarchical entity models in a version of
+ /// the application.
///
///
/// The application ID.
@@ -779,8 +788,11 @@ public Model(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// A model containing the name and children of the new entity extractor.
+ ///
+ /// The number of entries to skip. Default value is 0.
+ ///
+ ///
+ /// The number of entries to return. Maximum page size is 500. Default is 100.
///
///
/// Headers that will be added to request.
@@ -803,7 +815,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> AddHierarchicalEntityWithHttpMessagesAsync(System.Guid appId, string versionId, HierarchicalEntityModel hierarchicalModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListHierarchicalEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -813,9 +825,17 @@ public Model(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (hierarchicalModelCreateObject == null)
+ if (skip < 0)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
+ }
+ if (take > 500)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMaximum, "take", 500);
+ }
+ if (take < 0)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "hierarchicalModelCreateObject");
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "take", 0);
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -826,9 +846,10 @@ public Model(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("hierarchicalModelCreateObject", hierarchicalModelCreateObject);
+ tracingParameters.Add("skip", skip);
+ tracingParameters.Add("take", take);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "AddHierarchicalEntity", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListHierarchicalEntities", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
@@ -836,10 +857,23 @@ public Model(LUISAuthoringClient client)
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
+ List _queryParameters = new List();
+ if (skip != null)
+ {
+ _queryParameters.Add(string.Format("skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
+ }
+ if (take != null)
+ {
+ _queryParameters.Add(string.Format("take={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(take, Client.SerializationSettings).Trim('"'))));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -858,12 +892,6 @@ public Model(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
- if(hierarchicalModelCreateObject != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(hierarchicalModelCreateObject, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -884,7 +912,7 @@ public Model(LUISAuthoringClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -914,16 +942,16 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
- if ((int)_statusCode == 201)
+ if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -943,8 +971,8 @@ public Model(LUISAuthoringClient client)
}
///
- /// Gets information about all the hierarchical entity models in a version of
- /// the application.
+ /// Gets information about all the composite entity models in a version of the
+ /// application.
///
///
/// The application ID.
@@ -979,7 +1007,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListHierarchicalEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListCompositeEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -1013,11 +1041,11 @@ public Model(LUISAuthoringClient client)
tracingParameters.Add("skip", skip);
tracingParameters.Add("take", take);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListHierarchicalEntities", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListCompositeEntities", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/hierarchicalentities";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/compositeentities";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
@@ -1106,7 +1134,7 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse>();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
@@ -1115,7 +1143,7 @@ public Model(LUISAuthoringClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1135,7 +1163,8 @@ public Model(LUISAuthoringClient client)
}
///
- /// Adds a composite entity extractor to a version of the application.
+ /// Gets information about all the list entity models in a version of the
+ /// application.
///
///
/// The application ID.
@@ -1143,8 +1172,11 @@ public Model(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// A model containing the name and children of the new entity extractor.
+ ///
+ /// The number of entries to skip. Default value is 0.
+ ///
+ ///
+ /// The number of entries to return. Maximum page size is 500. Default is 100.
///
///
/// Headers that will be added to request.
@@ -1167,7 +1199,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> AddCompositeEntityWithHttpMessagesAsync(System.Guid appId, string versionId, CompositeEntityModel compositeModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListClosedListsWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -1177,9 +1209,17 @@ public Model(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (compositeModelCreateObject == null)
+ if (skip < 0)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
+ }
+ if (take > 500)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMaximum, "take", 500);
+ }
+ if (take < 0)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "compositeModelCreateObject");
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "take", 0);
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1190,20 +1230,34 @@ public Model(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("compositeModelCreateObject", compositeModelCreateObject);
+ tracingParameters.Add("skip", skip);
+ tracingParameters.Add("take", take);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "AddCompositeEntity", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListClosedLists", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/compositeentities";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/closedlists";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
+ List _queryParameters = new List();
+ if (skip != null)
+ {
+ _queryParameters.Add(string.Format("skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
+ }
+ if (take != null)
+ {
+ _queryParameters.Add(string.Format("take={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(take, Client.SerializationSettings).Trim('"'))));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -1222,12 +1276,6 @@ public Model(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
- if(compositeModelCreateObject != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(compositeModelCreateObject, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1248,7 +1296,7 @@ public Model(LUISAuthoringClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1278,16 +1326,16 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
- if ((int)_statusCode == 201)
+ if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1307,8 +1355,7 @@ public Model(LUISAuthoringClient client)
}
///
- /// Gets information about all the composite entity models in a version of the
- /// application.
+ /// Adds a list entity model to a version of the application.
///
///
/// The application ID.
@@ -1316,11 +1363,8 @@ public Model(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// The number of entries to skip. Default value is 0.
- ///
- ///
- /// The number of entries to return. Maximum page size is 500. Default is 100.
+ ///
+ /// A model containing the name and words for the new list entity extractor.
///
///
/// Headers that will be added to request.
@@ -1343,7 +1387,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListCompositeEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> AddClosedListWithHttpMessagesAsync(System.Guid appId, string versionId, ClosedListModelCreateObject closedListModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -1353,17 +1397,9 @@ public Model(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (skip < 0)
- {
- throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
- }
- if (take > 500)
- {
- throw new ValidationException(ValidationRules.InclusiveMaximum, "take", 500);
- }
- if (take < 0)
+ if (closedListModelCreateObject == null)
{
- throw new ValidationException(ValidationRules.InclusiveMinimum, "take", 0);
+ throw new ValidationException(ValidationRules.CannotBeNull, "closedListModelCreateObject");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1374,34 +1410,20 @@ public Model(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("skip", skip);
- tracingParameters.Add("take", take);
+ tracingParameters.Add("closedListModelCreateObject", closedListModelCreateObject);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListCompositeEntities", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "AddClosedList", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/compositeentities";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/closedlists";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
- List _queryParameters = new List();
- if (skip != null)
- {
- _queryParameters.Add(string.Format("skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
- }
- if (take != null)
- {
- _queryParameters.Add(string.Format("take={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(take, Client.SerializationSettings).Trim('"'))));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + string.Join("&", _queryParameters);
- }
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -1420,6 +1442,12 @@ public Model(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
+ if(closedListModelCreateObject != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(closedListModelCreateObject, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1440,7 +1468,7 @@ public Model(LUISAuthoringClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 201)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1470,16 +1498,16 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse>();
+ var _result = new HttpOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
- if ((int)_statusCode == 200)
+ if ((int)_statusCode == 201)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1499,8 +1527,7 @@ public Model(LUISAuthoringClient client)
}
///
- /// Gets information about all the list entity models in a version of the
- /// application.
+ /// Adds a list of prebuilt entities to a version of the application.
///
///
/// The application ID.
@@ -1508,11 +1535,8 @@ public Model(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// The number of entries to skip. Default value is 0.
- ///
- ///
- /// The number of entries to return. Maximum page size is 500. Default is 100.
+ ///
+ /// An array of prebuilt entity extractor names.
///
///
/// Headers that will be added to request.
@@ -1535,7 +1559,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListClosedListsWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> AddPrebuiltWithHttpMessagesAsync(System.Guid appId, string versionId, IList prebuiltExtractorNames, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -1545,17 +1569,9 @@ public Model(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (skip < 0)
- {
- throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
- }
- if (take > 500)
- {
- throw new ValidationException(ValidationRules.InclusiveMaximum, "take", 500);
- }
- if (take < 0)
+ if (prebuiltExtractorNames == null)
{
- throw new ValidationException(ValidationRules.InclusiveMinimum, "take", 0);
+ throw new ValidationException(ValidationRules.CannotBeNull, "prebuiltExtractorNames");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1566,34 +1582,20 @@ public Model(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("skip", skip);
- tracingParameters.Add("take", take);
+ tracingParameters.Add("prebuiltExtractorNames", prebuiltExtractorNames);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListClosedLists", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "AddPrebuilt", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/closedlists";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/prebuilts";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
- List _queryParameters = new List();
- if (skip != null)
- {
- _queryParameters.Add(string.Format("skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
- }
- if (take != null)
- {
- _queryParameters.Add(string.Format("take={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(take, Client.SerializationSettings).Trim('"'))));
- }
- if (_queryParameters.Count > 0)
- {
- _url += "?" + string.Join("&", _queryParameters);
- }
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -1612,6 +1614,12 @@ public Model(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
+ if(prebuiltExtractorNames != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(prebuiltExtractorNames, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1632,7 +1640,7 @@ public Model(LUISAuthoringClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 201)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1662,16 +1670,16 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse>();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
- if ((int)_statusCode == 200)
+ if ((int)_statusCode == 201)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1691,7 +1699,8 @@ public Model(LUISAuthoringClient client)
}
///
- /// Adds a list entity model to a version of the application.
+ /// Gets information about all the prebuilt entities in a version of the
+ /// application.
///
///
/// The application ID.
@@ -1699,8 +1708,11 @@ public Model(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// A model containing the name and words for the new list entity extractor.
+ ///
+ /// The number of entries to skip. Default value is 0.
+ ///
+ ///
+ /// The number of entries to return. Maximum page size is 500. Default is 100.
///
///
/// Headers that will be added to request.
@@ -1723,7 +1735,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> AddClosedListWithHttpMessagesAsync(System.Guid appId, string versionId, ClosedListModelCreateObject closedListModelCreateObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListPrebuiltsWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -1733,9 +1745,17 @@ public Model(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (closedListModelCreateObject == null)
+ if (skip < 0)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "closedListModelCreateObject");
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
+ }
+ if (take > 500)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMaximum, "take", 500);
+ }
+ if (take < 0)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "take", 0);
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1746,20 +1766,34 @@ public Model(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("closedListModelCreateObject", closedListModelCreateObject);
+ tracingParameters.Add("skip", skip);
+ tracingParameters.Add("take", take);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "AddClosedList", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListPrebuilts", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/closedlists";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/prebuilts";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
+ List _queryParameters = new List();
+ if (skip != null)
+ {
+ _queryParameters.Add(string.Format("skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
+ }
+ if (take != null)
+ {
+ _queryParameters.Add(string.Format("take={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(take, Client.SerializationSettings).Trim('"'))));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -1778,12 +1812,6 @@ public Model(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
- if(closedListModelCreateObject != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(closedListModelCreateObject, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1804,7 +1832,7 @@ public Model(LUISAuthoringClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1834,16 +1862,16 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
- if ((int)_statusCode == 201)
+ if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1863,7 +1891,7 @@ public Model(LUISAuthoringClient client)
}
///
- /// Adds a list of prebuilt entities to a version of the application.
+ /// Gets all the available prebuilt entities in a version of the application.
///
///
/// The application ID.
@@ -1871,9 +1899,6 @@ public Model(LUISAuthoringClient client)
///
/// The version ID.
///
- ///
- /// An array of prebuilt entity extractor names.
- ///
///
/// Headers that will be added to request.
///
@@ -1895,7 +1920,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> AddPrebuiltWithHttpMessagesAsync(System.Guid appId, string versionId, IList prebuiltExtractorNames, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListPrebuiltEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -1905,10 +1930,6 @@ public Model(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
- if (prebuiltExtractorNames == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "prebuiltExtractorNames");
- }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1918,20 +1939,19 @@ public Model(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
- tracingParameters.Add("prebuiltExtractorNames", prebuiltExtractorNames);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "AddPrebuilt", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListPrebuiltEntities", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/prebuilts";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/listprebuilts";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
@@ -1950,12 +1970,6 @@ public Model(LUISAuthoringClient client)
// Serialize Request
string _requestContent = null;
- if(prebuiltExtractorNames != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(prebuiltExtractorNames, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1976,7 +1990,7 @@ public Model(LUISAuthoringClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -2006,16 +2020,16 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse>();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
- if ((int)_statusCode == 201)
+ if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -2035,7 +2049,7 @@ public Model(LUISAuthoringClient client)
}
///
- /// Gets information about all the prebuilt entities in a version of the
+ /// Gets information about all the intent and entity models in a version of the
/// application.
///
///
@@ -2071,7 +2085,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListPrebuiltsWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListModelsWithHttpMessagesAsync(System.Guid appId, string versionId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -2105,11 +2119,11 @@ public Model(LUISAuthoringClient client)
tracingParameters.Add("skip", skip);
tracingParameters.Add("take", take);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListPrebuilts", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListModels", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/prebuilts";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/models";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
@@ -2198,7 +2212,7 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse>();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
@@ -2207,7 +2221,7 @@ public Model(LUISAuthoringClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -2227,7 +2241,8 @@ public Model(LUISAuthoringClient client)
}
///
- /// Gets all the available prebuilt entities in a version of the application.
+ /// Gets the example utterances for the given intent or entity model in a
+ /// version of the application.
///
///
/// The application ID.
@@ -2235,6 +2250,15 @@ public Model(LUISAuthoringClient client)
///
/// The version ID.
///
+ ///
+ /// The ID (GUID) of the model.
+ ///
+ ///
+ /// The number of entries to skip. Default value is 0.
+ ///
+ ///
+ /// The number of entries to return. Maximum page size is 500. Default is 100.
+ ///
///
/// Headers that will be added to request.
///
@@ -2256,7 +2280,7 @@ public Model(LUISAuthoringClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListPrebuiltEntitiesWithHttpMessagesAsync(System.Guid appId, string versionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ExamplesMethodWithHttpMessagesAsync(System.Guid appId, string versionId, string modelId, int? skip = 0, int? take = 100, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
@@ -2266,6 +2290,22 @@ public Model(LUISAuthoringClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "versionId");
}
+ if (modelId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "modelId");
+ }
+ if (skip < 0)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "skip", 0);
+ }
+ if (take > 500)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMaximum, "take", 500);
+ }
+ if (take < 0)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "take", 0);
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2275,15 +2315,32 @@ public Model(LUISAuthoringClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("appId", appId);
tracingParameters.Add("versionId", versionId);
+ tracingParameters.Add("modelId", modelId);
+ tracingParameters.Add("skip", skip);
+ tracingParameters.Add("take", take);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListPrebuiltEntities", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ExamplesMethod", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri;
- var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/listprebuilts";
+ var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "apps/{appId}/versions/{versionId}/models/{modelId}/examples";
_url = _url.Replace("{Endpoint}", Client.Endpoint);
_url = _url.Replace("{appId}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(appId, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{versionId}", System.Uri.EscapeDataString(versionId));
+ _url = _url.Replace("{modelId}", System.Uri.EscapeDataString(modelId));
+ List _queryParameters = new List();
+ if (skip != null)
+ {
+ _queryParameters.Add(string.Format("skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"'))));
+ }
+ if (take != null)
+ {
+ _queryParameters.Add(string.Format("take={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(take, Client.SerializationSettings).Trim('"'))));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += "?" + string.Join("&", _queryParameters);
+ }
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
@@ -2356,7 +2413,7 @@ public Model(LUISAuthoringClient client)
throw ex;
}
// Create Result
- var _result = new HttpOperationResponse>();
+ var _result = new HttpOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
// Deserialize Response
@@ -2365,7 +2422,7 @@ public Model(LUISAuthoringClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject