зеркало из
1
0
Форкнуть 0
* Config changes for Qnamaker

* Add Skeleton structure for Qnamaker

* Regen all SDKs & Profiles

* Minor fix

* Changed date
This commit is contained in:
Sarangan Rajamanickam 2018-12-05 10:08:05 -08:00 коммит произвёл GitHub
Родитель 7d9465a17c
Коммит 85e9b1a75e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
62 изменённых файлов: 4311 добавлений и 10 удалений

Просмотреть файл

@ -1,3 +1,8 @@
## 2018.12.05 - Azure Ruby SDK Release
* Released the following SDKs
- azure_cognitiveservices_qnamaker - v0.17.0
- azure_sdk - v0.19.3
## 2018.11.27 - Azure Ruby SDK Release
* Released the following SDKs
- azure_mgmt_sqlvirtualmachine - v0.17.0

Просмотреть файл

@ -85,6 +85,7 @@ gem 'azure_cognitiveservices_entitysearch', path: 'data/azure_cognitiveservi
gem 'azure_cognitiveservices_face', path: 'data/azure_cognitiveservices_face'
gem 'azure_cognitiveservices_imagesearch', path: 'data/azure_cognitiveservices_imagesearch'
gem 'azure_cognitiveservices_newssearch', path: 'data/azure_cognitiveservices_newssearch'
gem 'azure_cognitiveservices_qnamaker', path: 'data/azure_cognitiveservices_qnamaker'
gem 'azure_cognitiveservices_spellcheck', path: 'data/azure_cognitiveservices_spellcheck'
gem 'azure_cognitiveservices_textanalytics', path: 'data/azure_cognitiveservices_textanalytics'
gem 'azure_cognitiveservices_videosearch', path: 'data/azure_cognitiveservices_videosearch'

Просмотреть файл

@ -3,5 +3,5 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
module Azure
VERSION = '0.19.2'
VERSION = '0.19.3'
end

Просмотреть файл

@ -75,6 +75,7 @@ require 'latest/modules/entitysearch_profile_module'
require 'latest/modules/face_profile_module'
require 'latest/modules/imagesearch_profile_module'
require 'latest/modules/newssearch_profile_module'
require 'latest/modules/qnamaker_profile_module'
require 'latest/modules/spellcheck_profile_module'
require 'latest/modules/textanalytics_profile_module'
require 'latest/modules/videosearch_profile_module'
@ -88,7 +89,7 @@ module Azure::Profiles::Latest
class Client
include MsRestAzure::Common::Configurable
attr_reader :analysis_services, :api_management, :authorization, :automation, :batch, :billing, :cdn, :cognitive_services, :commerce, :compute, :consumption, :container_instance, :container_registry, :container_service, :customer_insights, :data_lake_analytics, :data_lake_store, :data_migration, :dev_spaces, :dev_test_labs, :dns, :event_grid, :event_hub, :features, :graph_rbac, :iot_central, :iot_hub, :key_vault, :kusto, :links, :locks, :logic, :machine_learning, :managed_applications, :marketplace_ordering, :media_services, :monitor, :managed_service_identity, :network, :notification_hubs, :operational_insights, :policy, :policy_insights, :power_bi_embedded, :recovery_services, :recovery_services_backup, :recovery_services_site_recovery, :redis, :relay, :resources, :resources_management, :scheduler, :search, :security, :service_bus, :service_fabric, :signalr, :sql, :sqlvirtualmachine, :stor_simple8000_series, :storage, :stream_analytics, :subscriptions, :traffic_manager, :web, :computer_vision, :content_moderator, :custom_search, :entity_search, :face, :image_search, :news_search, :spell_check, :text_analytics, :video_search, :web_search, :visual_search
attr_reader :analysis_services, :api_management, :authorization, :automation, :batch, :billing, :cdn, :cognitive_services, :commerce, :compute, :consumption, :container_instance, :container_registry, :container_service, :customer_insights, :data_lake_analytics, :data_lake_store, :data_migration, :dev_spaces, :dev_test_labs, :dns, :event_grid, :event_hub, :features, :graph_rbac, :iot_central, :iot_hub, :key_vault, :kusto, :links, :locks, :logic, :machine_learning, :managed_applications, :marketplace_ordering, :media_services, :monitor, :managed_service_identity, :network, :notification_hubs, :operational_insights, :policy, :policy_insights, :power_bi_embedded, :recovery_services, :recovery_services_backup, :recovery_services_site_recovery, :redis, :relay, :resources, :resources_management, :scheduler, :search, :security, :service_bus, :service_fabric, :signalr, :sql, :sqlvirtualmachine, :stor_simple8000_series, :storage, :stream_analytics, :subscriptions, :traffic_manager, :web, :computer_vision, :content_moderator, :custom_search, :entity_search, :face, :image_search, :news_search, :qnamaker, :spell_check, :text_analytics, :video_search, :web_search, :visual_search
#
# Initializes a new instance of the Client class.
@ -192,6 +193,7 @@ module Azure::Profiles::Latest
@face = FaceAdapter.new(self, base_url, sdk_options)
@image_search = ImageSearchAdapter.new(self, base_url, sdk_options)
@news_search = NewsSearchAdapter.new(self, base_url, sdk_options)
@qnamaker = QnamakerAdapter.new(self, base_url, sdk_options)
@spell_check = SpellCheckAdapter.new(self, base_url, sdk_options)
@text_analytics = TextAnalyticsAdapter.new(self, base_url, sdk_options)
@video_search = VideoSearchAdapter.new(self, base_url, sdk_options)
@ -769,6 +771,13 @@ module Azure::Profiles::Latest
end
end
class QnamakerAdapter < Azure::Profiles::Latest::Qnamaker::QnamakerDataClass
def initialize(context, base_url, options)
super(context)
end
end
class SpellCheckAdapter < Azure::Profiles::Latest::SpellCheck::SpellCheckDataClass
def initialize(context, base_url, options)

Просмотреть файл

@ -0,0 +1,181 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'azure_cognitiveservices_qnamaker'
module Azure::Profiles::Latest
module Qnamaker
EndpointKeys = Azure::CognitiveServices::Qnamaker::V4_0::EndpointKeys
Alterations = Azure::CognitiveServices::Qnamaker::V4_0::Alterations
Knowledgebase = Azure::CognitiveServices::Qnamaker::V4_0::Knowledgebase
Operations = Azure::CognitiveServices::Qnamaker::V4_0::Operations
module Models
CreateKbInputDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbInputDTO
DeleteKbContentsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::DeleteKbContentsDTO
QnADTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADTO
EndpointKeysDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::EndpointKeysDTO
FileDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::FileDTO
WordAlterationsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::WordAlterationsDTO
KnowledgebasesDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebasesDTO
UpdateQnaDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTO
QnADocumentsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADocumentsDTO
UpdateQuestionsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQuestionsDTO
CreateKbDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbDTO
UpdateMetadataDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateMetadataDTO
ReplaceKbDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::ReplaceKbDTO
UpdateKbOperationDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTO
KnowledgebaseDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseDTO
UpdateKbContentsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbContentsDTO
ErrorResponse = Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponse
InnerErrorModel = Azure::CognitiveServices::Qnamaker::V4_0::Models::InnerErrorModel
MetadataDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::MetadataDTO
Error = Azure::CognitiveServices::Qnamaker::V4_0::Models::Error
AlterationsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::AlterationsDTO
Operation = Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation
UpdateKbOperationDTOAdd = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOAdd
UpdateKbOperationDTODelete = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTODelete
UpdateKbOperationDTOUpdate = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOUpdate
UpdateQnaDTOQuestions = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOQuestions
UpdateQnaDTOMetadata = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOMetadata
ErrorResponseError = Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponseError
KnowledgebaseEnvironmentType = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseEnvironmentType
ErrorCodeType = Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorCodeType
OperationStateType = Azure::CognitiveServices::Qnamaker::V4_0::Models::OperationStateType
EnvironmentType = Azure::CognitiveServices::Qnamaker::V4_0::Models::EnvironmentType
end
class QnamakerDataClass
attr_reader :endpoint_keys, :alterations, :knowledgebase, :operations, :configurable, :base_url, :options, :model_classes
def initialize(configurable, base_url=nil, options=nil)
@configurable, @base_url, @options = configurable, base_url, options
@client_0 = Azure::CognitiveServices::Qnamaker::V4_0::QnamakerClient.new(configurable.credentials, options)
if(@client_0.respond_to?(:subscription_id))
@client_0.subscription_id = configurable.subscription_id
end
add_telemetry(@client_0)
@endpoint_keys = @client_0.endpoint_keys
@alterations = @client_0.alterations
@knowledgebase = @client_0.knowledgebase
@operations = @client_0.operations
@model_classes = ModelClasses.new
end
def add_telemetry(client)
profile_information = "Profiles/azure_sdk/#{Azure::VERSION}/Latest/Qnamaker"
client.add_user_agent_information(profile_information)
end
def method_missing(method, *args)
if @client_0.respond_to?method
@client_0.send(method, *args)
else
super
end
end
class ModelClasses
def create_kb_input_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbInputDTO
end
def delete_kb_contents_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::DeleteKbContentsDTO
end
def qn_adto
Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADTO
end
def endpoint_keys_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::EndpointKeysDTO
end
def file_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::FileDTO
end
def word_alterations_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::WordAlterationsDTO
end
def knowledgebases_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebasesDTO
end
def update_qna_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTO
end
def qn_adocuments_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADocumentsDTO
end
def update_questions_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQuestionsDTO
end
def create_kb_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbDTO
end
def update_metadata_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateMetadataDTO
end
def replace_kb_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::ReplaceKbDTO
end
def update_kb_operation_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTO
end
def knowledgebase_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseDTO
end
def update_kb_contents_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbContentsDTO
end
def error_response
Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponse
end
def inner_error_model
Azure::CognitiveServices::Qnamaker::V4_0::Models::InnerErrorModel
end
def metadata_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::MetadataDTO
end
def error
Azure::CognitiveServices::Qnamaker::V4_0::Models::Error
end
def alterations_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::AlterationsDTO
end
def operation
Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation
end
def update_kb_operation_dtoadd
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOAdd
end
def update_kb_operation_dtodelete
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTODelete
end
def update_kb_operation_dtoupdate
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOUpdate
end
def update_qna_dtoquestions
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOQuestions
end
def update_qna_dtometadata
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOMetadata
end
def error_response_error
Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponseError
end
def knowledgebase_environment_type
Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseEnvironmentType
end
def error_code_type
Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorCodeType
end
def operation_state_type
Azure::CognitiveServices::Qnamaker::V4_0::Models::OperationStateType
end
def environment_type
Azure::CognitiveServices::Qnamaker::V4_0::Models::EnvironmentType
end
end
end
end
end

Просмотреть файл

@ -1,10 +1,6 @@
{
"management": [
"azure_mgmt_sqlvirtualmachine",
"azure_mgmt_kusto",
"azure_mgmt_storage",
"azure_mgmt_container_instance",
"azure_mgmt_network"
"data": [
"azure_cognitiveservices_qnamaker"
],
"rollup": [
"azure_sdk"

Просмотреть файл

@ -1,7 +1,7 @@
{
"rollup": {
"azure_sdk": "0.19.2"
"azure_sdk": "0.19.3"
},
"data": {
"azure_cognitiveservices_computervision": "0.17.0",
@ -11,6 +11,7 @@
"azure_cognitiveservices_face": "0.17.0",
"azure_cognitiveservices_imagesearch": "0.17.0",
"azure_cognitiveservices_newssearch": "0.17.0",
"azure_cognitiveservices_qnamaker": "0.17.0",
"azure_cognitiveservices_spellcheck": "0.17.0",
"azure_cognitiveservices_textanalytics": "0.17.1",
"azure_cognitiveservices_videosearch": "0.17.0",

Просмотреть файл

@ -1538,6 +1538,14 @@
"tag": "release_1_0"
}
},
"azure_cognitiveservices_qnamaker":{
"azure_cognitiveservices_qnamaker_v4.0":{
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/1a66a41ea1bde833fa94bb38bb8c87a7c1ce2142/specification/cognitiveservices/data-plane/QnAMaker/readme.md",
"namespace": "Azure::CognitiveServices::Qnamaker::V4_0",
"title": "QnamakerClient",
"tag": "release_4_0"
}
},
"azure_cognitiveservices_spellcheck":{
"azure_cognitiveservices_spellcheck_v1.0": {
"markdown": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0840eaa81abaf0a42c88d8e2705dff1c89c4f149/specification/cognitiveservices/data-plane/SpellCheck/readme.md",

Просмотреть файл

@ -534,6 +534,13 @@
"module_require": "azure_cognitiveservices_newssearch"
}
},
"Microsoft.CognitiveServices.Qnamaker":{
"data": {
"path": "data/azure_cognitiveservices_qnamaker",
"namespace": "Azure::CognitiveServices::Qnamaker",
"module_require": "azure_cognitiveservices_qnamaker"
}
},
"Microsoft.CognitiveServices.SpellCheck": {
"data": {
"path": "data/azure_cognitiveservices_spellcheck",

Просмотреть файл

@ -531,6 +531,11 @@
"1.0": ["*"]
}
},
"Microsoft.CognitiveServices.Qnamaker": {
"data": {
"4.0": ["*"]
}
},
"Microsoft.CognitiveServices.SpellCheck": {
"data": {
"1.0": ["*"]
@ -1873,6 +1878,20 @@
"individual_gem_profile": true
}
],
"azure_cognitiveservices_qnamaker": [
{
"name": "Latest",
"resourceTypes": {
"Microsoft.CognitiveServices.Qnamaker": {
"data": {
"4.0": ["*"]
}
}
},
"output_dir": "data/azure_cognitiveservices_qnamaker/lib/profiles",
"individual_gem_profile": true
}
],
"azure_cognitiveservices_spellcheck": [
{
"name": "Latest",

Просмотреть файл

@ -0,0 +1,3 @@
--require spec_helper
--color
--format documentation

Просмотреть файл

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Просмотреть файл

@ -0,0 +1,5 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require "bundler/gem_tasks"

Просмотреть файл

@ -0,0 +1,42 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require '../azure_cognitiveservices_qnamaker/lib/module_definition'
require '../azure_cognitiveservices_qnamaker/lib/version'
Gem::Specification.new do |spec|
spec.name = 'azure_cognitiveservices_qnamaker'
spec.version = Azure::CognitiveServices::Qnamaker::VERSION
spec.authors = 'Microsoft Corporation'
spec.email = 'azrubyteam@microsoft.com'
spec.description = 'Microsoft Azure Cognitive Services QnAMaker Client Library for Ruby'
spec.summary = 'Official Ruby client library to consume Microsoft Azure Cognitive Services QnAMaker.'
spec.homepage = 'https://aka.ms/azure-sdk-for-ruby'
spec.license = 'MIT'
spec.metadata = {
'bug_tracker_uri' => 'https://github.com/Azure/azure-sdk-for-ruby/issues',
'changelog_uri' => 'https://github.com/Azure/azure-sdk-for-ruby/blob/master/ChangeLog.md',
'documentation_uri' => 'https://azure.microsoft.com/en-us/develop/ruby/',
'homepage_uri' => 'https://aka.ms/azure-sdk-for-ruby',
'source_code_uri' => 'https://github.com/Azure/azure-sdk-for-ruby/tree/master/data/azure_cognitiveservices_qnamaker'
}
spec.files = Dir["LICENSE.txt", "lib/**/*"]
spec.files.reject! { |fn| fn.include? "build.json" }
spec.bindir = 'bin'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 2.0.0'
spec.add_development_dependency 'bundler', '~> 1.9'
spec.add_development_dependency 'rake', '~> 10'
spec.add_development_dependency 'rspec', '~> 3'
spec.add_development_dependency 'dotenv', '~> 2'
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.11.0'
end

Просмотреть файл

@ -0,0 +1,63 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
require 'uri'
require 'cgi'
require 'date'
require 'json'
require 'base64'
require 'erb'
require 'securerandom'
require 'time'
require 'timeliness'
require 'faraday'
require 'faraday-cookie_jar'
require 'concurrent'
require 'ms_rest'
require '4.0/generated/azure_cognitiveservices_qnamaker/module_definition'
require 'ms_rest_azure'
module Azure::CognitiveServices::Qnamaker::V4_0
autoload :EndpointKeys, '4.0/generated/azure_cognitiveservices_qnamaker/endpoint_keys.rb'
autoload :Alterations, '4.0/generated/azure_cognitiveservices_qnamaker/alterations.rb'
autoload :Knowledgebase, '4.0/generated/azure_cognitiveservices_qnamaker/knowledgebase.rb'
autoload :Operations, '4.0/generated/azure_cognitiveservices_qnamaker/operations.rb'
autoload :QnamakerClient, '4.0/generated/azure_cognitiveservices_qnamaker/qnamaker_client.rb'
module Models
autoload :CreateKbInputDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/create_kb_input_dto.rb'
autoload :DeleteKbContentsDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/delete_kb_contents_dto.rb'
autoload :QnADTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/qn_adto.rb'
autoload :EndpointKeysDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/endpoint_keys_dto.rb'
autoload :FileDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/file_dto.rb'
autoload :WordAlterationsDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/word_alterations_dto.rb'
autoload :KnowledgebasesDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/knowledgebases_dto.rb'
autoload :UpdateQnaDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_qna_dto.rb'
autoload :QnADocumentsDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/qn_adocuments_dto.rb'
autoload :UpdateQuestionsDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_questions_dto.rb'
autoload :CreateKbDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/create_kb_dto.rb'
autoload :UpdateMetadataDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_metadata_dto.rb'
autoload :ReplaceKbDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/replace_kb_dto.rb'
autoload :UpdateKbOperationDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_operation_dto.rb'
autoload :KnowledgebaseDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/knowledgebase_dto.rb'
autoload :UpdateKbContentsDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_contents_dto.rb'
autoload :ErrorResponse, '4.0/generated/azure_cognitiveservices_qnamaker/models/error_response.rb'
autoload :InnerErrorModel, '4.0/generated/azure_cognitiveservices_qnamaker/models/inner_error_model.rb'
autoload :MetadataDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/metadata_dto.rb'
autoload :Error, '4.0/generated/azure_cognitiveservices_qnamaker/models/error.rb'
autoload :AlterationsDTO, '4.0/generated/azure_cognitiveservices_qnamaker/models/alterations_dto.rb'
autoload :Operation, '4.0/generated/azure_cognitiveservices_qnamaker/models/operation.rb'
autoload :UpdateKbOperationDTOAdd, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_operation_dtoadd.rb'
autoload :UpdateKbOperationDTODelete, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_operation_dtodelete.rb'
autoload :UpdateKbOperationDTOUpdate, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_operation_dtoupdate.rb'
autoload :UpdateQnaDTOQuestions, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_qna_dtoquestions.rb'
autoload :UpdateQnaDTOMetadata, '4.0/generated/azure_cognitiveservices_qnamaker/models/update_qna_dtometadata.rb'
autoload :ErrorResponseError, '4.0/generated/azure_cognitiveservices_qnamaker/models/error_response_error.rb'
autoload :KnowledgebaseEnvironmentType, '4.0/generated/azure_cognitiveservices_qnamaker/models/knowledgebase_environment_type.rb'
autoload :ErrorCodeType, '4.0/generated/azure_cognitiveservices_qnamaker/models/error_code_type.rb'
autoload :OperationStateType, '4.0/generated/azure_cognitiveservices_qnamaker/models/operation_state_type.rb'
autoload :EnvironmentType, '4.0/generated/azure_cognitiveservices_qnamaker/models/environment_type.rb'
end
end

Просмотреть файл

@ -0,0 +1,189 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
#
# An API for QnAMaker Service
#
class Alterations
include MsRestAzure
#
# Creates and initializes a new instance of the Alterations class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [QnamakerClient] reference to the QnamakerClient
attr_reader :client
#
# Download alterations from runtime.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [WordAlterationsDTO] operation results.
#
def get(custom_headers:nil)
response = get_async(custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Download alterations from runtime.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def get_with_http_info(custom_headers:nil)
get_async(custom_headers:custom_headers).value!
end
#
# Download alterations from runtime.
#
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def get_async(custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'alterations'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::WordAlterationsDTO.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Replace alterations data.
#
# @param word_alterations [WordAlterationsDTO] New alterations data.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def replace(word_alterations, custom_headers:nil)
response = replace_async(word_alterations, custom_headers:custom_headers).value!
nil
end
#
# Replace alterations data.
#
# @param word_alterations [WordAlterationsDTO] New alterations data.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def replace_with_http_info(word_alterations, custom_headers:nil)
replace_async(word_alterations, custom_headers:custom_headers).value!
end
#
# Replace alterations data.
#
# @param word_alterations [WordAlterationsDTO] New alterations data.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def replace_async(word_alterations, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'word_alterations is nil' if word_alterations.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
# Serialize Request
request_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::WordAlterationsDTO.mapper()
request_content = @client.serialize(request_mapper, word_alterations)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'alterations'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:put, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 204
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result
end
promise.execute
end
end
end

Просмотреть файл

@ -0,0 +1,194 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
#
# An API for QnAMaker Service
#
class EndpointKeys
include MsRestAzure
#
# Creates and initializes a new instance of the EndpointKeys class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [QnamakerClient] reference to the QnamakerClient
attr_reader :client
#
# Gets endpoint keys for an endpoint
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [EndpointKeysDTO] operation results.
#
def get_keys(custom_headers:nil)
response = get_keys_async(custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Gets endpoint keys for an endpoint
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def get_keys_with_http_info(custom_headers:nil)
get_keys_async(custom_headers:custom_headers).value!
end
#
# Gets endpoint keys for an endpoint
#
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def get_keys_async(custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'endpointkeys'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::EndpointKeysDTO.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Re-generates an endpoint key.
#
# @param key_type [String] Type of Key
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [EndpointKeysDTO] operation results.
#
def refresh_keys(key_type, custom_headers:nil)
response = refresh_keys_async(key_type, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Re-generates an endpoint key.
#
# @param key_type [String] Type of Key
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def refresh_keys_with_http_info(key_type, custom_headers:nil)
refresh_keys_async(key_type, custom_headers:custom_headers).value!
end
#
# Re-generates an endpoint key.
#
# @param key_type [String] Type of Key
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def refresh_keys_async(key_type, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'key_type is nil' if key_type.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'endpointkeys/{keyType}'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'keyType' => key_type},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:patch, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::EndpointKeysDTO.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
end
end

Просмотреть файл

@ -0,0 +1,721 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
#
# An API for QnAMaker Service
#
class Knowledgebase
include MsRestAzure
#
# Creates and initializes a new instance of the Knowledgebase class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [QnamakerClient] reference to the QnamakerClient
attr_reader :client
#
# Gets all knowledgebases for a user.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [KnowledgebasesDTO] operation results.
#
def list_all(custom_headers:nil)
response = list_all_async(custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Gets all knowledgebases for a user.
#
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def list_all_with_http_info(custom_headers:nil)
list_all_async(custom_headers:custom_headers).value!
end
#
# Gets all knowledgebases for a user.
#
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def list_all_async(custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'knowledgebases'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebasesDTO.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Gets details of a specific knowledgebase.
#
# @param kb_id [String] Knowledgebase id.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [KnowledgebaseDTO] operation results.
#
def get_details(kb_id, custom_headers:nil)
response = get_details_async(kb_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Gets details of a specific knowledgebase.
#
# @param kb_id [String] Knowledgebase id.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def get_details_with_http_info(kb_id, custom_headers:nil)
get_details_async(kb_id, custom_headers:custom_headers).value!
end
#
# Gets details of a specific knowledgebase.
#
# @param kb_id [String] Knowledgebase id.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def get_details_async(kb_id, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'kb_id is nil' if kb_id.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'knowledgebases/{kbId}'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'kbId' => kb_id},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseDTO.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Deletes the knowledgebase and all its data.
#
# @param kb_id [String] Knowledgebase id.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def delete(kb_id, custom_headers:nil)
response = delete_async(kb_id, custom_headers:custom_headers).value!
nil
end
#
# Deletes the knowledgebase and all its data.
#
# @param kb_id [String] Knowledgebase id.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def delete_with_http_info(kb_id, custom_headers:nil)
delete_async(kb_id, custom_headers:custom_headers).value!
end
#
# Deletes the knowledgebase and all its data.
#
# @param kb_id [String] Knowledgebase id.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def delete_async(kb_id, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'kb_id is nil' if kb_id.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'knowledgebases/{kbId}'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'kbId' => kb_id},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:delete, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 204
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result
end
promise.execute
end
#
# Publishes all changes in test index of a knowledgebase to its prod index.
#
# @param kb_id [String] Knowledgebase id.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def publish(kb_id, custom_headers:nil)
response = publish_async(kb_id, custom_headers:custom_headers).value!
nil
end
#
# Publishes all changes in test index of a knowledgebase to its prod index.
#
# @param kb_id [String] Knowledgebase id.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def publish_with_http_info(kb_id, custom_headers:nil)
publish_async(kb_id, custom_headers:custom_headers).value!
end
#
# Publishes all changes in test index of a knowledgebase to its prod index.
#
# @param kb_id [String] Knowledgebase id.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def publish_async(kb_id, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'kb_id is nil' if kb_id.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'knowledgebases/{kbId}'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'kbId' => kb_id},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:post, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 204
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result
end
promise.execute
end
#
# Replace knowledgebase contents.
#
# @param kb_id [String] Knowledgebase id.
# @param replace_kb [ReplaceKbDTO] An instance of ReplaceKbDTO which contains
# list of qnas to be uploaded
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
#
def replace(kb_id, replace_kb, custom_headers:nil)
response = replace_async(kb_id, replace_kb, custom_headers:custom_headers).value!
nil
end
#
# Replace knowledgebase contents.
#
# @param kb_id [String] Knowledgebase id.
# @param replace_kb [ReplaceKbDTO] An instance of ReplaceKbDTO which contains
# list of qnas to be uploaded
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def replace_with_http_info(kb_id, replace_kb, custom_headers:nil)
replace_async(kb_id, replace_kb, custom_headers:custom_headers).value!
end
#
# Replace knowledgebase contents.
#
# @param kb_id [String] Knowledgebase id.
# @param replace_kb [ReplaceKbDTO] An instance of ReplaceKbDTO which contains
# list of qnas to be uploaded
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def replace_async(kb_id, replace_kb, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'kb_id is nil' if kb_id.nil?
fail ArgumentError, 'replace_kb is nil' if replace_kb.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
# Serialize Request
request_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::ReplaceKbDTO.mapper()
request_content = @client.serialize(request_mapper, replace_kb)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'knowledgebases/{kbId}'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'kbId' => kb_id},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:put, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 204
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result
end
promise.execute
end
#
# Asynchronous operation to modify a knowledgebase.
#
# @param kb_id [String] Knowledgebase id.
# @param update_kb [UpdateKbOperationDTO] Post body of the request.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Operation] operation results.
#
def update(kb_id, update_kb, custom_headers:nil)
response = update_async(kb_id, update_kb, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Asynchronous operation to modify a knowledgebase.
#
# @param kb_id [String] Knowledgebase id.
# @param update_kb [UpdateKbOperationDTO] Post body of the request.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def update_with_http_info(kb_id, update_kb, custom_headers:nil)
update_async(kb_id, update_kb, custom_headers:custom_headers).value!
end
#
# Asynchronous operation to modify a knowledgebase.
#
# @param kb_id [String] Knowledgebase id.
# @param update_kb [UpdateKbOperationDTO] Post body of the request.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def update_async(kb_id, update_kb, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'kb_id is nil' if kb_id.nil?
fail ArgumentError, 'update_kb is nil' if update_kb.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
# Serialize Request
request_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTO.mapper()
request_content = @client.serialize(request_mapper, update_kb)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'knowledgebases/{kbId}'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'kbId' => kb_id},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:patch, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 202
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 202
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Asynchronous operation to create a new knowledgebase.
#
# @param create_kb_payload [CreateKbDTO] Post body of the request.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Operation] operation results.
#
def create(create_kb_payload, custom_headers:nil)
response = create_async(create_kb_payload, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Asynchronous operation to create a new knowledgebase.
#
# @param create_kb_payload [CreateKbDTO] Post body of the request.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def create_with_http_info(create_kb_payload, custom_headers:nil)
create_async(create_kb_payload, custom_headers:custom_headers).value!
end
#
# Asynchronous operation to create a new knowledgebase.
#
# @param create_kb_payload [CreateKbDTO] Post body of the request.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def create_async(create_kb_payload, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'create_kb_payload is nil' if create_kb_payload.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
# Serialize Request
request_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbDTO.mapper()
request_content = @client.serialize(request_mapper, create_kb_payload)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'knowledgebases/create'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:post, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 202
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 202
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
#
# Download the knowledgebase.
#
# @param kb_id [String] Knowledgebase id.
# @param environment [EnvironmentType] Specifies whether environment is Test or
# Prod. Possible values include: 'Prod', 'Test'
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [QnADocumentsDTO] operation results.
#
def download(kb_id, environment, custom_headers:nil)
response = download_async(kb_id, environment, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Download the knowledgebase.
#
# @param kb_id [String] Knowledgebase id.
# @param environment [EnvironmentType] Specifies whether environment is Test or
# Prod. Possible values include: 'Prod', 'Test'
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def download_with_http_info(kb_id, environment, custom_headers:nil)
download_async(kb_id, environment, custom_headers:custom_headers).value!
end
#
# Download the knowledgebase.
#
# @param kb_id [String] Knowledgebase id.
# @param environment [EnvironmentType] Specifies whether environment is Test or
# Prod. Possible values include: 'Prod', 'Test'
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def download_async(kb_id, environment, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'kb_id is nil' if kb_id.nil?
fail ArgumentError, 'environment is nil' if environment.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'knowledgebases/{kbId}/{environment}/qna'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'kbId' => kb_id,'environment' => environment},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADocumentsDTO.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
end
end

Просмотреть файл

@ -0,0 +1,54 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Collection of words that are synonyms.
#
class AlterationsDTO
include MsRestAzure
# @return [Array<String>] Words that are synonymous with each other.
attr_accessor :alterations
#
# Mapper for AlterationsDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'AlterationsDTO',
type: {
name: 'Composite',
class_name: 'AlterationsDTO',
model_properties: {
alterations: {
client_side_validation: true,
required: true,
serialized_name: 'alterations',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,111 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Post body schema for CreateKb operation.
#
class CreateKbDTO
include MsRestAzure
# @return [String] Friendly name for the knowledgebase.
attr_accessor :name
# @return [Array<QnADTO>] List of Q-A (QnADTO) to be added to the
# knowledgebase. Q-A Ids are assigned by the service and should be
# omitted.
attr_accessor :qna_list
# @return [Array<String>] List of URLs to be used for extracting Q-A.
attr_accessor :urls
# @return [Array<FileDTO>] List of files from which to Extract Q-A.
attr_accessor :files
#
# Mapper for CreateKbDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'CreateKbDTO',
type: {
name: 'Composite',
class_name: 'CreateKbDTO',
model_properties: {
name: {
client_side_validation: true,
required: true,
serialized_name: 'name',
constraints: {
MaxLength: 100,
MinLength: 1
},
type: {
name: 'String'
}
},
qna_list: {
client_side_validation: true,
required: false,
serialized_name: 'qnaList',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'QnADTOElementType',
type: {
name: 'Composite',
class_name: 'QnADTO'
}
}
}
},
urls: {
client_side_validation: true,
required: false,
serialized_name: 'urls',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
files: {
client_side_validation: true,
required: false,
serialized_name: 'files',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'FileDTOElementType',
type: {
name: 'Composite',
class_name: 'FileDTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,95 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Input to create KB.
#
class CreateKbInputDTO
include MsRestAzure
# @return [Array<QnADTO>] List of QNA to be added to the index. Ids are
# generated by the service and should be omitted.
attr_accessor :qna_list
# @return [Array<String>] List of URLs to be added to knowledgebase.
attr_accessor :urls
# @return [Array<FileDTO>] List of files to be added to knowledgebase.
attr_accessor :files
#
# Mapper for CreateKbInputDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'CreateKbInputDTO',
type: {
name: 'Composite',
class_name: 'CreateKbInputDTO',
model_properties: {
qna_list: {
client_side_validation: true,
required: false,
serialized_name: 'qnaList',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'QnADTOElementType',
type: {
name: 'Composite',
class_name: 'QnADTO'
}
}
}
},
urls: {
client_side_validation: true,
required: false,
serialized_name: 'urls',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
files: {
client_side_validation: true,
required: false,
serialized_name: 'files',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'FileDTOElementType',
type: {
name: 'Composite',
class_name: 'FileDTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,74 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# PATCH body schema of Delete Operation in UpdateKb
#
class DeleteKbContentsDTO
include MsRestAzure
# @return [Array<Integer>] List of Qna Ids to be deleted
attr_accessor :ids
# @return [Array<String>] List of sources to be deleted from
# knowledgebase.
attr_accessor :sources
#
# Mapper for DeleteKbContentsDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'DeleteKbContentsDTO',
type: {
name: 'Composite',
class_name: 'DeleteKbContentsDTO',
model_properties: {
ids: {
client_side_validation: true,
required: false,
serialized_name: 'ids',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'NumberElementType',
type: {
name: 'Number'
}
}
}
},
sources: {
client_side_validation: true,
required: false,
serialized_name: 'sources',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,79 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Schema for EndpointKeys generate/refresh operations.
#
class EndpointKeysDTO
include MsRestAzure
# @return [String] Primary Access Key.
attr_accessor :primary_endpoint_key
# @return [String] Secondary Access Key.
attr_accessor :secondary_endpoint_key
# @return [String] Current version of runtime.
attr_accessor :installed_version
# @return [String] Latest version of runtime.
attr_accessor :last_stable_version
#
# Mapper for EndpointKeysDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'EndpointKeysDTO',
type: {
name: 'Composite',
class_name: 'EndpointKeysDTO',
model_properties: {
primary_endpoint_key: {
client_side_validation: true,
required: false,
serialized_name: 'primaryEndpointKey',
type: {
name: 'String'
}
},
secondary_endpoint_key: {
client_side_validation: true,
required: false,
serialized_name: 'secondaryEndpointKey',
type: {
name: 'String'
}
},
installed_version: {
client_side_validation: true,
required: false,
serialized_name: 'installedVersion',
type: {
name: 'String'
}
},
last_stable_version: {
client_side_validation: true,
required: false,
serialized_name: 'lastStableVersion',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,16 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Defines values for EnvironmentType
#
module EnvironmentType
Prod = "Prod"
Test = "Test"
end
end
end

Просмотреть файл

@ -0,0 +1,108 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# The error object. As per Microsoft One API guidelines -
# https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
#
class Error
include MsRestAzure
# @return [ErrorCodeType] One of a server-defined set of error codes.
# Possible values include: 'BadArgument', 'Forbidden', 'NotFound',
# 'KbNotFound', 'Unauthorized', 'Unspecified', 'EndpointKeysError',
# 'QuotaExceeded', 'QnaRuntimeError', 'SKULimitExceeded',
# 'OperationNotFound', 'ServiceError', 'ValidationFailure',
# 'ExtractionFailure'
attr_accessor :code
# @return [String] A human-readable representation of the error.
attr_accessor :message
# @return [String] The target of the error.
attr_accessor :target
# @return [Array<Error>] An array of details about specific errors that
# led to this reported error.
attr_accessor :details
# @return [InnerErrorModel] An object containing more specific
# information than the current object about the error.
attr_accessor :inner_error
#
# Mapper for Error class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'Error',
type: {
name: 'Composite',
class_name: 'Error',
model_properties: {
code: {
client_side_validation: true,
required: true,
serialized_name: 'code',
type: {
name: 'String'
}
},
message: {
client_side_validation: true,
required: false,
serialized_name: 'message',
type: {
name: 'String'
}
},
target: {
client_side_validation: true,
required: false,
serialized_name: 'target',
type: {
name: 'String'
}
},
details: {
client_side_validation: true,
required: false,
serialized_name: 'details',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'ErrorElementType',
type: {
name: 'Composite',
class_name: 'Error'
}
}
}
},
inner_error: {
client_side_validation: true,
required: false,
serialized_name: 'innerError',
type: {
name: 'Composite',
class_name: 'InnerErrorModel'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,28 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Defines values for ErrorCodeType
#
module ErrorCodeType
BadArgument = "BadArgument"
Forbidden = "Forbidden"
NotFound = "NotFound"
KbNotFound = "KbNotFound"
Unauthorized = "Unauthorized"
Unspecified = "Unspecified"
EndpointKeysError = "EndpointKeysError"
QuotaExceeded = "QuotaExceeded"
QnaRuntimeError = "QnaRuntimeError"
SKULimitExceeded = "SKULimitExceeded"
OperationNotFound = "OperationNotFound"
ServiceError = "ServiceError"
ValidationFailure = "ValidationFailure"
ExtractionFailure = "ExtractionFailure"
end
end
end

Просмотреть файл

@ -0,0 +1,48 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Error response. As per Microsoft One API guidelines -
# https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
#
class ErrorResponse
include MsRestAzure
# @return [ErrorResponseError] The error object.
attr_accessor :error
#
# Mapper for ErrorResponse class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'ErrorResponse',
type: {
name: 'Composite',
class_name: 'ErrorResponse',
model_properties: {
error: {
client_side_validation: true,
required: false,
serialized_name: 'error',
type: {
name: 'Composite',
class_name: 'ErrorResponseError'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,85 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# The error object.
#
class ErrorResponseError < Error
include MsRestAzure
#
# Mapper for ErrorResponseError class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'ErrorResponse_error',
type: {
name: 'Composite',
class_name: 'ErrorResponseError',
model_properties: {
code: {
client_side_validation: true,
required: true,
serialized_name: 'code',
type: {
name: 'String'
}
},
message: {
client_side_validation: true,
required: false,
serialized_name: 'message',
type: {
name: 'String'
}
},
target: {
client_side_validation: true,
required: false,
serialized_name: 'target',
type: {
name: 'String'
}
},
details: {
client_side_validation: true,
required: false,
serialized_name: 'details',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'ErrorElementType',
type: {
name: 'Composite',
class_name: 'Error'
}
}
}
},
inner_error: {
client_side_validation: true,
required: false,
serialized_name: 'innerError',
type: {
name: 'Composite',
class_name: 'InnerErrorModel'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,62 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# DTO to hold details of uploaded files.
#
class FileDTO
include MsRestAzure
# @return [String] File name. Supported file types are ".tsv", ".pdf",
# ".txt", ".docx", ".xlsx".
attr_accessor :file_name
# @return [String] Public URI of the file.
attr_accessor :file_uri
#
# Mapper for FileDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'FileDTO',
type: {
name: 'Composite',
class_name: 'FileDTO',
model_properties: {
file_name: {
client_side_validation: true,
required: true,
serialized_name: 'fileName',
constraints: {
MaxLength: 200,
MinLength: 1
},
type: {
name: 'String'
}
},
file_uri: {
client_side_validation: true,
required: true,
serialized_name: 'fileUri',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,62 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# An object containing more specific information about the error. As per
# Microsoft One API guidelines -
# https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
#
class InnerErrorModel
include MsRestAzure
# @return [String] A more specific error code than was provided by the
# containing error.
attr_accessor :code
# @return [InnerErrorModel] An object containing more specific
# information than the current object about the error.
attr_accessor :inner_error
#
# Mapper for InnerErrorModel class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'InnerErrorModel',
type: {
name: 'Composite',
class_name: 'InnerErrorModel',
model_properties: {
code: {
client_side_validation: true,
required: false,
serialized_name: 'code',
type: {
name: 'String'
}
},
inner_error: {
client_side_validation: true,
required: false,
serialized_name: 'innerError',
type: {
name: 'Composite',
class_name: 'InnerErrorModel'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,155 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Response schema for CreateKb operation.
#
class KnowledgebaseDTO
include MsRestAzure
# @return [String] Unique id that identifies a knowledgebase.
attr_accessor :id
# @return [String] URL host name at which the knowledgebase is hosted.
attr_accessor :host_name
# @return [String] Time stamp at which the knowledgebase was last
# accessed (UTC).
attr_accessor :last_accessed_timestamp
# @return [String] Time stamp at which the knowledgebase was last
# modified (UTC).
attr_accessor :last_changed_timestamp
# @return [String] Time stamp at which the knowledgebase was last
# published (UTC).
attr_accessor :last_published_timestamp
# @return [String] Friendly name of the knowledgebase.
attr_accessor :name
# @return [String] User who created / owns the knowledgebase.
attr_accessor :user_id
# @return [Array<String>] URL sources from which Q-A were extracted and
# added to the knowledgebase.
attr_accessor :urls
# @return [Array<String>] Custom sources from which Q-A were extracted or
# explicitly added to the knowledgebase.
attr_accessor :sources
#
# Mapper for KnowledgebaseDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'KnowledgebaseDTO',
type: {
name: 'Composite',
class_name: 'KnowledgebaseDTO',
model_properties: {
id: {
client_side_validation: true,
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
host_name: {
client_side_validation: true,
required: false,
serialized_name: 'hostName',
type: {
name: 'String'
}
},
last_accessed_timestamp: {
client_side_validation: true,
required: false,
serialized_name: 'lastAccessedTimestamp',
type: {
name: 'String'
}
},
last_changed_timestamp: {
client_side_validation: true,
required: false,
serialized_name: 'lastChangedTimestamp',
type: {
name: 'String'
}
},
last_published_timestamp: {
client_side_validation: true,
required: false,
serialized_name: 'lastPublishedTimestamp',
type: {
name: 'String'
}
},
name: {
client_side_validation: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
user_id: {
client_side_validation: true,
required: false,
serialized_name: 'userId',
type: {
name: 'String'
}
},
urls: {
client_side_validation: true,
required: false,
serialized_name: 'urls',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
sources: {
client_side_validation: true,
required: false,
serialized_name: 'sources',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,16 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Defines values for KnowledgebaseEnvironmentType
#
module KnowledgebaseEnvironmentType
Prod = "Prod"
Test = "Test"
end
end
end

Просмотреть файл

@ -0,0 +1,55 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Collection of knowledgebases owned by a user.
#
class KnowledgebasesDTO
include MsRestAzure
# @return [Array<KnowledgebaseDTO>] Collection of knowledgebase records.
attr_accessor :knowledgebases
#
# Mapper for KnowledgebasesDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'KnowledgebasesDTO',
type: {
name: 'Composite',
class_name: 'KnowledgebasesDTO',
model_properties: {
knowledgebases: {
client_side_validation: true,
required: false,
serialized_name: 'knowledgebases',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'KnowledgebaseDTOElementType',
type: {
name: 'Composite',
class_name: 'KnowledgebaseDTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,65 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Name - value pair of metadata.
#
class MetadataDTO
include MsRestAzure
# @return [String] Metadata name.
attr_accessor :name
# @return [String] Metadata value.
attr_accessor :value
#
# Mapper for MetadataDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'MetadataDTO',
type: {
name: 'Composite',
class_name: 'MetadataDTO',
model_properties: {
name: {
client_side_validation: true,
required: true,
serialized_name: 'name',
constraints: {
MaxLength: 100,
MinLength: 1
},
type: {
name: 'String'
}
},
value: {
client_side_validation: true,
required: true,
serialized_name: 'value',
constraints: {
MaxLength: 500,
MinLength: 1
},
type: {
name: 'String'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,115 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Record to track long running operation.
#
class Operation
include MsRestAzure
# @return [OperationStateType] Operation state. Possible values include:
# 'Failed', 'NotStarted', 'Running', 'Succeeded'
attr_accessor :operation_state
# @return [String] Timestamp when the operation was created.
attr_accessor :created_timestamp
# @return [String] Timestamp when the current state was entered.
attr_accessor :last_action_timestamp
# @return [String] Relative URI to the target resource location for
# completed resources.
attr_accessor :resource_location
# @return [String] User Id
attr_accessor :user_id
# @return [String] Operation Id.
attr_accessor :operation_id
# @return [ErrorResponse] Error details in case of failures.
attr_accessor :error_response
#
# Mapper for Operation class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'Operation',
type: {
name: 'Composite',
class_name: 'Operation',
model_properties: {
operation_state: {
client_side_validation: true,
required: false,
serialized_name: 'operationState',
type: {
name: 'String'
}
},
created_timestamp: {
client_side_validation: true,
required: false,
serialized_name: 'createdTimestamp',
type: {
name: 'String'
}
},
last_action_timestamp: {
client_side_validation: true,
required: false,
serialized_name: 'lastActionTimestamp',
type: {
name: 'String'
}
},
resource_location: {
client_side_validation: true,
required: false,
serialized_name: 'resourceLocation',
type: {
name: 'String'
}
},
user_id: {
client_side_validation: true,
required: false,
serialized_name: 'userId',
type: {
name: 'String'
}
},
operation_id: {
client_side_validation: true,
required: false,
serialized_name: 'operationId',
type: {
name: 'String'
}
},
error_response: {
client_side_validation: true,
required: false,
serialized_name: 'errorResponse',
type: {
name: 'Composite',
class_name: 'ErrorResponse'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,18 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Defines values for OperationStateType
#
module OperationStateType
Failed = "Failed"
NotStarted = "NotStarted"
Running = "Running"
Succeeded = "Succeeded"
end
end
end

Просмотреть файл

@ -0,0 +1,55 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# List of QnADTO
#
class QnADocumentsDTO
include MsRestAzure
# @return [Array<QnADTO>] List of answers.
attr_accessor :qna_documents
#
# Mapper for QnADocumentsDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'QnADocumentsDTO',
type: {
name: 'Composite',
class_name: 'QnADocumentsDTO',
model_properties: {
qna_documents: {
client_side_validation: true,
required: false,
serialized_name: 'qnaDocuments',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'QnADTOElementType',
type: {
name: 'Composite',
class_name: 'QnADTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,116 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Q-A object.
#
class QnADTO
include MsRestAzure
# @return [Integer] Unique id for the Q-A.
attr_accessor :id
# @return [String] Answer text
attr_accessor :answer
# @return [String] Source from which Q-A was indexed. eg.
# https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs
attr_accessor :source
# @return [Array<String>] List of questions associated with the answer.
attr_accessor :questions
# @return [Array<MetadataDTO>] List of metadata associated with the
# answer.
attr_accessor :metadata
#
# Mapper for QnADTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'QnADTO',
type: {
name: 'Composite',
class_name: 'QnADTO',
model_properties: {
id: {
client_side_validation: true,
required: false,
serialized_name: 'id',
type: {
name: 'Number'
}
},
answer: {
client_side_validation: true,
required: true,
serialized_name: 'answer',
constraints: {
MaxLength: 25000,
MinLength: 1
},
type: {
name: 'String'
}
},
source: {
client_side_validation: true,
required: false,
serialized_name: 'source',
constraints: {
MaxLength: 300
},
type: {
name: 'String'
}
},
questions: {
client_side_validation: true,
required: true,
serialized_name: 'questions',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
metadata: {
client_side_validation: true,
required: false,
serialized_name: 'metadata',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'MetadataDTOElementType',
type: {
name: 'Composite',
class_name: 'MetadataDTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,57 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Post body schema for Replace KB operation.
#
class ReplaceKbDTO
include MsRestAzure
# @return [Array<QnADTO>] List of Q-A (QnADTO) to be added to the
# knowledgebase. Q-A Ids are assigned by the service and should be
# omitted.
attr_accessor :qn_alist
#
# Mapper for ReplaceKbDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'ReplaceKbDTO',
type: {
name: 'Composite',
class_name: 'ReplaceKbDTO',
model_properties: {
qn_alist: {
client_side_validation: true,
required: true,
serialized_name: 'qnAList',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'QnADTOElementType',
type: {
name: 'Composite',
class_name: 'QnADTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,87 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# PATCH body schema for Update operation in Update Kb
#
class UpdateKbContentsDTO
include MsRestAzure
# @return [String] Friendly name for the knowledgebase.
attr_accessor :name
# @return [Array<UpdateQnaDTO>] List of Q-A (UpdateQnaDTO) to be added to
# the knowledgebase.
attr_accessor :qna_list
# @return [Array<String>] List of existing URLs to be refreshed. The
# content will be extracted again and re-indexed.
attr_accessor :urls
#
# Mapper for UpdateKbContentsDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateKbContentsDTO',
type: {
name: 'Composite',
class_name: 'UpdateKbContentsDTO',
model_properties: {
name: {
client_side_validation: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
qna_list: {
client_side_validation: true,
required: false,
serialized_name: 'qnaList',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'UpdateQnaDTOElementType',
type: {
name: 'Composite',
class_name: 'UpdateQnaDTO'
}
}
}
},
urls: {
client_side_validation: true,
required: false,
serialized_name: 'urls',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,74 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Contains list of QnAs to be updated
#
class UpdateKbOperationDTO
include MsRestAzure
# @return [UpdateKbOperationDTOAdd] An instance of CreateKbInputDTO for
# add operation
attr_accessor :add
# @return [UpdateKbOperationDTODelete] An instance of DeleteKbContentsDTO
# for delete Operation
attr_accessor :delete
# @return [UpdateKbOperationDTOUpdate] An instance of UpdateKbContentsDTO
# for Update Operation
attr_accessor :update
#
# Mapper for UpdateKbOperationDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateKbOperationDTO',
type: {
name: 'Composite',
class_name: 'UpdateKbOperationDTO',
model_properties: {
add: {
client_side_validation: true,
required: false,
serialized_name: 'add',
type: {
name: 'Composite',
class_name: 'UpdateKbOperationDTOAdd'
}
},
delete: {
client_side_validation: true,
required: false,
serialized_name: 'delete',
type: {
name: 'Composite',
class_name: 'UpdateKbOperationDTODelete'
}
},
update: {
client_side_validation: true,
required: false,
serialized_name: 'update',
type: {
name: 'Composite',
class_name: 'UpdateKbOperationDTOUpdate'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,85 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# An instance of CreateKbInputDTO for add operation
#
class UpdateKbOperationDTOAdd < CreateKbInputDTO
include MsRestAzure
#
# Mapper for UpdateKbOperationDTOAdd class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateKbOperationDTO_add',
type: {
name: 'Composite',
class_name: 'UpdateKbOperationDTOAdd',
model_properties: {
qna_list: {
client_side_validation: true,
required: false,
serialized_name: 'qnaList',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'QnADTOElementType',
type: {
name: 'Composite',
class_name: 'QnADTO'
}
}
}
},
urls: {
client_side_validation: true,
required: false,
serialized_name: 'urls',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
files: {
client_side_validation: true,
required: false,
serialized_name: 'files',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'FileDTOElementType',
type: {
name: 'Composite',
class_name: 'FileDTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,67 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# An instance of DeleteKbContentsDTO for delete Operation
#
class UpdateKbOperationDTODelete < DeleteKbContentsDTO
include MsRestAzure
#
# Mapper for UpdateKbOperationDTODelete class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateKbOperationDTO_delete',
type: {
name: 'Composite',
class_name: 'UpdateKbOperationDTODelete',
model_properties: {
ids: {
client_side_validation: true,
required: false,
serialized_name: 'ids',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'NumberElementType',
type: {
name: 'Number'
}
}
}
},
sources: {
client_side_validation: true,
required: false,
serialized_name: 'sources',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,76 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# An instance of UpdateKbContentsDTO for Update Operation
#
class UpdateKbOperationDTOUpdate < UpdateKbContentsDTO
include MsRestAzure
#
# Mapper for UpdateKbOperationDTOUpdate class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateKbOperationDTO_update',
type: {
name: 'Composite',
class_name: 'UpdateKbOperationDTOUpdate',
model_properties: {
name: {
client_side_validation: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
qna_list: {
client_side_validation: true,
required: false,
serialized_name: 'qnaList',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'UpdateQnaDTOElementType',
type: {
name: 'Composite',
class_name: 'UpdateQnaDTO'
}
}
}
},
urls: {
client_side_validation: true,
required: false,
serialized_name: 'urls',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,77 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# PATCH Body schema to represent list of Metadata to be updated
#
class UpdateMetadataDTO
include MsRestAzure
# @return [Array<MetadataDTO>] List of Metadata associated with answer to
# be deleted
attr_accessor :delete
# @return [Array<MetadataDTO>] List of Metadat associated with answer to
# be added
attr_accessor :add
#
# Mapper for UpdateMetadataDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateMetadataDTO',
type: {
name: 'Composite',
class_name: 'UpdateMetadataDTO',
model_properties: {
delete: {
client_side_validation: true,
required: false,
serialized_name: 'delete',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'MetadataDTOElementType',
type: {
name: 'Composite',
class_name: 'MetadataDTO'
}
}
}
},
add: {
client_side_validation: true,
required: false,
serialized_name: 'add',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'MetadataDTOElementType',
type: {
name: 'Composite',
class_name: 'MetadataDTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,102 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# PATCH Body schema for Update Qna List
#
class UpdateQnaDTO
include MsRestAzure
# @return [Integer] Unique id for the Q-A
attr_accessor :id
# @return [String] Answer text
attr_accessor :answer
# @return [String] Source from which Q-A was indexed. eg.
# https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs
attr_accessor :source
# @return [UpdateQnaDTOQuestions] List of questions associated with the
# answer.
attr_accessor :questions
# @return [UpdateQnaDTOMetadata] List of metadata associated with the
# answer to be updated
attr_accessor :metadata
#
# Mapper for UpdateQnaDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateQnaDTO',
type: {
name: 'Composite',
class_name: 'UpdateQnaDTO',
model_properties: {
id: {
client_side_validation: true,
required: false,
serialized_name: 'id',
constraints: {
InclusiveMaximum: 2147483647,
InclusiveMinimum: 0
},
type: {
name: 'Number'
}
},
answer: {
client_side_validation: true,
required: false,
serialized_name: 'answer',
type: {
name: 'String'
}
},
source: {
client_side_validation: true,
required: false,
serialized_name: 'source',
constraints: {
MaxLength: 300
},
type: {
name: 'String'
}
},
questions: {
client_side_validation: true,
required: false,
serialized_name: 'questions',
type: {
name: 'Composite',
class_name: 'UpdateQnaDTOQuestions'
}
},
metadata: {
client_side_validation: true,
required: false,
serialized_name: 'metadata',
type: {
name: 'Composite',
class_name: 'UpdateQnaDTOMetadata'
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,69 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# List of metadata associated with the answer to be updated
#
class UpdateQnaDTOMetadata < UpdateMetadataDTO
include MsRestAzure
#
# Mapper for UpdateQnaDTOMetadata class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateQnaDTO_metadata',
type: {
name: 'Composite',
class_name: 'UpdateQnaDTOMetadata',
model_properties: {
delete: {
client_side_validation: true,
required: false,
serialized_name: 'delete',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'MetadataDTOElementType',
type: {
name: 'Composite',
class_name: 'MetadataDTO'
}
}
}
},
add: {
client_side_validation: true,
required: false,
serialized_name: 'add',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'MetadataDTOElementType',
type: {
name: 'Composite',
class_name: 'MetadataDTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,67 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# List of questions associated with the answer.
#
class UpdateQnaDTOQuestions < UpdateQuestionsDTO
include MsRestAzure
#
# Mapper for UpdateQnaDTOQuestions class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateQnaDTO_questions',
type: {
name: 'Composite',
class_name: 'UpdateQnaDTOQuestions',
model_properties: {
add: {
client_side_validation: true,
required: false,
serialized_name: 'add',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
delete: {
client_side_validation: true,
required: false,
serialized_name: 'delete',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,74 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# PATCH Body schema for Update Kb which contains list of questions to be
# added and deleted
#
class UpdateQuestionsDTO
include MsRestAzure
# @return [Array<String>] List of questions to be added
attr_accessor :add
# @return [Array<String>] List of questions to be deleted.
attr_accessor :delete
#
# Mapper for UpdateQuestionsDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'UpdateQuestionsDTO',
type: {
name: 'Composite',
class_name: 'UpdateQuestionsDTO',
model_properties: {
add: {
client_side_validation: true,
required: false,
serialized_name: 'add',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
},
delete: {
client_side_validation: true,
required: false,
serialized_name: 'delete',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,55 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
module Models
#
# Collection of word alterations.
#
class WordAlterationsDTO
include MsRestAzure
# @return [Array<AlterationsDTO>] Collection of word alterations.
attr_accessor :word_alterations
#
# Mapper for WordAlterationsDTO class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'WordAlterationsDTO',
type: {
name: 'Composite',
class_name: 'WordAlterationsDTO',
model_properties: {
word_alterations: {
client_side_validation: true,
required: true,
serialized_name: 'wordAlterations',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'AlterationsDTOElementType',
type: {
name: 'Composite',
class_name: 'AlterationsDTO'
}
}
}
}
}
}
}
end
end
end
end

Просмотреть файл

@ -0,0 +1,9 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure end
module Azure::CognitiveServices end
module Azure::CognitiveServices::Qnamaker end
module Azure::CognitiveServices::Qnamaker::V4_0 end

Просмотреть файл

@ -0,0 +1,112 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
#
# An API for QnAMaker Service
#
class Operations
include MsRestAzure
#
# Creates and initializes a new instance of the Operations class.
# @param client service class for accessing basic functionality.
#
def initialize(client)
@client = client
end
# @return [QnamakerClient] reference to the QnamakerClient
attr_reader :client
#
# Gets details of a specific long running operation.
#
# @param operation_id [String] Operation id.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [Operation] operation results.
#
def get_details(operation_id, custom_headers:nil)
response = get_details_async(operation_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end
#
# Gets details of a specific long running operation.
#
# @param operation_id [String] Operation id.
# @param custom_headers [Hash{String => String}] A hash of custom headers that
# will be added to the HTTP request.
#
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
#
def get_details_with_http_info(operation_id, custom_headers:nil)
get_details_async(operation_id, custom_headers:custom_headers).value!
end
#
# Gets details of a specific long running operation.
#
# @param operation_id [String] Operation id.
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def get_details_async(operation_id, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'operations/{operationId}'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'operationId' => operation_id},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end
end
end

Просмотреть файл

@ -0,0 +1,143 @@
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Qnamaker::V4_0
#
# A service client - single point of access to the REST API.
#
class QnamakerClient < MsRestAzure::AzureServiceClient
include MsRestAzure
include MsRestAzure::Serialization
# @return [String] the base URI of the service.
attr_reader :base_url
# @return Credentials needed for the client to connect to Azure.
attr_reader :credentials1
# @return [String] Supported Cognitive Services endpoints (protocol and
# hostname, for example: https://westus.api.cognitive.microsoft.com).
attr_accessor :endpoint
# @return Subscription credentials which uniquely identify client
# subscription.
attr_accessor :credentials
# @return [String] The preferred language for the response.
attr_accessor :accept_language
# @return [Integer] The retry timeout in seconds for Long Running
# Operations. Default value is 30.
attr_accessor :long_running_operation_retry_timeout
# @return [Boolean] Whether a unique x-ms-client-request-id should be
# generated. When set to true a unique x-ms-client-request-id value is
# generated and included in each request. Default is true.
attr_accessor :generate_client_request_id
# @return [EndpointKeys] endpoint_keys
attr_reader :endpoint_keys
# @return [Alterations] alterations
attr_reader :alterations
# @return [Knowledgebase] knowledgebase
attr_reader :knowledgebase
# @return [Operations] operations
attr_reader :operations
#
# Creates initializes a new instance of the QnamakerClient class.
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
# @param options [Array] filters to be applied to the HTTP requests.
#
def initialize(credentials = nil, options = nil)
super(credentials, options)
@base_url = '{Endpoint}/qnamaker/v4.0'
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
@credentials = credentials
@endpoint_keys = EndpointKeys.new(self)
@alterations = Alterations.new(self)
@knowledgebase = Knowledgebase.new(self)
@operations = Operations.new(self)
@accept_language = 'en-US'
@long_running_operation_retry_timeout = 30
@generate_client_request_id = true
add_telemetry
end
#
# Makes a request and returns the body of the response.
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
# @param path [String] the path, relative to {base_url}.
# @param options [Hash{String=>String}] specifying any request options like :body.
# @return [Hash{String=>String}] containing the body of the response.
# Example:
#
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
# path = "/path"
# options = {
# body: request_content,
# query_params: {'api-version' => '2016-02-01'}
# }
# result = @client.make_request(:put, path, options)
#
def make_request(method, path, options = {})
result = make_request_with_http_info(method, path, options)
result.body unless result.nil?
end
#
# Makes a request and returns the operation response.
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
# @param path [String] the path, relative to {base_url}.
# @param options [Hash{String=>String}] specifying any request options like :body.
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
#
def make_request_with_http_info(method, path, options = {})
result = make_request_async(method, path, options).value!
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
result
end
#
# Makes a request asynchronously.
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
# @param path [String] the path, relative to {base_url}.
# @param options [Hash{String=>String}] specifying any request options like :body.
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
def make_request_async(method, path, options = {})
fail ArgumentError, 'method is nil' if method.nil?
fail ArgumentError, 'path is nil' if path.nil?
request_url = options[:base_url] || @base_url
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
@request_headers['Content-Type'] = options[:headers]['Content-Type']
end
request_headers = @request_headers
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
options.merge!({headers: request_headers.merge(options[:headers] || {})})
options.merge!({credentials: @credentials}) unless @credentials.nil?
super(request_url, method, path, options)
end
private
#
# Adds telemetry information.
#
def add_telemetry
sdk_information = 'azure_cognitiveservices_qnamaker'
sdk_information = "#{sdk_information}/0.17.0"
add_user_agent_information(sdk_information)
end
end
end

Просмотреть файл

@ -0,0 +1,6 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require '4.0/generated/azure_cognitiveservices_qnamaker'
require 'profiles/latest/qnamaker_latest_profile_client'

Просмотреть файл

@ -0,0 +1,7 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
module Azure end
module Azure::CognitiveServices end
module Azure::CognitiveServices::Qnamaker end

0
data/azure_cognitiveservices_qnamaker/lib/profiles/.gitignore поставляемый Normal file
Просмотреть файл

Просмотреть файл

@ -0,0 +1,193 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'azure_cognitiveservices_qnamaker'
module Azure::Qnamaker::Profiles::Latest
EndpointKeys = Azure::CognitiveServices::Qnamaker::V4_0::EndpointKeys
Alterations = Azure::CognitiveServices::Qnamaker::V4_0::Alterations
Knowledgebase = Azure::CognitiveServices::Qnamaker::V4_0::Knowledgebase
Operations = Azure::CognitiveServices::Qnamaker::V4_0::Operations
module Models
CreateKbInputDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbInputDTO
DeleteKbContentsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::DeleteKbContentsDTO
QnADTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADTO
EndpointKeysDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::EndpointKeysDTO
FileDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::FileDTO
WordAlterationsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::WordAlterationsDTO
KnowledgebasesDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebasesDTO
UpdateQnaDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTO
QnADocumentsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADocumentsDTO
UpdateQuestionsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQuestionsDTO
CreateKbDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbDTO
UpdateMetadataDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateMetadataDTO
ReplaceKbDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::ReplaceKbDTO
UpdateKbOperationDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTO
KnowledgebaseDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseDTO
UpdateKbContentsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbContentsDTO
ErrorResponse = Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponse
InnerErrorModel = Azure::CognitiveServices::Qnamaker::V4_0::Models::InnerErrorModel
MetadataDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::MetadataDTO
Error = Azure::CognitiveServices::Qnamaker::V4_0::Models::Error
AlterationsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::AlterationsDTO
Operation = Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation
UpdateKbOperationDTOAdd = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOAdd
UpdateKbOperationDTODelete = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTODelete
UpdateKbOperationDTOUpdate = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOUpdate
UpdateQnaDTOQuestions = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOQuestions
UpdateQnaDTOMetadata = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOMetadata
ErrorResponseError = Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponseError
KnowledgebaseEnvironmentType = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseEnvironmentType
ErrorCodeType = Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorCodeType
OperationStateType = Azure::CognitiveServices::Qnamaker::V4_0::Models::OperationStateType
EnvironmentType = Azure::CognitiveServices::Qnamaker::V4_0::Models::EnvironmentType
end
#
# QnamakerDataClass
#
class QnamakerDataClass
attr_reader :endpoint_keys, :alterations, :knowledgebase, :operations, :configurable, :base_url, :options, :model_classes
def initialize(options = {})
if options.is_a?(Hash) && options.length == 0
@options = setup_default_options
else
@options = options
end
reset!(options)
@configurable = self
@base_url = options[:base_url].nil? ? nil:options[:base_url]
@options = options[:options].nil? ? nil:options[:options]
@client_0 = Azure::CognitiveServices::Qnamaker::V4_0::QnamakerClient.new(configurable.credentials, options)
if(@client_0.respond_to?(:subscription_id))
@client_0.subscription_id = configurable.subscription_id
end
add_telemetry(@client_0)
@endpoint_keys = @client_0.endpoint_keys
@alterations = @client_0.alterations
@knowledgebase = @client_0.knowledgebase
@operations = @client_0.operations
@model_classes = ModelClasses.new
end
def add_telemetry(client)
profile_information = 'Profiles/Latest/Qnamaker'
client.add_user_agent_information(profile_information)
end
def method_missing(method, *args)
if @client_0.respond_to?method
@client_0.send(method, *args)
else
super
end
end
end
class ModelClasses
def create_kb_input_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbInputDTO
end
def delete_kb_contents_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::DeleteKbContentsDTO
end
def qn_adto
Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADTO
end
def endpoint_keys_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::EndpointKeysDTO
end
def file_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::FileDTO
end
def word_alterations_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::WordAlterationsDTO
end
def knowledgebases_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebasesDTO
end
def update_qna_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTO
end
def qn_adocuments_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADocumentsDTO
end
def update_questions_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQuestionsDTO
end
def create_kb_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbDTO
end
def update_metadata_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateMetadataDTO
end
def replace_kb_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::ReplaceKbDTO
end
def update_kb_operation_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTO
end
def knowledgebase_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseDTO
end
def update_kb_contents_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbContentsDTO
end
def error_response
Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponse
end
def inner_error_model
Azure::CognitiveServices::Qnamaker::V4_0::Models::InnerErrorModel
end
def metadata_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::MetadataDTO
end
def error
Azure::CognitiveServices::Qnamaker::V4_0::Models::Error
end
def alterations_dto
Azure::CognitiveServices::Qnamaker::V4_0::Models::AlterationsDTO
end
def operation
Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation
end
def update_kb_operation_dtoadd
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOAdd
end
def update_kb_operation_dtodelete
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTODelete
end
def update_kb_operation_dtoupdate
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOUpdate
end
def update_qna_dtoquestions
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOQuestions
end
def update_qna_dtometadata
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOMetadata
end
def error_response_error
Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponseError
end
def knowledgebase_environment_type
Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseEnvironmentType
end
def error_code_type
Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorCodeType
end
def operation_state_type
Azure::CognitiveServices::Qnamaker::V4_0::Models::OperationStateType
end
def environment_type
Azure::CognitiveServices::Qnamaker::V4_0::Models::EnvironmentType
end
end
end

Просмотреть файл

@ -0,0 +1,38 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'profiles/latest/qnamaker_module_definition'
require 'profiles/latest/modules/qnamaker_profile_module'
module Azure::Qnamaker::Profiles::Latest
#
# Client class for the Latest profile SDK.
#
class Client < QnamakerDataClass
include MsRestAzure::Common::Configurable
#
# Initializes a new instance of the Client class.
# @param options [Hash] hash of client options.
# options = {
# tenant_id: 'YOUR TENANT ID',
# client_id: 'YOUR CLIENT ID',
# client_secret: 'YOUR CLIENT SECRET',
# subscription_id: 'YOUR SUBSCRIPTION ID',
# credentials: credentials,
# active_directory_settings: active_directory_settings,
# base_url: 'YOUR BASE URL',
# options: options
# }
# 'credentials' are optional and if not passed in the hash, will be obtained
# from MsRest::TokenCredentials using MsRestAzure::ApplicationTokenProvider.
#
# Also, base_url, active_directory_settings & options are optional.
#
def initialize(options = {})
super(options)
end
end
end

Просмотреть файл

@ -0,0 +1,8 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
module Azure end
module Azure::Qnamaker end
module Azure::Qnamaker::Profiles end
module Azure::Qnamaker::Profiles::Latest end

Просмотреть файл

@ -0,0 +1,7 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
module Azure::CognitiveServices::Qnamaker
VERSION = '0.17.0'
end

Просмотреть файл

@ -0,0 +1,6 @@
# encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'dotenv'
Dotenv.load(File.join(File.dirname(__FILE__), '../../../.env'))

Просмотреть файл

@ -14,7 +14,7 @@ require_relative 'defs/module_definition_def'
# Class to generate the profile
#
class ProfileGenerator
CLIENTS_WITH_NO_BASE_URL = %w{ComputerVisionDataClass ContentModeratorDataClass FaceDataClass TextAnalyticsDataClass EventGridDataClass KeyVaultDataClass}
CLIENTS_WITH_NO_BASE_URL = %w{ComputerVisionDataClass ContentModeratorDataClass FaceDataClass TextAnalyticsDataClass EventGridDataClass KeyVaultDataClass QnamakerDataClass}
#
# Constructor for the profile generator.