class Azure::CognitiveServices::LuisAuthoring::V2_0::Apps
Attributes
@return [LuisAuthoringClient] reference to the LuisAuthoringClient
Public Class Methods
Creates and initializes a new instance of the Apps
class. @param client service class for accessing basic functionality.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 17 def initialize(client) @client = client end
Public Instance Methods
Creates a new LUIS app.
@param application_create_object [ApplicationCreateObject] An application containing Name, Description (optional), Culture, Usage Scenario (optional), Domain (optional) and initial version ID (optional) of the application. Default value for the version ID is “0.1”. Note: the culture cannot be changed after the app is created. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Uuid] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 37 def add(application_create_object, custom_headers:nil) response = add_async(application_create_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates a new LUIS app.
@param application_create_object [ApplicationCreateObject] An application containing Name, Description (optional), Culture, Usage Scenario (optional), Domain (optional) and initial version ID (optional) of the application. Default value for the version ID is “0.1”. Note: the culture cannot be changed after the app is created. @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/apps.rb, line 72 def add_async(application_create_object, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'application_create_object is nil' if application_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::ApplicationCreateObject.mapper() request_content = @client.serialize(request_mapper, application_create_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 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: 'String' } } 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
Adds a prebuilt domain along with its intent and entity models as a new application.
@param prebuilt_domain_create_object [PrebuiltDomainCreateObject] A prebuilt domain create object containing the name and culture of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Uuid] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1850 def add_custom_prebuilt_domain(prebuilt_domain_create_object, custom_headers:nil) response = add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Adds a prebuilt domain along with its intent and entity models as a new application.
@param prebuilt_domain_create_object [PrebuiltDomainCreateObject] A prebuilt domain create object containing the name and culture of the domain. @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/apps.rb, line 1881 def add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'prebuilt_domain_create_object is nil' if prebuilt_domain_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::PrebuiltDomainCreateObject.mapper() request_content = @client.serialize(request_mapper, prebuilt_domain_create_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/customprebuiltdomains' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 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: 'String' } } 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
Adds a prebuilt domain along with its intent and entity models as a new application.
@param prebuilt_domain_create_object [PrebuiltDomainCreateObject] A prebuilt domain create object containing the name and culture of the domain. @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/apps.rb, line 1866 def add_custom_prebuilt_domain_with_http_info(prebuilt_domain_create_object, custom_headers:nil) add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:custom_headers).value! end
Creates a new LUIS app.
@param application_create_object [ApplicationCreateObject] An application containing Name, Description (optional), Culture, Usage Scenario (optional), Domain (optional) and initial version ID (optional) of the application. Default value for the version ID is “0.1”. Note: the culture cannot be changed after the app is created. @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/apps.rb, line 55 def add_with_http_info(application_create_object, custom_headers:nil) add_async(application_create_object, custom_headers:custom_headers).value! end
Deletes an application.
@param app_id The application ID. @param force [Boolean] A flag to indicate whether to force an operation. @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/apps.rb, line 1052 def delete(app_id, force:false, custom_headers:nil) response = delete_async(app_id, force:force, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes an application.
@param app_id The application ID. @param force [Boolean] A flag to indicate whether to force an operation. @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/apps.rb, line 1081 def delete_async(app_id, force:false, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_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}' 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}, query_params: {'force' => force}, 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 an application.
@param app_id The application ID. @param force [Boolean] A flag to indicate whether to force an operation. @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/apps.rb, line 1067 def delete_with_http_info(app_id, force:false, custom_headers:nil) delete_async(app_id, force:force, custom_headers:custom_headers).value! end
Gets the logs of the past month's endpoint queries for the application.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NOT_IMPLEMENTED] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 763 def download_query_logs(app_id, custom_headers:nil) response = download_query_logs_async(app_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the logs of the past month's endpoint queries for the application.
@param app_id The application ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 790 def download_query_logs_async(app_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_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}/querylogs' 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}, 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 MsRestAzure::AzureOperationError.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: 'Stream' } } 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 the logs of the past month's endpoint queries for the application.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 777 def download_query_logs_with_http_info(app_id, custom_headers:nil) download_query_logs_async(app_id, custom_headers:custom_headers).value! end
Gets the application info.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [ApplicationInfoResponse] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 859 def get(app_id, custom_headers:nil) response = get_async(app_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the application info.
@param app_id The application ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 886 def get_async(app_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_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}' 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}, 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::ApplicationInfoResponse.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
Get the application publish settings including 'UseAllTrainingData'.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [PublishSettings] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1452 def get_publish_settings(app_id, custom_headers:nil) response = get_publish_settings_async(app_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Get the application publish settings including 'UseAllTrainingData'.
@param app_id The application ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1479 def get_publish_settings_async(app_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_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}/publishsettings' 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}, 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::PublishSettings.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
Get the application publish settings including 'UseAllTrainingData'.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1466 def get_publish_settings_with_http_info(app_id, custom_headers:nil) get_publish_settings_async(app_id, custom_headers:custom_headers).value! end
Get the application settings including 'UseAllTrainingData'.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [ApplicationSettings] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1260 def get_settings(app_id, custom_headers:nil) response = get_settings_async(app_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Get the application settings including 'UseAllTrainingData'.
@param app_id The application ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1287 def get_settings_async(app_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_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}/settings' 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}, 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::ApplicationSettings.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
Get the application settings including 'UseAllTrainingData'.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1274 def get_settings_with_http_info(app_id, custom_headers:nil) get_settings_async(app_id, custom_headers:custom_headers).value! end
Gets the application info.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 873 def get_with_http_info(app_id, custom_headers:nil) get_async(app_id, custom_headers:custom_headers).value! end
Imports an application to LUIS, the application's structure is included in the request body.
@param luis_app [LuisApp] A LUIS application structure. @param app_name [String] The application name to create. If not specified, the application name will be read from the imported object. If the application name already exists, an error is returned. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Uuid] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 264 def import(luis_app, app_name:nil, custom_headers:nil) response = import_async(luis_app, app_name:app_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Imports an application to LUIS, the application's structure is included in the request body.
@param luis_app [LuisApp] A LUIS application structure. @param app_name [String] The application name to create. If not specified, the application name will be read from the imported object. If the application name already exists, an error is returned. @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/apps.rb, line 299 def import_async(luis_app, app_name:nil, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'luis_app is nil' if luis_app.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::LuisApp.mapper() request_content = @client.serialize(request_mapper, luis_app) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/import' 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]], query_params: {'appName' => app_name}, 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: 'String' } } 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
Imports an application to LUIS, the application's structure is included in the request body.
@param luis_app [LuisApp] A LUIS application structure. @param app_name [String] The application name to create. If not specified, the application name will be read from the imported object. If the application name already exists, an error is returned. @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/apps.rb, line 282 def import_with_http_info(luis_app, app_name:nil, custom_headers:nil) import_async(luis_app, app_name:app_name, custom_headers:custom_headers).value! end
Lists all of the user's applications.
@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/apps.rb, line 149 def list(skip:0, take:100, custom_headers:nil) response = list_async(skip:skip, take:take, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists all of the user's applications.
@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/apps.rb, line 180 def list_async(skip:0, take:100, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.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/' 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]], 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: 'ApplicationInfoResponseElementType', type: { name: 'Composite', class_name: 'ApplicationInfoResponse' } } } } 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 available custom prebuilt domains for all cultures.
@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/apps.rb, line 1747 def list_available_custom_prebuilt_domains(custom_headers:nil) response = list_available_custom_prebuilt_domains_async(custom_headers:custom_headers).value! response.body unless response.nil? end
Gets all the available custom prebuilt domains for all cultures.
@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/apps.rb, line 1772 def list_available_custom_prebuilt_domains_async(custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/customprebuiltdomains' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? 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: 'PrebuiltDomainElementType', type: { name: 'Composite', class_name: 'PrebuiltDomain' } } } } 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 available prebuilt domains for a specific culture.
@param culture [String] Culture. @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/apps.rb, line 1956 def list_available_custom_prebuilt_domains_for_culture(culture, custom_headers:nil) response = list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets all the available prebuilt domains for a specific culture.
@param culture [String] Culture. @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/apps.rb, line 1983 def list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'culture is nil' if culture.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/customprebuiltdomains/{culture}' 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: {'culture' => culture}, 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: 'PrebuiltDomainElementType', type: { name: 'Composite', class_name: 'PrebuiltDomain' } } } } 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 available prebuilt domains for a specific culture.
@param culture [String] Culture. @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/apps.rb, line 1970 def list_available_custom_prebuilt_domains_for_culture_with_http_info(culture, custom_headers:nil) list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:custom_headers).value! end
Gets all the available custom prebuilt domains for all cultures.
@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/apps.rb, line 1760 def list_available_custom_prebuilt_domains_with_http_info(custom_headers:nil) list_available_custom_prebuilt_domains_async(custom_headers:custom_headers).value! end
Gets the endpoint URLs for the prebuilt Cortana applications.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [PersonalAssistantsResponse] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 374 def list_cortana_endpoints(custom_headers:nil) response = list_cortana_endpoints_async(custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the endpoint URLs for the prebuilt Cortana applications.
@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/apps.rb, line 399 def list_cortana_endpoints_async(custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/assistants' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? 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::PersonalAssistantsResponse.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 the endpoint URLs for the prebuilt Cortana applications.
@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/apps.rb, line 387 def list_cortana_endpoints_with_http_info(custom_headers:nil) list_cortana_endpoints_async(custom_headers:custom_headers).value! end
Gets the available application domains.
@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/apps.rb, line 458 def list_domains(custom_headers:nil) response = list_domains_async(custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the available application domains.
@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/apps.rb, line 483 def list_domains_async(custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/domains' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? 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: 'StringElementType', type: { name: 'String' } } } } 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 the available application domains.
@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/apps.rb, line 471 def list_domains_with_http_info(custom_headers:nil) list_domains_async(custom_headers:custom_headers).value! end
Returns the available endpoint deployment regions and URLs.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Hash] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1644 def list_endpoints(app_id, custom_headers:nil) response = list_endpoints_async(app_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Returns the available endpoint deployment regions and URLs.
@param app_id The application ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1671 def list_endpoints_async(app_id, custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? fail ArgumentError, 'app_id is nil' if app_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}/endpoints' 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}, 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: 'Dictionary', value: { client_side_validation: true, required: false, serialized_name: 'StringElementType', type: { name: 'String' } } } } 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
Returns the available endpoint deployment regions and URLs.
@param app_id The application ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1658 def list_endpoints_with_http_info(app_id, custom_headers:nil) list_endpoints_async(app_id, custom_headers:custom_headers).value! end
Gets a list of supported cultures. Cultures are equivalent to the written language and locale. For example,“en-us” represents the U.S. variation of English.
@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/apps.rb, line 658 def list_supported_cultures(custom_headers:nil) response = list_supported_cultures_async(custom_headers:custom_headers).value! response.body unless response.nil? end
Gets a list of supported cultures. Cultures are equivalent to the written language and locale. For example,“en-us” represents the U.S. variation of English.
@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/apps.rb, line 687 def list_supported_cultures_async(custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/cultures' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? 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: 'AvailableCultureElementType', type: { name: 'Composite', class_name: 'AvailableCulture' } } } } 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 a list of supported cultures. Cultures are equivalent to the written language and locale. For example,“en-us” represents the U.S. variation of English.
@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/apps.rb, line 673 def list_supported_cultures_with_http_info(custom_headers:nil) list_supported_cultures_async(custom_headers:custom_headers).value! end
Gets the application available usage scenarios.
@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/apps.rb, line 557 def list_usage_scenarios(custom_headers:nil) response = list_usage_scenarios_async(custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the application available usage scenarios.
@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/apps.rb, line 582 def list_usage_scenarios_async(custom_headers:nil) fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'apps/usagescenarios' request_url = @base_url || @client.base_url request_url = request_url.gsub('{Endpoint}', @client.endpoint) options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? 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: 'StringElementType', type: { name: 'String' } } } } 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 the application available usage scenarios.
@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/apps.rb, line 570 def list_usage_scenarios_with_http_info(custom_headers:nil) list_usage_scenarios_async(custom_headers:custom_headers).value! end
Lists all of the user's applications.
@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/apps.rb, line 165 def list_with_http_info(skip:0, take:100, custom_headers:nil) list_async(skip:skip, take:take, custom_headers:custom_headers).value! end
package - Gets published LUIS application package in binary stream GZip format
Packages a published LUIS application as a GZip file to be used in the LUIS container.
@param app_id The application ID. @param slot_name [String] The publishing slot name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NOT_IMPLEMENTED] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2066 def package_published_application_as_gzip(app_id, slot_name, custom_headers:nil) response = package_published_application_as_gzip_async(app_id, slot_name, custom_headers:custom_headers).value! response.body unless response.nil? end
package - Gets published LUIS application package in binary stream GZip format
Packages a published LUIS application as a GZip file to be used in the LUIS container.
@param app_id The application ID. @param slot_name [String] The publishing slot name. @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/apps.rb, line 2103 def package_published_application_as_gzip_async(app_id, slot_name, 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, 'slot_name is nil' if slot_name.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 = 'package/{appId}/slot/{slotName}/gzip' 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,'slotName' => slot_name}, 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: 'Stream' } } 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
package - Gets published LUIS application package in binary stream GZip format
Packages a published LUIS application as a GZip file to be used in the LUIS container.
@param app_id The application ID. @param slot_name [String] The publishing slot name. @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/apps.rb, line 2085 def package_published_application_as_gzip_with_http_info(app_id, slot_name, custom_headers:nil) package_published_application_as_gzip_async(app_id, slot_name, custom_headers:custom_headers).value! end
package - Gets trained LUIS application package in binary stream GZip format
Packages trained LUIS application as GZip file to be used in the LUIS container.
@param app_id The application ID. @param version_id [String] The version ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NOT_IMPLEMENTED] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2177 def package_trained_application_as_gzip(app_id, version_id, custom_headers:nil) response = package_trained_application_as_gzip_async(app_id, version_id, custom_headers:custom_headers).value! response.body unless response.nil? end
package - Gets trained LUIS application package in binary stream GZip format
Packages trained LUIS application as GZip file to be used in the LUIS container.
@param app_id The application ID. @param version_id [String] The version ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2212 def package_trained_application_as_gzip_async(app_id, version_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? 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 = 'package/{appId}/versions/{versionId}/gzip' 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}, 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: 'Stream' } } 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
package - Gets trained LUIS application package in binary stream GZip format
Packages trained LUIS application as GZip file to be used in the LUIS container.
@param app_id The application ID. @param version_id [String] The version ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2195 def package_trained_application_as_gzip_with_http_info(app_id, version_id, custom_headers:nil) package_trained_application_as_gzip_async(app_id, version_id, custom_headers:custom_headers).value! end
Publishes a specific version of the application.
@param app_id The application ID. @param application_publish_object [ApplicationPublishObject] The application publish object. The region is the target region that the application is published to. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [ProductionOrStagingEndpointInfo] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 1147 def publish(app_id, application_publish_object, custom_headers:nil) response = publish_async(app_id, application_publish_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Publishes a specific version of the application.
@param app_id The application ID. @param application_publish_object [ApplicationPublishObject] The application publish object. The region is the target region that the application is published to. @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/apps.rb, line 1180 def publish_async(app_id, application_publish_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, 'application_publish_object is nil' if application_publish_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::ApplicationPublishObject.mapper() request_content = @client.serialize(request_mapper, application_publish_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/publish' 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}, 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 || status_code == 207 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 = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ProductionOrStagingEndpointInfo.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 # Deserialize Response if status_code == 207 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ProductionOrStagingEndpointInfo.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
Publishes a specific version of the application.
@param app_id The application ID. @param application_publish_object [ApplicationPublishObject] The application publish object. The region is the target region that the application is published to. @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/apps.rb, line 1164 def publish_with_http_info(app_id, application_publish_object, custom_headers:nil) publish_async(app_id, application_publish_object, custom_headers:custom_headers).value! end
Updates the name or description of the application.
@param app_id The application ID. @param application_update_object [ApplicationUpdateObject] A model containing Name and Description of the application. @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/apps.rb, line 950 def update(app_id, application_update_object, custom_headers:nil) response = update_async(app_id, application_update_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the name or description of the application.
@param app_id The application ID. @param application_update_object [ApplicationUpdateObject] A model containing Name and Description of the application. @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/apps.rb, line 981 def update_async(app_id, application_update_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, 'application_update_object is nil' if application_update_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::ApplicationUpdateObject.mapper() request_content = @client.serialize(request_mapper, application_update_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}' 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}, 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 application publish settings including 'UseAllTrainingData'.
@param app_id The application ID. @param publish_setting_update_object [PublishSettingUpdateObject] An object containing the new publish application settings. @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/apps.rb, line 1543 def update_publish_settings(app_id, publish_setting_update_object, custom_headers:nil) response = update_publish_settings_async(app_id, publish_setting_update_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the application publish settings including 'UseAllTrainingData'.
@param app_id The application ID. @param publish_setting_update_object [PublishSettingUpdateObject] An object containing the new publish application settings. @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/apps.rb, line 1574 def update_publish_settings_async(app_id, publish_setting_update_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, 'publish_setting_update_object is nil' if publish_setting_update_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::PublishSettingUpdateObject.mapper() request_content = @client.serialize(request_mapper, publish_setting_update_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/publishsettings' 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}, 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 application publish settings including 'UseAllTrainingData'.
@param app_id The application ID. @param publish_setting_update_object [PublishSettingUpdateObject] An object containing the new publish application settings. @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/apps.rb, line 1559 def update_publish_settings_with_http_info(app_id, publish_setting_update_object, custom_headers:nil) update_publish_settings_async(app_id, publish_setting_update_object, custom_headers:custom_headers).value! end
Updates the application settings including 'UseAllTrainingData'.
@param app_id The application ID. @param application_setting_update_object [ApplicationSettingUpdateObject] An object containing the new application settings. @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/apps.rb, line 1351 def update_settings(app_id, application_setting_update_object, custom_headers:nil) response = update_settings_async(app_id, application_setting_update_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the application settings including 'UseAllTrainingData'.
@param app_id The application ID. @param application_setting_update_object [ApplicationSettingUpdateObject] An object containing the new application settings. @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/apps.rb, line 1382 def update_settings_async(app_id, application_setting_update_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, 'application_setting_update_object is nil' if application_setting_update_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::ApplicationSettingUpdateObject.mapper() request_content = @client.serialize(request_mapper, application_setting_update_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/settings' 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}, 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 application settings including 'UseAllTrainingData'.
@param app_id The application ID. @param application_setting_update_object [ApplicationSettingUpdateObject] An object containing the new application settings. @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/apps.rb, line 1367 def update_settings_with_http_info(app_id, application_setting_update_object, custom_headers:nil) update_settings_async(app_id, application_setting_update_object, custom_headers:custom_headers).value! end
Updates the name or description of the application.
@param app_id The application ID. @param application_update_object [ApplicationUpdateObject] A model containing Name and Description of the application. @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/apps.rb, line 966 def update_with_http_info(app_id, application_update_object, custom_headers:nil) update_async(app_id, application_update_object, custom_headers:custom_headers).value! end