azure_cognitiveservices_luisauthoring 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring.rb +142 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb +2212 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/azure_accounts.rb +453 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/examples.rb +508 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb +668 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/luis_authoring_client.rb +167 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb +11482 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/app_version_setting_object.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_create_object.rb +106 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_info_response.rb +158 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_publish_object.rb +59 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_setting_update_object.rb +47 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_settings.rb +58 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/application_update_object.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/available_culture.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/available_prebuilt_entity_model.rb +68 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/azure_account_info_object.rb +68 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/batch_label_example.rb +70 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/child_entity.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list.rb +85 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_entity_extractor.rb +123 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_create_object.rb +66 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_patch_object.rb +55 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/closed_list_model_update_object.rb +66 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/collaborators_array.rb +55 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/composite_child_model_create_object.rb +47 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/composite_entity_extractor.rb +123 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/composite_entity_model.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/custom_prebuilt_model.rb +125 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/endpoint_info.rb +125 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/enqueue_training_response.rb +58 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entities_suggestion_example.rb +106 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_extractor.rb +125 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_label.rb +71 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_label_object.rb +71 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_model_info.rb +87 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_prediction.rb +81 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_role.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_role_create_object.rb +46 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/entity_role_update_object.rb +46 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/error_response.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/example_label_object.rb +78 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item_create_object.rb +46 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/explicit_list_item_update_object.rb +46 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/feature_info_object.rb +68 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/features_response_object.rb +75 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_child_entity.rb +77 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_child_model_create_object.rb +47 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_child_model_update_object.rb +47 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_entity_extractor.rb +123 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_entity_model.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/hierarchical_model.rb +97 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/intent_classifier.rb +89 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/intent_prediction.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/intents_suggestion_example.rb +106 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonentity.rb +70 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonmodel_feature.rb +90 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonregex_feature.rb +68 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/jsonutterance.rb +77 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/label_example_response.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/label_text_object.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/labeled_utterance.rb +148 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/luis_app.rb +318 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_create_object.rb +46 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_info.rb +83 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_info_response.rb +196 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_training_details.rb +91 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_training_info.rb +58 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/model_update_object.rb +46 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/operation_error.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/operation_status.rb +58 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/operation_status_type.rb +17 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_any.rb +84 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_entity_extractor.rb +123 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_model_create_object.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_any_model_update_object.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_create_object.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_feature_info.rb +70 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule_create_object.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule_info.rb +68 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_rule_update_object.rb +68 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/pattern_update_object.rb +70 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/personal_assistants_response.rb +74 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/phrase_list_feature_info.rb +91 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/phraselist_create_object.rb +81 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/phraselist_update_object.rb +94 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain.rb +119 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_create_base_object.rb +47 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_create_object.rb +58 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_item.rb +69 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_model_create_object.rb +58 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_domain_object.rb +58 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_entity.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/prebuilt_entity_extractor.rb +103 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/production_or_staging_endpoint_info.rb +100 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/publish_setting_update_object.rb +71 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/publish_settings.rb +82 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_entity.rb +76 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_entity_extractor.rb +114 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_model_create_object.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/regex_model_update_object.rb +57 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/sub_closed_list.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/sub_closed_list_response.rb +70 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/task_update_object.rb +46 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/training_status.rb +17 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/user_access_list.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/user_collaborator.rb +47 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/version_info.rb +177 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/word_list_base_update_object.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/models/word_list_object.rb +65 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/module_definition.rb +9 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/pattern.rb +963 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/permissions.rb +427 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/settings.rb +237 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/train.rb +247 -0
- data/lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb +854 -0
- data/lib/azure_cognitiveservices_luisauthoring.rb +6 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/luisauthoring_latest_profile_client.rb +38 -0
- data/lib/profiles/latest/luisauthoring_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/luisauthoring_profile_module.rb +497 -0
- data/lib/version.rb +7 -0
- metadata +244 -0
@@ -0,0 +1,668 @@
|
|
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::LuisAuthoring::V2_0
|
7
|
+
#
|
8
|
+
# Features
|
9
|
+
#
|
10
|
+
class Features
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Features class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [LuisAuthoringClient] reference to the LuisAuthoringClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Creates a new phraselist feature.
|
26
|
+
#
|
27
|
+
# @param app_id The application ID.
|
28
|
+
# @param version_id [String] The version ID.
|
29
|
+
# @param phraselist_create_object [PhraselistCreateObject] A Phraselist object
|
30
|
+
# containing Name, comma-separated Phrases and the isExchangeable boolean.
|
31
|
+
# Default value for isExchangeable is true.
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [Number] operation results.
|
36
|
+
#
|
37
|
+
def add_phrase_list(app_id, version_id, phraselist_create_object, custom_headers:nil)
|
38
|
+
response = add_phrase_list_async(app_id, version_id, phraselist_create_object, custom_headers:custom_headers).value!
|
39
|
+
response.body unless response.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Creates a new phraselist feature.
|
44
|
+
#
|
45
|
+
# @param app_id The application ID.
|
46
|
+
# @param version_id [String] The version ID.
|
47
|
+
# @param phraselist_create_object [PhraselistCreateObject] A Phraselist object
|
48
|
+
# containing Name, comma-separated Phrases and the isExchangeable boolean.
|
49
|
+
# Default value for isExchangeable is true.
|
50
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
51
|
+
# will be added to the HTTP request.
|
52
|
+
#
|
53
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
54
|
+
#
|
55
|
+
def add_phrase_list_with_http_info(app_id, version_id, phraselist_create_object, custom_headers:nil)
|
56
|
+
add_phrase_list_async(app_id, version_id, phraselist_create_object, custom_headers:custom_headers).value!
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
# Creates a new phraselist feature.
|
61
|
+
#
|
62
|
+
# @param app_id The application ID.
|
63
|
+
# @param version_id [String] The version ID.
|
64
|
+
# @param phraselist_create_object [PhraselistCreateObject] A Phraselist object
|
65
|
+
# containing Name, comma-separated Phrases and the isExchangeable boolean.
|
66
|
+
# Default value for isExchangeable is true.
|
67
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
68
|
+
# to the HTTP request.
|
69
|
+
#
|
70
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
71
|
+
#
|
72
|
+
def add_phrase_list_async(app_id, version_id, phraselist_create_object, custom_headers:nil)
|
73
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
74
|
+
fail ArgumentError, 'app_id is nil' if app_id.nil?
|
75
|
+
fail ArgumentError, 'version_id is nil' if version_id.nil?
|
76
|
+
fail ArgumentError, 'phraselist_create_object is nil' if phraselist_create_object.nil?
|
77
|
+
|
78
|
+
|
79
|
+
request_headers = {}
|
80
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
81
|
+
|
82
|
+
# Set Headers
|
83
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
84
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
85
|
+
|
86
|
+
# Serialize Request
|
87
|
+
request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PhraselistCreateObject.mapper()
|
88
|
+
request_content = @client.serialize(request_mapper, phraselist_create_object)
|
89
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
90
|
+
|
91
|
+
path_template = 'apps/{appId}/versions/{versionId}/phraselists'
|
92
|
+
|
93
|
+
request_url = @base_url || @client.base_url
|
94
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
95
|
+
|
96
|
+
options = {
|
97
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
98
|
+
path_params: {'appId' => app_id,'versionId' => version_id},
|
99
|
+
body: request_content,
|
100
|
+
headers: request_headers.merge(custom_headers || {}),
|
101
|
+
base_url: request_url
|
102
|
+
}
|
103
|
+
promise = @client.make_request_async(:post, path_template, options)
|
104
|
+
|
105
|
+
promise = promise.then do |result|
|
106
|
+
http_response = result.response
|
107
|
+
status_code = http_response.status
|
108
|
+
response_content = http_response.body
|
109
|
+
unless status_code == 201
|
110
|
+
error_model = JSON.load(response_content)
|
111
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
112
|
+
end
|
113
|
+
|
114
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
115
|
+
# Deserialize Response
|
116
|
+
if status_code == 201
|
117
|
+
begin
|
118
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
119
|
+
result_mapper = {
|
120
|
+
client_side_validation: true,
|
121
|
+
required: false,
|
122
|
+
serialized_name: 'parsed_response',
|
123
|
+
type: {
|
124
|
+
name: 'Number'
|
125
|
+
}
|
126
|
+
}
|
127
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
128
|
+
rescue Exception => e
|
129
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
result
|
134
|
+
end
|
135
|
+
|
136
|
+
promise.execute
|
137
|
+
end
|
138
|
+
|
139
|
+
#
|
140
|
+
# Gets all the phraselist features.
|
141
|
+
#
|
142
|
+
# @param app_id The application ID.
|
143
|
+
# @param version_id [String] The version ID.
|
144
|
+
# @param skip [Integer] The number of entries to skip. Default value is 0.
|
145
|
+
# @param take [Integer] The number of entries to return. Maximum page size is
|
146
|
+
# 500. Default is 100.
|
147
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
148
|
+
# will be added to the HTTP request.
|
149
|
+
#
|
150
|
+
# @return [Array] operation results.
|
151
|
+
#
|
152
|
+
def list_phrase_lists(app_id, version_id, skip:0, take:100, custom_headers:nil)
|
153
|
+
response = list_phrase_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
|
154
|
+
response.body unless response.nil?
|
155
|
+
end
|
156
|
+
|
157
|
+
#
|
158
|
+
# Gets all the phraselist features.
|
159
|
+
#
|
160
|
+
# @param app_id The application ID.
|
161
|
+
# @param version_id [String] The version ID.
|
162
|
+
# @param skip [Integer] The number of entries to skip. Default value is 0.
|
163
|
+
# @param take [Integer] The number of entries to return. Maximum page size is
|
164
|
+
# 500. Default is 100.
|
165
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
166
|
+
# will be added to the HTTP request.
|
167
|
+
#
|
168
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
169
|
+
#
|
170
|
+
def list_phrase_lists_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
|
171
|
+
list_phrase_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
|
172
|
+
end
|
173
|
+
|
174
|
+
#
|
175
|
+
# Gets all the phraselist features.
|
176
|
+
#
|
177
|
+
# @param app_id The application ID.
|
178
|
+
# @param version_id [String] The version ID.
|
179
|
+
# @param skip [Integer] The number of entries to skip. Default value is 0.
|
180
|
+
# @param take [Integer] The number of entries to return. Maximum page size is
|
181
|
+
# 500. Default is 100.
|
182
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
183
|
+
# to the HTTP request.
|
184
|
+
#
|
185
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
186
|
+
#
|
187
|
+
def list_phrase_lists_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
|
188
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
189
|
+
fail ArgumentError, 'app_id is nil' if app_id.nil?
|
190
|
+
fail ArgumentError, 'version_id is nil' if version_id.nil?
|
191
|
+
fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
|
192
|
+
fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
|
193
|
+
fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0
|
194
|
+
|
195
|
+
|
196
|
+
request_headers = {}
|
197
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
198
|
+
|
199
|
+
# Set Headers
|
200
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
201
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
202
|
+
path_template = 'apps/{appId}/versions/{versionId}/phraselists'
|
203
|
+
|
204
|
+
request_url = @base_url || @client.base_url
|
205
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
206
|
+
|
207
|
+
options = {
|
208
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
209
|
+
path_params: {'appId' => app_id,'versionId' => version_id},
|
210
|
+
query_params: {'skip' => skip,'take' => take},
|
211
|
+
headers: request_headers.merge(custom_headers || {}),
|
212
|
+
base_url: request_url
|
213
|
+
}
|
214
|
+
promise = @client.make_request_async(:get, path_template, options)
|
215
|
+
|
216
|
+
promise = promise.then do |result|
|
217
|
+
http_response = result.response
|
218
|
+
status_code = http_response.status
|
219
|
+
response_content = http_response.body
|
220
|
+
unless status_code == 200
|
221
|
+
error_model = JSON.load(response_content)
|
222
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
223
|
+
end
|
224
|
+
|
225
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
226
|
+
# Deserialize Response
|
227
|
+
if status_code == 200
|
228
|
+
begin
|
229
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
230
|
+
result_mapper = {
|
231
|
+
client_side_validation: true,
|
232
|
+
required: false,
|
233
|
+
serialized_name: 'parsed_response',
|
234
|
+
type: {
|
235
|
+
name: 'Sequence',
|
236
|
+
element: {
|
237
|
+
client_side_validation: true,
|
238
|
+
required: false,
|
239
|
+
serialized_name: 'PhraseListFeatureInfoElementType',
|
240
|
+
type: {
|
241
|
+
name: 'Composite',
|
242
|
+
class_name: 'PhraseListFeatureInfo'
|
243
|
+
}
|
244
|
+
}
|
245
|
+
}
|
246
|
+
}
|
247
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
248
|
+
rescue Exception => e
|
249
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
result
|
254
|
+
end
|
255
|
+
|
256
|
+
promise.execute
|
257
|
+
end
|
258
|
+
|
259
|
+
#
|
260
|
+
# Gets all the extraction features for the specified application version.
|
261
|
+
#
|
262
|
+
# @param app_id The application ID.
|
263
|
+
# @param version_id [String] The version ID.
|
264
|
+
# @param skip [Integer] The number of entries to skip. Default value is 0.
|
265
|
+
# @param take [Integer] The number of entries to return. Maximum page size is
|
266
|
+
# 500. Default is 100.
|
267
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
268
|
+
# will be added to the HTTP request.
|
269
|
+
#
|
270
|
+
# @return [FeaturesResponseObject] operation results.
|
271
|
+
#
|
272
|
+
def list(app_id, version_id, skip:0, take:100, custom_headers:nil)
|
273
|
+
response = list_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
|
274
|
+
response.body unless response.nil?
|
275
|
+
end
|
276
|
+
|
277
|
+
#
|
278
|
+
# Gets all the extraction features for the specified application version.
|
279
|
+
#
|
280
|
+
# @param app_id The application ID.
|
281
|
+
# @param version_id [String] The version ID.
|
282
|
+
# @param skip [Integer] The number of entries to skip. Default value is 0.
|
283
|
+
# @param take [Integer] The number of entries to return. Maximum page size is
|
284
|
+
# 500. Default is 100.
|
285
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
286
|
+
# will be added to the HTTP request.
|
287
|
+
#
|
288
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
289
|
+
#
|
290
|
+
def list_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
|
291
|
+
list_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
|
292
|
+
end
|
293
|
+
|
294
|
+
#
|
295
|
+
# Gets all the extraction features for the specified application version.
|
296
|
+
#
|
297
|
+
# @param app_id The application ID.
|
298
|
+
# @param version_id [String] The version ID.
|
299
|
+
# @param skip [Integer] The number of entries to skip. Default value is 0.
|
300
|
+
# @param take [Integer] The number of entries to return. Maximum page size is
|
301
|
+
# 500. Default is 100.
|
302
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
303
|
+
# to the HTTP request.
|
304
|
+
#
|
305
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
306
|
+
#
|
307
|
+
def list_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
|
308
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
309
|
+
fail ArgumentError, 'app_id is nil' if app_id.nil?
|
310
|
+
fail ArgumentError, 'version_id is nil' if version_id.nil?
|
311
|
+
fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
|
312
|
+
fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
|
313
|
+
fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0
|
314
|
+
|
315
|
+
|
316
|
+
request_headers = {}
|
317
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
318
|
+
|
319
|
+
# Set Headers
|
320
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
321
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
322
|
+
path_template = 'apps/{appId}/versions/{versionId}/features'
|
323
|
+
|
324
|
+
request_url = @base_url || @client.base_url
|
325
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
326
|
+
|
327
|
+
options = {
|
328
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
329
|
+
path_params: {'appId' => app_id,'versionId' => version_id},
|
330
|
+
query_params: {'skip' => skip,'take' => take},
|
331
|
+
headers: request_headers.merge(custom_headers || {}),
|
332
|
+
base_url: request_url
|
333
|
+
}
|
334
|
+
promise = @client.make_request_async(:get, path_template, options)
|
335
|
+
|
336
|
+
promise = promise.then do |result|
|
337
|
+
http_response = result.response
|
338
|
+
status_code = http_response.status
|
339
|
+
response_content = http_response.body
|
340
|
+
unless status_code == 200
|
341
|
+
error_model = JSON.load(response_content)
|
342
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
343
|
+
end
|
344
|
+
|
345
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
346
|
+
# Deserialize Response
|
347
|
+
if status_code == 200
|
348
|
+
begin
|
349
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
350
|
+
result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::FeaturesResponseObject.mapper()
|
351
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
352
|
+
rescue Exception => e
|
353
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
result
|
358
|
+
end
|
359
|
+
|
360
|
+
promise.execute
|
361
|
+
end
|
362
|
+
|
363
|
+
#
|
364
|
+
# Gets phraselist feature info.
|
365
|
+
#
|
366
|
+
# @param app_id The application ID.
|
367
|
+
# @param version_id [String] The version ID.
|
368
|
+
# @param phraselist_id [Integer] The ID of the feature to be retrieved.
|
369
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
370
|
+
# will be added to the HTTP request.
|
371
|
+
#
|
372
|
+
# @return [PhraseListFeatureInfo] operation results.
|
373
|
+
#
|
374
|
+
def get_phrase_list(app_id, version_id, phraselist_id, custom_headers:nil)
|
375
|
+
response = get_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value!
|
376
|
+
response.body unless response.nil?
|
377
|
+
end
|
378
|
+
|
379
|
+
#
|
380
|
+
# Gets phraselist feature info.
|
381
|
+
#
|
382
|
+
# @param app_id The application ID.
|
383
|
+
# @param version_id [String] The version ID.
|
384
|
+
# @param phraselist_id [Integer] The ID of the feature to be retrieved.
|
385
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
386
|
+
# will be added to the HTTP request.
|
387
|
+
#
|
388
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
389
|
+
#
|
390
|
+
def get_phrase_list_with_http_info(app_id, version_id, phraselist_id, custom_headers:nil)
|
391
|
+
get_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value!
|
392
|
+
end
|
393
|
+
|
394
|
+
#
|
395
|
+
# Gets phraselist feature info.
|
396
|
+
#
|
397
|
+
# @param app_id The application ID.
|
398
|
+
# @param version_id [String] The version ID.
|
399
|
+
# @param phraselist_id [Integer] The ID of the feature to be retrieved.
|
400
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
401
|
+
# to the HTTP request.
|
402
|
+
#
|
403
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
404
|
+
#
|
405
|
+
def get_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:nil)
|
406
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
407
|
+
fail ArgumentError, 'app_id is nil' if app_id.nil?
|
408
|
+
fail ArgumentError, 'version_id is nil' if version_id.nil?
|
409
|
+
fail ArgumentError, 'phraselist_id is nil' if phraselist_id.nil?
|
410
|
+
|
411
|
+
|
412
|
+
request_headers = {}
|
413
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
414
|
+
|
415
|
+
# Set Headers
|
416
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
417
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
418
|
+
path_template = 'apps/{appId}/versions/{versionId}/phraselists/{phraselistId}'
|
419
|
+
|
420
|
+
request_url = @base_url || @client.base_url
|
421
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
422
|
+
|
423
|
+
options = {
|
424
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
425
|
+
path_params: {'appId' => app_id,'versionId' => version_id,'phraselistId' => phraselist_id},
|
426
|
+
headers: request_headers.merge(custom_headers || {}),
|
427
|
+
base_url: request_url
|
428
|
+
}
|
429
|
+
promise = @client.make_request_async(:get, path_template, options)
|
430
|
+
|
431
|
+
promise = promise.then do |result|
|
432
|
+
http_response = result.response
|
433
|
+
status_code = http_response.status
|
434
|
+
response_content = http_response.body
|
435
|
+
unless status_code == 200
|
436
|
+
error_model = JSON.load(response_content)
|
437
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
438
|
+
end
|
439
|
+
|
440
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
441
|
+
# Deserialize Response
|
442
|
+
if status_code == 200
|
443
|
+
begin
|
444
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
445
|
+
result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PhraseListFeatureInfo.mapper()
|
446
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
447
|
+
rescue Exception => e
|
448
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
452
|
+
result
|
453
|
+
end
|
454
|
+
|
455
|
+
promise.execute
|
456
|
+
end
|
457
|
+
|
458
|
+
#
|
459
|
+
# Updates the phrases, the state and the name of the phraselist feature.
|
460
|
+
#
|
461
|
+
# @param app_id The application ID.
|
462
|
+
# @param version_id [String] The version ID.
|
463
|
+
# @param phraselist_id [Integer] The ID of the feature to be updated.
|
464
|
+
# @param phraselist_update_object [PhraselistUpdateObject] The new values for:
|
465
|
+
# - Just a boolean called IsActive, in which case the status of the feature
|
466
|
+
# will be changed. - Name, Pattern, Mode, and a boolean called IsActive to
|
467
|
+
# update the feature.
|
468
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
469
|
+
# will be added to the HTTP request.
|
470
|
+
#
|
471
|
+
# @return [OperationStatus] operation results.
|
472
|
+
#
|
473
|
+
def update_phrase_list(app_id, version_id, phraselist_id, phraselist_update_object:nil, custom_headers:nil)
|
474
|
+
response = update_phrase_list_async(app_id, version_id, phraselist_id, phraselist_update_object:phraselist_update_object, custom_headers:custom_headers).value!
|
475
|
+
response.body unless response.nil?
|
476
|
+
end
|
477
|
+
|
478
|
+
#
|
479
|
+
# Updates the phrases, the state and the name of the phraselist feature.
|
480
|
+
#
|
481
|
+
# @param app_id The application ID.
|
482
|
+
# @param version_id [String] The version ID.
|
483
|
+
# @param phraselist_id [Integer] The ID of the feature to be updated.
|
484
|
+
# @param phraselist_update_object [PhraselistUpdateObject] The new values for:
|
485
|
+
# - Just a boolean called IsActive, in which case the status of the feature
|
486
|
+
# will be changed. - Name, Pattern, Mode, and a boolean called IsActive to
|
487
|
+
# update the feature.
|
488
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
489
|
+
# will be added to the HTTP request.
|
490
|
+
#
|
491
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
492
|
+
#
|
493
|
+
def update_phrase_list_with_http_info(app_id, version_id, phraselist_id, phraselist_update_object:nil, custom_headers:nil)
|
494
|
+
update_phrase_list_async(app_id, version_id, phraselist_id, phraselist_update_object:phraselist_update_object, custom_headers:custom_headers).value!
|
495
|
+
end
|
496
|
+
|
497
|
+
#
|
498
|
+
# Updates the phrases, the state and the name of the phraselist feature.
|
499
|
+
#
|
500
|
+
# @param app_id The application ID.
|
501
|
+
# @param version_id [String] The version ID.
|
502
|
+
# @param phraselist_id [Integer] The ID of the feature to be updated.
|
503
|
+
# @param phraselist_update_object [PhraselistUpdateObject] The new values for:
|
504
|
+
# - Just a boolean called IsActive, in which case the status of the feature
|
505
|
+
# will be changed. - Name, Pattern, Mode, and a boolean called IsActive to
|
506
|
+
# update the feature.
|
507
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
508
|
+
# to the HTTP request.
|
509
|
+
#
|
510
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
511
|
+
#
|
512
|
+
def update_phrase_list_async(app_id, version_id, phraselist_id, phraselist_update_object:nil, custom_headers:nil)
|
513
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
514
|
+
fail ArgumentError, 'app_id is nil' if app_id.nil?
|
515
|
+
fail ArgumentError, 'version_id is nil' if version_id.nil?
|
516
|
+
fail ArgumentError, 'phraselist_id is nil' if phraselist_id.nil?
|
517
|
+
|
518
|
+
|
519
|
+
request_headers = {}
|
520
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
521
|
+
|
522
|
+
# Set Headers
|
523
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
524
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
525
|
+
|
526
|
+
# Serialize Request
|
527
|
+
request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PhraselistUpdateObject.mapper()
|
528
|
+
request_content = @client.serialize(request_mapper, phraselist_update_object)
|
529
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
530
|
+
|
531
|
+
path_template = 'apps/{appId}/versions/{versionId}/phraselists/{phraselistId}'
|
532
|
+
|
533
|
+
request_url = @base_url || @client.base_url
|
534
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
535
|
+
|
536
|
+
options = {
|
537
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
538
|
+
path_params: {'appId' => app_id,'versionId' => version_id,'phraselistId' => phraselist_id},
|
539
|
+
body: request_content,
|
540
|
+
headers: request_headers.merge(custom_headers || {}),
|
541
|
+
base_url: request_url
|
542
|
+
}
|
543
|
+
promise = @client.make_request_async(:put, path_template, options)
|
544
|
+
|
545
|
+
promise = promise.then do |result|
|
546
|
+
http_response = result.response
|
547
|
+
status_code = http_response.status
|
548
|
+
response_content = http_response.body
|
549
|
+
unless status_code == 200
|
550
|
+
error_model = JSON.load(response_content)
|
551
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
552
|
+
end
|
553
|
+
|
554
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
555
|
+
# Deserialize Response
|
556
|
+
if status_code == 200
|
557
|
+
begin
|
558
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
559
|
+
result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
|
560
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
561
|
+
rescue Exception => e
|
562
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
563
|
+
end
|
564
|
+
end
|
565
|
+
|
566
|
+
result
|
567
|
+
end
|
568
|
+
|
569
|
+
promise.execute
|
570
|
+
end
|
571
|
+
|
572
|
+
#
|
573
|
+
# Deletes a phraselist feature.
|
574
|
+
#
|
575
|
+
# @param app_id The application ID.
|
576
|
+
# @param version_id [String] The version ID.
|
577
|
+
# @param phraselist_id [Integer] The ID of the feature to be deleted.
|
578
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
579
|
+
# will be added to the HTTP request.
|
580
|
+
#
|
581
|
+
# @return [OperationStatus] operation results.
|
582
|
+
#
|
583
|
+
def delete_phrase_list(app_id, version_id, phraselist_id, custom_headers:nil)
|
584
|
+
response = delete_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value!
|
585
|
+
response.body unless response.nil?
|
586
|
+
end
|
587
|
+
|
588
|
+
#
|
589
|
+
# Deletes a phraselist feature.
|
590
|
+
#
|
591
|
+
# @param app_id The application ID.
|
592
|
+
# @param version_id [String] The version ID.
|
593
|
+
# @param phraselist_id [Integer] The ID of the feature to be deleted.
|
594
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
595
|
+
# will be added to the HTTP request.
|
596
|
+
#
|
597
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
598
|
+
#
|
599
|
+
def delete_phrase_list_with_http_info(app_id, version_id, phraselist_id, custom_headers:nil)
|
600
|
+
delete_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value!
|
601
|
+
end
|
602
|
+
|
603
|
+
#
|
604
|
+
# Deletes a phraselist feature.
|
605
|
+
#
|
606
|
+
# @param app_id The application ID.
|
607
|
+
# @param version_id [String] The version ID.
|
608
|
+
# @param phraselist_id [Integer] The ID of the feature to be deleted.
|
609
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
610
|
+
# to the HTTP request.
|
611
|
+
#
|
612
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
613
|
+
#
|
614
|
+
def delete_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:nil)
|
615
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
616
|
+
fail ArgumentError, 'app_id is nil' if app_id.nil?
|
617
|
+
fail ArgumentError, 'version_id is nil' if version_id.nil?
|
618
|
+
fail ArgumentError, 'phraselist_id is nil' if phraselist_id.nil?
|
619
|
+
|
620
|
+
|
621
|
+
request_headers = {}
|
622
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
623
|
+
|
624
|
+
# Set Headers
|
625
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
626
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
627
|
+
path_template = 'apps/{appId}/versions/{versionId}/phraselists/{phraselistId}'
|
628
|
+
|
629
|
+
request_url = @base_url || @client.base_url
|
630
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
631
|
+
|
632
|
+
options = {
|
633
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
634
|
+
path_params: {'appId' => app_id,'versionId' => version_id,'phraselistId' => phraselist_id},
|
635
|
+
headers: request_headers.merge(custom_headers || {}),
|
636
|
+
base_url: request_url
|
637
|
+
}
|
638
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
639
|
+
|
640
|
+
promise = promise.then do |result|
|
641
|
+
http_response = result.response
|
642
|
+
status_code = http_response.status
|
643
|
+
response_content = http_response.body
|
644
|
+
unless status_code == 200
|
645
|
+
error_model = JSON.load(response_content)
|
646
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
647
|
+
end
|
648
|
+
|
649
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
650
|
+
# Deserialize Response
|
651
|
+
if status_code == 200
|
652
|
+
begin
|
653
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
654
|
+
result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
|
655
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
656
|
+
rescue Exception => e
|
657
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
658
|
+
end
|
659
|
+
end
|
660
|
+
|
661
|
+
result
|
662
|
+
end
|
663
|
+
|
664
|
+
promise.execute
|
665
|
+
end
|
666
|
+
|
667
|
+
end
|
668
|
+
end
|