class Azure::CognitiveServices::LuisAuthoring::V2_0::Features
Attributes
@return [LuisAuthoringClient] reference to the LuisAuthoringClient
Public Class Methods
Creates and initializes a new instance of the Features
class. @param client service class for accessing basic functionality.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 17 def initialize(client) @client = client end
Public Instance Methods
Creates a new phraselist feature in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_create_object [PhraselistCreateObject] A Phraselist object containing Name, comma-separated Phrases and the isExchangeable boolean. Default value for isExchangeable is true. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Number] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 162 def add_phrase_list(app_id, version_id, phraselist_create_object, custom_headers:nil) response = add_phrase_list_async(app_id, version_id, phraselist_create_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates a new phraselist feature in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_create_object [PhraselistCreateObject] A Phraselist object containing Name, comma-separated Phrases and the isExchangeable boolean. Default value for isExchangeable is true. @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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 197 def add_phrase_list_async(app_id, version_id, phraselist_create_object, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, 'phraselist_create_object is nil' if phraselist_create_object.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::LuisAuthoring::V2_0::Models::PhraselistCreateObject.mapper() request_content = @client.serialize(request_mapper, phraselist_create_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/{versionId}/phraselists' 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: {'appId' => app_id,'versionId' => version_id}, 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 == 201 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Number' } } 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
Creates a new phraselist feature in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_create_object [PhraselistCreateObject] A Phraselist object containing Name, comma-separated Phrases and the isExchangeable boolean. Default value for isExchangeable is true. @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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 180 def add_phrase_list_with_http_info(app_id, version_id, phraselist_create_object, custom_headers:nil) add_phrase_list_async(app_id, version_id, phraselist_create_object, custom_headers:custom_headers).value! end
Deletes a phraselist feature from a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be deleted. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [OperationStatus] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 724 def delete_phrase_list(app_id, version_id, phraselist_id, custom_headers:nil) response = delete_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes a phraselist feature from a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be deleted. @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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 755 def delete_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, 'phraselist_id is nil' if phraselist_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 = 'apps/{appId}/versions/{versionId}/phraselists/{phraselistId}' 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: {'appId' => app_id,'versionId' => version_id,'phraselistId' => phraselist_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 == 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::LuisAuthoring::V2_0::Models::OperationStatus.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 a phraselist feature from a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be deleted. @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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 740 def delete_phrase_list_with_http_info(app_id, version_id, phraselist_id, custom_headers:nil) delete_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value! end
Gets phraselist feature info in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be retrieved. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [PhraseListFeatureInfo] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 508 def get_phrase_list(app_id, version_id, phraselist_id, custom_headers:nil) response = get_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets phraselist feature info in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be retrieved. @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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 539 def get_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, 'phraselist_id is nil' if phraselist_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 = 'apps/{appId}/versions/{versionId}/phraselists/{phraselistId}' 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: {'appId' => app_id,'versionId' => version_id,'phraselistId' => phraselist_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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::LuisAuthoring::V2_0::Models::PhraseListFeatureInfo.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 phraselist feature info in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be retrieved. @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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 524 def get_phrase_list_with_http_info(app_id, version_id, phraselist_id, custom_headers:nil) get_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value! end
Gets all the extraction phraselist and pattern features in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is
-
Default is 100.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [FeaturesResponseObject] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 402 def list(app_id, version_id, skip:0, take:100, custom_headers:nil) response = list_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value! response.body unless response.nil? end
- DEPRECATED NOTICE: This operation will soon be removed
-
Gets all the pattern
features.
@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is
-
Default is 100.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 38 def list_application_version_pattern_features(app_id, version_id, skip:0, take:100, custom_headers:nil) response = list_application_version_pattern_features_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value! response.body unless response.nil? end
- DEPRECATED NOTICE: This operation will soon be removed
-
Gets all the pattern
features.
@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is
-
Default is 100.
@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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 75 def list_application_version_pattern_features_async(app_id, version_id, skip:0, take:100, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500 fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0 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 = 'apps/{appId}/versions/{versionId}/patterns' 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: {'appId' => app_id,'versionId' => version_id}, query_params: {'skip' => skip,'take' => take}, 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'PatternFeatureInfoElementType', type: { name: 'Composite', class_name: 'PatternFeatureInfo' } } } } 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
- DEPRECATED NOTICE: This operation will soon be removed
-
Gets all the pattern
features.
@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is
-
Default is 100.
@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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 57 def list_application_version_pattern_features_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) list_application_version_pattern_features_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value! end
Gets all the extraction phraselist and pattern features in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is
-
Default is 100.
@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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 439 def list_async(app_id, version_id, skip:0, take:100, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500 fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0 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 = 'apps/{appId}/versions/{versionId}/features' 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: {'appId' => app_id,'versionId' => version_id}, query_params: {'skip' => skip,'take' => take}, 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::LuisAuthoring::V2_0::Models::FeaturesResponseObject.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 all the phraselist features in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is
-
Default is 100.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 279 def list_phrase_lists(app_id, version_id, skip:0, take:100, custom_headers:nil) response = list_phrase_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets all the phraselist features in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is
-
Default is 100.
@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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 314 def list_phrase_lists_async(app_id, version_id, skip:0, take:100, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500 fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0 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 = 'apps/{appId}/versions/{versionId}/phraselists' 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: {'appId' => app_id,'versionId' => version_id}, query_params: {'skip' => skip,'take' => take}, 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'PhraseListFeatureInfoElementType', type: { name: 'Composite', class_name: 'PhraseListFeatureInfo' } } } } 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 all the phraselist features in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is
-
Default is 100.
@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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 297 def list_phrase_lists_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) list_phrase_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value! end
Gets all the extraction phraselist and pattern features in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is
-
Default is 100.
@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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 421 def list_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) list_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value! end
Updates the phrases, the state and the name of the phraselist feature in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be updated. @param phraselist_update_object [PhraselistUpdateObject] The new values for:
-
Just a boolean called IsActive, in which case the status of the feature
will be changed. - Name, Pattern
, Mode, and a boolean called IsActive to update the feature. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [OperationStatus] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 610 def update_phrase_list(app_id, version_id, phraselist_id, phraselist_update_object:nil, custom_headers:nil) response = update_phrase_list_async(app_id, version_id, phraselist_id, phraselist_update_object:phraselist_update_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the phrases, the state and the name of the phraselist feature in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be updated. @param phraselist_update_object [PhraselistUpdateObject] The new values for:
-
Just a boolean called IsActive, in which case the status of the feature
will be changed. - Name, Pattern
, Mode, and a boolean called IsActive to update the feature. @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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 651 def update_phrase_list_async(app_id, version_id, phraselist_id, phraselist_update_object:nil, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_id.nil? fail ArgumentError, 'version_id is nil' if version_id.nil? fail ArgumentError, 'phraselist_id is nil' if phraselist_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? # Serialize Request request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PhraselistUpdateObject.mapper() request_content = @client.serialize(request_mapper, phraselist_update_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/{versionId}/phraselists/{phraselistId}' 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: {'appId' => app_id,'versionId' => version_id,'phraselistId' => phraselist_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 == 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? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::LuisAuthoring::V2_0::Models::OperationStatus.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
Updates the phrases, the state and the name of the phraselist feature in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be updated. @param phraselist_update_object [PhraselistUpdateObject] The new values for:
-
Just a boolean called IsActive, in which case the status of the feature
will be changed. - Name, Pattern
, Mode, and a boolean called IsActive to update the feature. @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.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb, line 631 def update_phrase_list_with_http_info(app_id, version_id, phraselist_id, phraselist_update_object:nil, custom_headers:nil) update_phrase_list_async(app_id, version_id, phraselist_id, phraselist_update_object:phraselist_update_object, custom_headers:custom_headers).value! end