-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AutoPr-QnAMaker-bingisbestest-REST Spec PrNumber 5738 (#5909)
* .NET SDK Resource Provider:'QnAMaker' REST Spec PR 'Azure/azure-rest-api-specs#5738' REST Spec PR Author 'bingisbestest' REST Spec PR Last commit * .NET SDK Resource Provider:'QnAMaker' REST Spec PR 'Azure/azure-rest-api-specs#5738' REST Spec PR Author 'bingisbestest' REST Spec PR Last commit
- Loading branch information
Showing
11 changed files
with
487 additions
and
16 deletions.
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
...Ks/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/ContextDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// <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.Knowledge.QnAMaker.Models | ||
{ | ||
using Microsoft.Rest; | ||
using Newtonsoft.Json; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
/// <summary> | ||
/// Context associated with Qna. | ||
/// </summary> | ||
public partial class ContextDTO | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the ContextDTO class. | ||
/// </summary> | ||
public ContextDTO() | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the ContextDTO class. | ||
/// </summary> | ||
/// <param name="isContextOnly">To mark if a prompt is relevant only | ||
/// with a previous question or not. | ||
/// true - Do not include this QnA as search result for queries without | ||
/// context | ||
/// false - ignores context and includes this QnA in search | ||
/// result</param> | ||
/// <param name="prompts">List of prompts associated with the | ||
/// answer.</param> | ||
public ContextDTO(bool? isContextOnly = default(bool?), IList<PromptDTO> prompts = default(IList<PromptDTO>)) | ||
{ | ||
IsContextOnly = isContextOnly; | ||
Prompts = prompts; | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// An initialization method that performs custom operations like setting defaults | ||
/// </summary> | ||
partial void CustomInit(); | ||
|
||
/// <summary> | ||
/// Gets or sets to mark if a prompt is relevant only with a previous | ||
/// question or not. | ||
/// true - Do not include this QnA as search result for queries without | ||
/// context | ||
/// false - ignores context and includes this QnA in search result | ||
/// </summary> | ||
[JsonProperty(PropertyName = "isContextOnly")] | ||
public bool? IsContextOnly { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets list of prompts associated with the answer. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "prompts")] | ||
public IList<PromptDTO> Prompts { get; set; } | ||
|
||
/// <summary> | ||
/// Validate the object. | ||
/// </summary> | ||
/// <exception cref="ValidationException"> | ||
/// Thrown if validation fails | ||
/// </exception> | ||
public virtual void Validate() | ||
{ | ||
if (Prompts != null) | ||
{ | ||
if (Prompts.Count > 20) | ||
{ | ||
throw new ValidationException(ValidationRules.MaxItems, "Prompts", 20); | ||
} | ||
foreach (var element in Prompts) | ||
{ | ||
if (element != null) | ||
{ | ||
element.Validate(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
103 changes: 103 additions & 0 deletions
103
...DKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/PromptDTO.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// <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.Knowledge.QnAMaker.Models | ||
{ | ||
using Microsoft.Rest; | ||
using Newtonsoft.Json; | ||
using System.Linq; | ||
|
||
/// <summary> | ||
/// Prompt for an answer. | ||
/// </summary> | ||
public partial class PromptDTO | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the PromptDTO class. | ||
/// </summary> | ||
public PromptDTO() | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the PromptDTO class. | ||
/// </summary> | ||
/// <param name="displayOrder">Index of the prompt - used in ordering | ||
/// of the prompts</param> | ||
/// <param name="qnaId">Qna id corresponding to the prompt - if QnaId | ||
/// is present, QnADTO object is ignored.</param> | ||
/// <param name="qna">QnADTO - Either QnaId or QnADTO needs to be | ||
/// present in a PromptDTO object</param> | ||
/// <param name="displayText">Text displayed to represent a follow up | ||
/// question prompt</param> | ||
public PromptDTO(int? displayOrder = default(int?), int? qnaId = default(int?), PromptDTOQna qna = default(PromptDTOQna), string displayText = default(string)) | ||
{ | ||
DisplayOrder = displayOrder; | ||
QnaId = qnaId; | ||
Qna = qna; | ||
DisplayText = displayText; | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// An initialization method that performs custom operations like setting defaults | ||
/// </summary> | ||
partial void CustomInit(); | ||
|
||
/// <summary> | ||
/// Gets or sets index of the prompt - used in ordering of the prompts | ||
/// </summary> | ||
[JsonProperty(PropertyName = "displayOrder")] | ||
public int? DisplayOrder { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets qna id corresponding to the prompt - if QnaId is | ||
/// present, QnADTO object is ignored. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "qnaId")] | ||
public int? QnaId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets qnADTO - Either QnaId or QnADTO needs to be present in | ||
/// a PromptDTO object | ||
/// </summary> | ||
[JsonProperty(PropertyName = "qna")] | ||
public PromptDTOQna Qna { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets text displayed to represent a follow up question | ||
/// prompt | ||
/// </summary> | ||
[JsonProperty(PropertyName = "displayText")] | ||
public string DisplayText { get; set; } | ||
|
||
/// <summary> | ||
/// Validate the object. | ||
/// </summary> | ||
/// <exception cref="ValidationException"> | ||
/// Thrown if validation fails | ||
/// </exception> | ||
public virtual void Validate() | ||
{ | ||
if (Qna != null) | ||
{ | ||
Qna.Validate(); | ||
} | ||
if (DisplayText != null) | ||
{ | ||
if (DisplayText.Length > 200) | ||
{ | ||
throw new ValidationException(ValidationRules.MaxLength, "DisplayText", 200); | ||
} | ||
} | ||
} | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
.../CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/PromptDTOQna.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// <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.Knowledge.QnAMaker.Models | ||
{ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
/// <summary> | ||
/// QnADTO - Either QnaId or QnADTO needs to be present in a PromptDTO | ||
/// object | ||
/// </summary> | ||
public partial class PromptDTOQna : QnADTO | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the PromptDTOQna class. | ||
/// </summary> | ||
public PromptDTOQna() | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the PromptDTOQna class. | ||
/// </summary> | ||
/// <param name="answer">Answer text</param> | ||
/// <param name="questions">List of questions associated with the | ||
/// answer.</param> | ||
/// <param name="id">Unique id for the Q-A.</param> | ||
/// <param name="source">Source from which Q-A was indexed. eg. | ||
/// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs</param> | ||
/// <param name="metadata">List of metadata associated with the | ||
/// answer.</param> | ||
/// <param name="context">Context of a QnA</param> | ||
public PromptDTOQna(string answer, IList<string> questions, int? id = default(int?), string source = default(string), IList<MetadataDTO> metadata = default(IList<MetadataDTO>), QnADTOContext context = default(QnADTOContext)) | ||
: base(answer, questions, id, source, metadata, context) | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// An initialization method that performs custom operations like setting defaults | ||
/// </summary> | ||
partial void CustomInit(); | ||
|
||
/// <summary> | ||
/// Validate the object. | ||
/// </summary> | ||
/// <exception cref="Rest.ValidationException"> | ||
/// Thrown if validation fails | ||
/// </exception> | ||
public override void Validate() | ||
{ | ||
base.Validate(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/QnADTOContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// <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.Knowledge.QnAMaker.Models | ||
{ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
/// <summary> | ||
/// Context of a QnA | ||
/// </summary> | ||
public partial class QnADTOContext : ContextDTO | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the QnADTOContext class. | ||
/// </summary> | ||
public QnADTOContext() | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the QnADTOContext class. | ||
/// </summary> | ||
/// <param name="isContextOnly">To mark if a prompt is relevant only | ||
/// with a previous question or not. | ||
/// true - Do not include this QnA as search result for queries without | ||
/// context | ||
/// false - ignores context and includes this QnA in search | ||
/// result</param> | ||
/// <param name="prompts">List of prompts associated with the | ||
/// answer.</param> | ||
public QnADTOContext(bool? isContextOnly = default(bool?), IList<PromptDTO> prompts = default(IList<PromptDTO>)) | ||
: base(isContextOnly, prompts) | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// An initialization method that performs custom operations like setting defaults | ||
/// </summary> | ||
partial void CustomInit(); | ||
|
||
/// <summary> | ||
/// Validate the object. | ||
/// </summary> | ||
/// <exception cref="Rest.ValidationException"> | ||
/// Thrown if validation fails | ||
/// </exception> | ||
public override void Validate() | ||
{ | ||
base.Validate(); | ||
} | ||
} | ||
} |
Oops, something went wrong.