azure_cognitiveservices_qnamaker 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker.rb +63 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/alterations.rb +189 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/endpoint_keys.rb +194 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/knowledgebase.rb +721 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/alterations_dto.rb +54 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/create_kb_dto.rb +111 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/create_kb_input_dto.rb +95 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/delete_kb_contents_dto.rb +74 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/endpoint_keys_dto.rb +79 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/environment_type.rb +16 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/error.rb +108 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/error_code_type.rb +28 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/error_response.rb +48 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/error_response_error.rb +85 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/file_dto.rb +62 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/inner_error_model.rb +62 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/knowledgebase_dto.rb +155 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/knowledgebase_environment_type.rb +16 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/knowledgebases_dto.rb +55 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/metadata_dto.rb +65 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/operation.rb +115 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/operation_state_type.rb +18 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/qn_adocuments_dto.rb +55 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/qn_adto.rb +116 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/replace_kb_dto.rb +57 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_contents_dto.rb +87 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_operation_dto.rb +74 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_operation_dtoadd.rb +85 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_operation_dtodelete.rb +67 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_kb_operation_dtoupdate.rb +76 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_metadata_dto.rb +77 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_qna_dto.rb +102 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_qna_dtometadata.rb +69 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_qna_dtoquestions.rb +67 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/update_questions_dto.rb +74 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/models/word_alterations_dto.rb +55 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/module_definition.rb +9 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/operations.rb +112 -0
- data/lib/4.0/generated/azure_cognitiveservices_qnamaker/qnamaker_client.rb +143 -0
- data/lib/azure_cognitiveservices_qnamaker.rb +6 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/modules/qnamaker_profile_module.rb +193 -0
- data/lib/profiles/latest/qnamaker_latest_profile_client.rb +38 -0
- data/lib/profiles/latest/qnamaker_module_definition.rb +8 -0
- data/lib/version.rb +7 -0
- metadata +165 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure end
|
7
|
+
module Azure::CognitiveServices end
|
8
|
+
module Azure::CognitiveServices::Qnamaker end
|
9
|
+
module Azure::CognitiveServices::Qnamaker::V4_0 end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CognitiveServices::Qnamaker::V4_0
|
7
|
+
#
|
8
|
+
# An API for QnAMaker Service
|
9
|
+
#
|
10
|
+
class Operations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Operations class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [QnamakerClient] reference to the QnamakerClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Gets details of a specific long running operation.
|
26
|
+
#
|
27
|
+
# @param operation_id [String] Operation id.
|
28
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
29
|
+
# will be added to the HTTP request.
|
30
|
+
#
|
31
|
+
# @return [Operation] operation results.
|
32
|
+
#
|
33
|
+
def get_details(operation_id, custom_headers:nil)
|
34
|
+
response = get_details_async(operation_id, custom_headers:custom_headers).value!
|
35
|
+
response.body unless response.nil?
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# Gets details of a specific long running operation.
|
40
|
+
#
|
41
|
+
# @param operation_id [String] Operation id.
|
42
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
43
|
+
# will be added to the HTTP request.
|
44
|
+
#
|
45
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
46
|
+
#
|
47
|
+
def get_details_with_http_info(operation_id, custom_headers:nil)
|
48
|
+
get_details_async(operation_id, custom_headers:custom_headers).value!
|
49
|
+
end
|
50
|
+
|
51
|
+
#
|
52
|
+
# Gets details of a specific long running operation.
|
53
|
+
#
|
54
|
+
# @param operation_id [String] Operation id.
|
55
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
56
|
+
# to the HTTP request.
|
57
|
+
#
|
58
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
59
|
+
#
|
60
|
+
def get_details_async(operation_id, custom_headers:nil)
|
61
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
62
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
63
|
+
|
64
|
+
|
65
|
+
request_headers = {}
|
66
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
67
|
+
|
68
|
+
# Set Headers
|
69
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
70
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
71
|
+
path_template = 'operations/{operationId}'
|
72
|
+
|
73
|
+
request_url = @base_url || @client.base_url
|
74
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
75
|
+
|
76
|
+
options = {
|
77
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
78
|
+
path_params: {'operationId' => operation_id},
|
79
|
+
headers: request_headers.merge(custom_headers || {}),
|
80
|
+
base_url: request_url
|
81
|
+
}
|
82
|
+
promise = @client.make_request_async(:get, path_template, options)
|
83
|
+
|
84
|
+
promise = promise.then do |result|
|
85
|
+
http_response = result.response
|
86
|
+
status_code = http_response.status
|
87
|
+
response_content = http_response.body
|
88
|
+
unless status_code == 200
|
89
|
+
error_model = JSON.load(response_content)
|
90
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
91
|
+
end
|
92
|
+
|
93
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
94
|
+
# Deserialize Response
|
95
|
+
if status_code == 200
|
96
|
+
begin
|
97
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
98
|
+
result_mapper = Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation.mapper()
|
99
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
100
|
+
rescue Exception => e
|
101
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
result
|
106
|
+
end
|
107
|
+
|
108
|
+
promise.execute
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CognitiveServices::Qnamaker::V4_0
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class QnamakerClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_reader :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials1
|
19
|
+
|
20
|
+
# @return [String] Supported Cognitive Services endpoints (protocol and
|
21
|
+
# hostname, for example: https://westus.api.cognitive.microsoft.com).
|
22
|
+
attr_accessor :endpoint
|
23
|
+
|
24
|
+
# @return Subscription credentials which uniquely identify client
|
25
|
+
# subscription.
|
26
|
+
attr_accessor :credentials
|
27
|
+
|
28
|
+
# @return [String] The preferred language for the response.
|
29
|
+
attr_accessor :accept_language
|
30
|
+
|
31
|
+
# @return [Integer] The retry timeout in seconds for Long Running
|
32
|
+
# Operations. Default value is 30.
|
33
|
+
attr_accessor :long_running_operation_retry_timeout
|
34
|
+
|
35
|
+
# @return [Boolean] Whether a unique x-ms-client-request-id should be
|
36
|
+
# generated. When set to true a unique x-ms-client-request-id value is
|
37
|
+
# generated and included in each request. Default is true.
|
38
|
+
attr_accessor :generate_client_request_id
|
39
|
+
|
40
|
+
# @return [EndpointKeys] endpoint_keys
|
41
|
+
attr_reader :endpoint_keys
|
42
|
+
|
43
|
+
# @return [Alterations] alterations
|
44
|
+
attr_reader :alterations
|
45
|
+
|
46
|
+
# @return [Knowledgebase] knowledgebase
|
47
|
+
attr_reader :knowledgebase
|
48
|
+
|
49
|
+
# @return [Operations] operations
|
50
|
+
attr_reader :operations
|
51
|
+
|
52
|
+
#
|
53
|
+
# Creates initializes a new instance of the QnamakerClient class.
|
54
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
55
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
56
|
+
#
|
57
|
+
def initialize(credentials = nil, options = nil)
|
58
|
+
super(credentials, options)
|
59
|
+
@base_url = '{Endpoint}/qnamaker/v4.0'
|
60
|
+
|
61
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
62
|
+
@credentials = credentials
|
63
|
+
|
64
|
+
@endpoint_keys = EndpointKeys.new(self)
|
65
|
+
@alterations = Alterations.new(self)
|
66
|
+
@knowledgebase = Knowledgebase.new(self)
|
67
|
+
@operations = Operations.new(self)
|
68
|
+
@accept_language = 'en-US'
|
69
|
+
@long_running_operation_retry_timeout = 30
|
70
|
+
@generate_client_request_id = true
|
71
|
+
add_telemetry
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# Makes a request and returns the body of the response.
|
76
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
77
|
+
# @param path [String] the path, relative to {base_url}.
|
78
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
79
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
80
|
+
# Example:
|
81
|
+
#
|
82
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
83
|
+
# path = "/path"
|
84
|
+
# options = {
|
85
|
+
# body: request_content,
|
86
|
+
# query_params: {'api-version' => '2016-02-01'}
|
87
|
+
# }
|
88
|
+
# result = @client.make_request(:put, path, options)
|
89
|
+
#
|
90
|
+
def make_request(method, path, options = {})
|
91
|
+
result = make_request_with_http_info(method, path, options)
|
92
|
+
result.body unless result.nil?
|
93
|
+
end
|
94
|
+
|
95
|
+
#
|
96
|
+
# Makes a request and returns the operation response.
|
97
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
98
|
+
# @param path [String] the path, relative to {base_url}.
|
99
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
100
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
101
|
+
#
|
102
|
+
def make_request_with_http_info(method, path, options = {})
|
103
|
+
result = make_request_async(method, path, options).value!
|
104
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
105
|
+
result
|
106
|
+
end
|
107
|
+
|
108
|
+
#
|
109
|
+
# Makes a request asynchronously.
|
110
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
111
|
+
# @param path [String] the path, relative to {base_url}.
|
112
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
113
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
114
|
+
#
|
115
|
+
def make_request_async(method, path, options = {})
|
116
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
117
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
118
|
+
|
119
|
+
request_url = options[:base_url] || @base_url
|
120
|
+
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
|
121
|
+
@request_headers['Content-Type'] = options[:headers]['Content-Type']
|
122
|
+
end
|
123
|
+
|
124
|
+
request_headers = @request_headers
|
125
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
126
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
127
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
128
|
+
|
129
|
+
super(request_url, method, path, options)
|
130
|
+
end
|
131
|
+
|
132
|
+
|
133
|
+
private
|
134
|
+
#
|
135
|
+
# Adds telemetry information.
|
136
|
+
#
|
137
|
+
def add_telemetry
|
138
|
+
sdk_information = 'azure_cognitiveservices_qnamaker'
|
139
|
+
sdk_information = "#{sdk_information}/0.17.0"
|
140
|
+
add_user_agent_information(sdk_information)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
require '4.0/generated/azure_cognitiveservices_qnamaker'
|
6
|
+
require 'profiles/latest/qnamaker_latest_profile_client'
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
module Azure end
|
6
|
+
module Azure::CognitiveServices end
|
7
|
+
module Azure::CognitiveServices::Qnamaker end
|
@@ -0,0 +1,193 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
require 'azure_cognitiveservices_qnamaker'
|
6
|
+
|
7
|
+
module Azure::Qnamaker::Profiles::Latest
|
8
|
+
EndpointKeys = Azure::CognitiveServices::Qnamaker::V4_0::EndpointKeys
|
9
|
+
Alterations = Azure::CognitiveServices::Qnamaker::V4_0::Alterations
|
10
|
+
Knowledgebase = Azure::CognitiveServices::Qnamaker::V4_0::Knowledgebase
|
11
|
+
Operations = Azure::CognitiveServices::Qnamaker::V4_0::Operations
|
12
|
+
|
13
|
+
module Models
|
14
|
+
CreateKbInputDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbInputDTO
|
15
|
+
DeleteKbContentsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::DeleteKbContentsDTO
|
16
|
+
QnADTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADTO
|
17
|
+
EndpointKeysDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::EndpointKeysDTO
|
18
|
+
FileDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::FileDTO
|
19
|
+
WordAlterationsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::WordAlterationsDTO
|
20
|
+
KnowledgebasesDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebasesDTO
|
21
|
+
UpdateQnaDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTO
|
22
|
+
QnADocumentsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADocumentsDTO
|
23
|
+
UpdateQuestionsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQuestionsDTO
|
24
|
+
CreateKbDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbDTO
|
25
|
+
UpdateMetadataDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateMetadataDTO
|
26
|
+
ReplaceKbDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::ReplaceKbDTO
|
27
|
+
UpdateKbOperationDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTO
|
28
|
+
KnowledgebaseDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseDTO
|
29
|
+
UpdateKbContentsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbContentsDTO
|
30
|
+
ErrorResponse = Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponse
|
31
|
+
InnerErrorModel = Azure::CognitiveServices::Qnamaker::V4_0::Models::InnerErrorModel
|
32
|
+
MetadataDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::MetadataDTO
|
33
|
+
Error = Azure::CognitiveServices::Qnamaker::V4_0::Models::Error
|
34
|
+
AlterationsDTO = Azure::CognitiveServices::Qnamaker::V4_0::Models::AlterationsDTO
|
35
|
+
Operation = Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation
|
36
|
+
UpdateKbOperationDTOAdd = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOAdd
|
37
|
+
UpdateKbOperationDTODelete = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTODelete
|
38
|
+
UpdateKbOperationDTOUpdate = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOUpdate
|
39
|
+
UpdateQnaDTOQuestions = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOQuestions
|
40
|
+
UpdateQnaDTOMetadata = Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOMetadata
|
41
|
+
ErrorResponseError = Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponseError
|
42
|
+
KnowledgebaseEnvironmentType = Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseEnvironmentType
|
43
|
+
ErrorCodeType = Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorCodeType
|
44
|
+
OperationStateType = Azure::CognitiveServices::Qnamaker::V4_0::Models::OperationStateType
|
45
|
+
EnvironmentType = Azure::CognitiveServices::Qnamaker::V4_0::Models::EnvironmentType
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# QnamakerDataClass
|
50
|
+
#
|
51
|
+
class QnamakerDataClass
|
52
|
+
attr_reader :endpoint_keys, :alterations, :knowledgebase, :operations, :configurable, :base_url, :options, :model_classes
|
53
|
+
|
54
|
+
def initialize(options = {})
|
55
|
+
if options.is_a?(Hash) && options.length == 0
|
56
|
+
@options = setup_default_options
|
57
|
+
else
|
58
|
+
@options = options
|
59
|
+
end
|
60
|
+
|
61
|
+
reset!(options)
|
62
|
+
|
63
|
+
@configurable = self
|
64
|
+
@base_url = options[:base_url].nil? ? nil:options[:base_url]
|
65
|
+
@options = options[:options].nil? ? nil:options[:options]
|
66
|
+
|
67
|
+
@client_0 = Azure::CognitiveServices::Qnamaker::V4_0::QnamakerClient.new(configurable.credentials, options)
|
68
|
+
if(@client_0.respond_to?(:subscription_id))
|
69
|
+
@client_0.subscription_id = configurable.subscription_id
|
70
|
+
end
|
71
|
+
add_telemetry(@client_0)
|
72
|
+
@endpoint_keys = @client_0.endpoint_keys
|
73
|
+
@alterations = @client_0.alterations
|
74
|
+
@knowledgebase = @client_0.knowledgebase
|
75
|
+
@operations = @client_0.operations
|
76
|
+
|
77
|
+
@model_classes = ModelClasses.new
|
78
|
+
end
|
79
|
+
|
80
|
+
def add_telemetry(client)
|
81
|
+
profile_information = 'Profiles/Latest/Qnamaker'
|
82
|
+
client.add_user_agent_information(profile_information)
|
83
|
+
end
|
84
|
+
|
85
|
+
def method_missing(method, *args)
|
86
|
+
if @client_0.respond_to?method
|
87
|
+
@client_0.send(method, *args)
|
88
|
+
else
|
89
|
+
super
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
class ModelClasses
|
96
|
+
def create_kb_input_dto
|
97
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbInputDTO
|
98
|
+
end
|
99
|
+
def delete_kb_contents_dto
|
100
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::DeleteKbContentsDTO
|
101
|
+
end
|
102
|
+
def qn_adto
|
103
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADTO
|
104
|
+
end
|
105
|
+
def endpoint_keys_dto
|
106
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::EndpointKeysDTO
|
107
|
+
end
|
108
|
+
def file_dto
|
109
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::FileDTO
|
110
|
+
end
|
111
|
+
def word_alterations_dto
|
112
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::WordAlterationsDTO
|
113
|
+
end
|
114
|
+
def knowledgebases_dto
|
115
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebasesDTO
|
116
|
+
end
|
117
|
+
def update_qna_dto
|
118
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTO
|
119
|
+
end
|
120
|
+
def qn_adocuments_dto
|
121
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::QnADocumentsDTO
|
122
|
+
end
|
123
|
+
def update_questions_dto
|
124
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQuestionsDTO
|
125
|
+
end
|
126
|
+
def create_kb_dto
|
127
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::CreateKbDTO
|
128
|
+
end
|
129
|
+
def update_metadata_dto
|
130
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateMetadataDTO
|
131
|
+
end
|
132
|
+
def replace_kb_dto
|
133
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::ReplaceKbDTO
|
134
|
+
end
|
135
|
+
def update_kb_operation_dto
|
136
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTO
|
137
|
+
end
|
138
|
+
def knowledgebase_dto
|
139
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseDTO
|
140
|
+
end
|
141
|
+
def update_kb_contents_dto
|
142
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbContentsDTO
|
143
|
+
end
|
144
|
+
def error_response
|
145
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponse
|
146
|
+
end
|
147
|
+
def inner_error_model
|
148
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::InnerErrorModel
|
149
|
+
end
|
150
|
+
def metadata_dto
|
151
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::MetadataDTO
|
152
|
+
end
|
153
|
+
def error
|
154
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::Error
|
155
|
+
end
|
156
|
+
def alterations_dto
|
157
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::AlterationsDTO
|
158
|
+
end
|
159
|
+
def operation
|
160
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::Operation
|
161
|
+
end
|
162
|
+
def update_kb_operation_dtoadd
|
163
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOAdd
|
164
|
+
end
|
165
|
+
def update_kb_operation_dtodelete
|
166
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTODelete
|
167
|
+
end
|
168
|
+
def update_kb_operation_dtoupdate
|
169
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateKbOperationDTOUpdate
|
170
|
+
end
|
171
|
+
def update_qna_dtoquestions
|
172
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOQuestions
|
173
|
+
end
|
174
|
+
def update_qna_dtometadata
|
175
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::UpdateQnaDTOMetadata
|
176
|
+
end
|
177
|
+
def error_response_error
|
178
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorResponseError
|
179
|
+
end
|
180
|
+
def knowledgebase_environment_type
|
181
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::KnowledgebaseEnvironmentType
|
182
|
+
end
|
183
|
+
def error_code_type
|
184
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::ErrorCodeType
|
185
|
+
end
|
186
|
+
def operation_state_type
|
187
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::OperationStateType
|
188
|
+
end
|
189
|
+
def environment_type
|
190
|
+
Azure::CognitiveServices::Qnamaker::V4_0::Models::EnvironmentType
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|