diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/ContextDTO.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/ContextDTO.cs new file mode 100644 index 000000000000..9a2b93b636cc --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/ContextDTO.cs @@ -0,0 +1,95 @@ +// +// 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. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Context associated with Qna. + /// + public partial class ContextDTO + { + /// + /// Initializes a new instance of the ContextDTO class. + /// + public ContextDTO() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContextDTO class. + /// + /// 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 + /// List of prompts associated with the + /// answer. + public ContextDTO(bool? isContextOnly = default(bool?), IList prompts = default(IList)) + { + IsContextOnly = isContextOnly; + Prompts = prompts; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// 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 + /// + [JsonProperty(PropertyName = "isContextOnly")] + public bool? IsContextOnly { get; set; } + + /// + /// Gets or sets list of prompts associated with the answer. + /// + [JsonProperty(PropertyName = "prompts")] + public IList Prompts { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + 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(); + } + } + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/PromptDTO.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/PromptDTO.cs new file mode 100644 index 000000000000..1fcc695d9cff --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/PromptDTO.cs @@ -0,0 +1,103 @@ +// +// 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. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Prompt for an answer. + /// + public partial class PromptDTO + { + /// + /// Initializes a new instance of the PromptDTO class. + /// + public PromptDTO() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PromptDTO class. + /// + /// Index of the prompt - used in ordering + /// of the prompts + /// Qna id corresponding to the prompt - if QnaId + /// is present, QnADTO object is ignored. + /// QnADTO - Either QnaId or QnADTO needs to be + /// present in a PromptDTO object + /// Text displayed to represent a follow up + /// question prompt + 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(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets index of the prompt - used in ordering of the prompts + /// + [JsonProperty(PropertyName = "displayOrder")] + public int? DisplayOrder { get; set; } + + /// + /// Gets or sets qna id corresponding to the prompt - if QnaId is + /// present, QnADTO object is ignored. + /// + [JsonProperty(PropertyName = "qnaId")] + public int? QnaId { get; set; } + + /// + /// Gets or sets qnADTO - Either QnaId or QnADTO needs to be present in + /// a PromptDTO object + /// + [JsonProperty(PropertyName = "qna")] + public PromptDTOQna Qna { get; set; } + + /// + /// Gets or sets text displayed to represent a follow up question + /// prompt + /// + [JsonProperty(PropertyName = "displayText")] + public string DisplayText { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Qna != null) + { + Qna.Validate(); + } + if (DisplayText != null) + { + if (DisplayText.Length > 200) + { + throw new ValidationException(ValidationRules.MaxLength, "DisplayText", 200); + } + } + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/PromptDTOQna.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/PromptDTOQna.cs new file mode 100644 index 000000000000..a95fae8e1140 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/PromptDTOQna.cs @@ -0,0 +1,65 @@ +// +// 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. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// QnADTO - Either QnaId or QnADTO needs to be present in a PromptDTO + /// object + /// + public partial class PromptDTOQna : QnADTO + { + /// + /// Initializes a new instance of the PromptDTOQna class. + /// + public PromptDTOQna() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PromptDTOQna class. + /// + /// Answer text + /// List of questions associated with the + /// answer. + /// Unique id for the Q-A. + /// Source from which Q-A was indexed. eg. + /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs + /// List of metadata associated with the + /// answer. + /// Context of a QnA + public PromptDTOQna(string answer, IList questions, int? id = default(int?), string source = default(string), IList metadata = default(IList), QnADTOContext context = default(QnADTOContext)) + : base(answer, questions, id, source, metadata, context) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/QnADTO.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/QnADTO.cs index 9d894e67e57f..2c5f563a333d 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/QnADTO.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/QnADTO.cs @@ -40,13 +40,15 @@ public QnADTO() /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs /// List of metadata associated with the /// answer. - public QnADTO(string answer, IList questions, int? id = default(int?), string source = default(string), IList metadata = default(IList)) + /// Context of a QnA + public QnADTO(string answer, IList questions, int? id = default(int?), string source = default(string), IList metadata = default(IList), QnADTOContext context = default(QnADTOContext)) { Id = id; Answer = answer; Source = source; Questions = questions; Metadata = metadata; + Context = context; CustomInit(); } @@ -86,6 +88,12 @@ public QnADTO() [JsonProperty(PropertyName = "metadata")] public IList Metadata { get; set; } + /// + /// Gets or sets context of a QnA + /// + [JsonProperty(PropertyName = "context")] + public QnADTOContext Context { get; set; } + /// /// Validate the object. /// @@ -130,6 +138,10 @@ public virtual void Validate() } } } + if (Context != null) + { + Context.Validate(); + } } } } diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/QnADTOContext.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/QnADTOContext.cs new file mode 100644 index 000000000000..c663a9710a42 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/QnADTOContext.cs @@ -0,0 +1,63 @@ +// +// 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. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Context of a QnA + /// + public partial class QnADTOContext : ContextDTO + { + /// + /// Initializes a new instance of the QnADTOContext class. + /// + public QnADTOContext() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QnADTOContext class. + /// + /// 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 + /// List of prompts associated with the + /// answer. + public QnADTOContext(bool? isContextOnly = default(bool?), IList prompts = default(IList)) + : base(isContextOnly, prompts) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateContextDTO.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateContextDTO.cs new file mode 100644 index 000000000000..3e5fb14bbb47 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateContextDTO.cs @@ -0,0 +1,80 @@ +// +// 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. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Update Body schema to represent context to be updated + /// + public partial class UpdateContextDTO + { + /// + /// Initializes a new instance of the UpdateContextDTO class. + /// + public UpdateContextDTO() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateContextDTO class. + /// + /// List of prompts associated with qna + /// to be deleted + /// List of prompts to be added to the + /// qna. + /// 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 + public UpdateContextDTO(IList promptsToDelete = default(IList), IList promptsToAdd = default(IList), bool? isContextOnly = default(bool?)) + { + PromptsToDelete = promptsToDelete; + PromptsToAdd = promptsToAdd; + IsContextOnly = isContextOnly; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of prompts associated with qna to be deleted + /// + [JsonProperty(PropertyName = "promptsToDelete")] + public IList PromptsToDelete { get; set; } + + /// + /// Gets or sets list of prompts to be added to the qna. + /// + [JsonProperty(PropertyName = "promptsToAdd")] + public IList PromptsToAdd { get; set; } + + /// + /// 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 + /// + [JsonProperty(PropertyName = "isContextOnly")] + public bool? IsContextOnly { get; set; } + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateMetadataDTO.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateMetadataDTO.cs index 1241e829be1a..e6fc685aa529 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateMetadataDTO.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateMetadataDTO.cs @@ -33,7 +33,7 @@ public UpdateMetadataDTO() /// /// List of Metadata associated with answer to be /// deleted - /// List of Metadat associated with answer to be + /// List of metadata associated with answer to be /// added public UpdateMetadataDTO(IList delete = default(IList), IList add = default(IList)) { @@ -54,7 +54,7 @@ public UpdateMetadataDTO() public IList Delete { get; set; } /// - /// Gets or sets list of Metadat associated with answer to be added + /// Gets or sets list of metadata associated with answer to be added /// [JsonProperty(PropertyName = "add")] public IList Add { get; set; } diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTO.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTO.cs index cd7f8b442598..37187923fd46 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTO.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTO.cs @@ -38,13 +38,16 @@ public UpdateQnaDTO() /// answer. /// List of metadata associated with the answer /// to be updated - public UpdateQnaDTO(int? id = default(int?), string answer = default(string), string source = default(string), UpdateQnaDTOQuestions questions = default(UpdateQnaDTOQuestions), UpdateQnaDTOMetadata metadata = default(UpdateQnaDTOMetadata)) + /// Context associated with Qna to be + /// updated. + public UpdateQnaDTO(int? id = default(int?), string answer = default(string), string source = default(string), UpdateQnaDTOQuestions questions = default(UpdateQnaDTOQuestions), UpdateQnaDTOMetadata metadata = default(UpdateQnaDTOMetadata), UpdateQnaDTOContext context = default(UpdateQnaDTOContext)) { Id = id; Answer = answer; Source = source; Questions = questions; Metadata = metadata; + Context = context; CustomInit(); } @@ -85,6 +88,12 @@ public UpdateQnaDTO() [JsonProperty(PropertyName = "metadata")] public UpdateQnaDTOMetadata Metadata { get; set; } + /// + /// Gets or sets context associated with Qna to be updated. + /// + [JsonProperty(PropertyName = "context")] + public UpdateQnaDTOContext Context { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTOContext.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTOContext.cs new file mode 100644 index 000000000000..534802453788 --- /dev/null +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTOContext.cs @@ -0,0 +1,55 @@ +// +// 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. +// + +namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Context associated with Qna to be updated. + /// + public partial class UpdateQnaDTOContext : UpdateContextDTO + { + /// + /// Initializes a new instance of the UpdateQnaDTOContext class. + /// + public UpdateQnaDTOContext() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateQnaDTOContext class. + /// + /// List of prompts associated with qna + /// to be deleted + /// List of prompts to be added to the + /// qna. + /// 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 + public UpdateQnaDTOContext(IList promptsToDelete = default(IList), IList promptsToAdd = default(IList), bool? isContextOnly = default(bool?)) + : base(promptsToDelete, promptsToAdd, isContextOnly) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTOMetadata.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTOMetadata.cs index a859b3791ef3..3a5f6edaf25f 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTOMetadata.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/Models/UpdateQnaDTOMetadata.cs @@ -32,7 +32,7 @@ public UpdateQnaDTOMetadata() /// /// List of Metadata associated with answer to be /// deleted - /// List of Metadat associated with answer to be + /// List of metadata associated with answer to be /// added public UpdateQnaDTOMetadata(IList delete = default(IList), IList add = default(IList)) : base(delete, add) diff --git a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/SdkInfo_QnAMakerClient.cs b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/SdkInfo_QnAMakerClient.cs index f0bf0a66fd6c..1d8e60bfe189 100644 --- a/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/SdkInfo_QnAMakerClient.cs +++ b/src/SDKs/CognitiveServices/dataPlane/Knowledge/QnAMaker/QnAMaker/Generated/SdkInfo_QnAMakerClient.cs @@ -26,16 +26,5 @@ public static IEnumerable> ApiInfo_QnAMakerClient }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/data-plane/QnAMaker/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\dev\\sdk\\sdkb\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "5bda5206ea6a22eb087812f653dfc22f79b78195"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -