Skip to content

Commit

Permalink
.NET SDK Resource Provider:'Runtime'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5793'
REST Spec PR Author 'moabba'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed Apr 29, 2019
1 parent 2778d5d commit 41a5301
Show file tree
Hide file tree
Showing 25 changed files with 1,371 additions and 963 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public partial interface ILUISRuntimeClient : System.IDisposable


/// <summary>
/// Gets the IPrediction.
/// Gets the IPredictionOperations.
/// </summary>
IPrediction Prediction { get; }
IPredictionOperations Prediction { get; }

}
}

This file was deleted.

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

namespace Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime
{
using Microsoft.Rest;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// PredictionOperations operations.
/// </summary>
public partial interface IPredictionOperations
{
/// <summary>
/// Gets the predictions for an application version.
/// </summary>
/// <param name='appId'>
/// The application ID.
/// </param>
/// <param name='versionId'>
/// The application version ID.
/// </param>
/// <param name='predictionRequest'>
/// The prediction request parameters.
/// </param>
/// <param name='verbose'>
/// Indicates whether to get extra metadata for the entities
/// predictions or not.
/// </param>
/// <param name='showAllIntents'>
/// Indicates whether to return all the intents in the response or just
/// the top intent.
/// </param>
/// <param name='log'>
/// Indicates whether to log the endpoint query or not.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse<PredictionResponse>> GetVersionPredictionWithHttpMessagesAsync(System.Guid appId, string versionId, PredictionRequest predictionRequest, bool? verbose = default(bool?), bool? showAllIntents = default(bool?), bool? log = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the predictions for an application slot.
/// </summary>
/// <param name='appId'>
/// The application ID.
/// </param>
/// <param name='slotName'>
/// The application slot name.
/// </param>
/// <param name='predictionRequest'>
/// The prediction request parameters.
/// </param>
/// <param name='verbose'>
/// Indicates whether to get extra metadata for the entities
/// predictions or not.
/// </param>
/// <param name='showAllIntents'>
/// Indicates whether to return all the intents in the response or just
/// the top intent.
/// </param>
/// <param name='log'>
/// Indicates whether to log the endpoint query or not.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<HttpOperationResponse<PredictionResponse>> GetSlotPredictionWithHttpMessagesAsync(System.Guid appId, string slotName, PredictionRequest predictionRequest, bool? verbose = default(bool?), bool? showAllIntents = default(bool?), bool? log = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public partial class LUISRuntimeClient : ServiceClient<LUISRuntimeClient>, ILUIS
public ServiceClientCredentials Credentials { get; private set; }

/// <summary>
/// Gets the IPrediction.
/// Gets the IPredictionOperations.
/// </summary>
public virtual IPrediction Prediction { get; private set; }
public virtual IPredictionOperations Prediction { get; private set; }

/// <summary>
/// Initializes a new instance of the LUISRuntimeClient class.
Expand Down Expand Up @@ -179,8 +179,8 @@ public LUISRuntimeClient(ServiceClientCredentials credentials, HttpClientHandler
/// </summary>
private void Initialize()
{
Prediction = new Prediction(this);
BaseUri = "{Endpoint}/luis/v2.0";
Prediction = new PredictionOperations(this);
BaseUri = "{Endpoint}/luis/v3.0-preview";
SerializationSettings = new JsonSerializerSettings
{
Formatting = Newtonsoft.Json.Formatting.Indented,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,29 @@ namespace Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models
using System.Linq;

/// <summary>
/// LUIS Composite Entity.
/// Defines an extension for a list entity.
/// </summary>
public partial class CompositeEntityModel
public partial class DynamicList
{
/// <summary>
/// Initializes a new instance of the CompositeEntityModel class.
/// Initializes a new instance of the DynamicList class.
/// </summary>
public CompositeEntityModel()
public DynamicList()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the CompositeEntityModel class.
/// Initializes a new instance of the DynamicList class.
/// </summary>
/// <param name="parentType">Type/name of parent entity.</param>
/// <param name="value">Value for composite entity extracted by
/// LUIS.</param>
/// <param name="children">Child entities.</param>
public CompositeEntityModel(string parentType, string value, IList<CompositeChildModel> children)
/// <param name="listEntityName">The name of the list entity to
/// extend.</param>
/// <param name="requestLists">The lists to append on the extended list
/// entity.</param>
public DynamicList(string listEntityName, IList<RequestList> requestLists)
{
ParentType = parentType;
Value = value;
Children = children;
ListEntityName = listEntityName;
RequestLists = requestLists;
CustomInit();
}

Expand All @@ -50,22 +49,16 @@ public CompositeEntityModel(string parentType, string value, IList<CompositeChil
partial void CustomInit();

/// <summary>
/// Gets or sets type/name of parent entity.
/// Gets or sets the name of the list entity to extend.
/// </summary>
[JsonProperty(PropertyName = "parentType")]
public string ParentType { get; set; }
[JsonProperty(PropertyName = "listEntityName")]
public string ListEntityName { get; set; }

/// <summary>
/// Gets or sets value for composite entity extracted by LUIS.
/// Gets or sets the lists to append on the extended list entity.
/// </summary>
[JsonProperty(PropertyName = "value")]
public string Value { get; set; }

/// <summary>
/// Gets or sets child entities.
/// </summary>
[JsonProperty(PropertyName = "children")]
public IList<CompositeChildModel> Children { get; set; }
[JsonProperty(PropertyName = "requestLists")]
public IList<RequestList> RequestLists { get; set; }

/// <summary>
/// Validate the object.
Expand All @@ -75,21 +68,17 @@ public CompositeEntityModel(string parentType, string value, IList<CompositeChil
/// </exception>
public virtual void Validate()
{
if (ParentType == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "ParentType");
}
if (Value == null)
if (ListEntityName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Value");
throw new ValidationException(ValidationRules.CannotBeNull, "ListEntityName");
}
if (Children == null)
if (RequestLists == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Children");
throw new ValidationException(ValidationRules.CannotBeNull, "RequestLists");
}
if (Children != null)
if (RequestLists != null)
{
foreach (var element in Children)
foreach (var element in RequestLists)
{
if (element != null)
{
Expand Down
Loading

0 comments on commit 41a5301

Please sign in to comment.