class Azure::CognitiveServices::LuisAuthoring::V2_0::Versions
Attributes
@return [LuisAuthoringClient] reference to the LuisAuthoringClient
Public Class Methods
Creates and initializes a new instance of the Versions
class. @param client service class for accessing basic functionality.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb, line 17 def initialize(client) @client = client end
Public Instance Methods
Creates a new version from the selected version.
@param app_id The application ID. @param version_id [String] The version ID. @param version_clone_object [TaskUpdateObject] A model containing the new version ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [String] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb, line 36 def clone(app_id, version_id, version_clone_object, custom_headers:nil) response = clone_async(app_id, version_id, version_clone_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates a new version from the selected version.
@param app_id The application ID. @param version_id [String] The version ID. @param version_clone_object [TaskUpdateObject] A model containing the new 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/versions.rb, line 69 def clone_async(app_id, version_id, version_clone_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, 'version_clone_object is nil' if version_clone_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::TaskUpdateObject.mapper() request_content = @client.serialize(request_mapper, version_clone_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/{versionId}/clone' 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: '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
Creates a new version from the selected version.
@param app_id The application ID. @param version_id [String] The version ID. @param version_clone_object [TaskUpdateObject] A model containing the new 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/versions.rb, line 53 def clone_with_http_info(app_id, version_id, version_clone_object, custom_headers:nil) clone_async(app_id, version_id, version_clone_object, custom_headers:custom_headers).value! end
Deletes an application version.
@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 [OperationStatus] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb, line 469 def delete(app_id, version_id, custom_headers:nil) response = delete_async(app_id, version_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Deletes an application version.
@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/versions.rb, line 498 def delete_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 = 'apps/{appId}/versions/{versionId}/' 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(: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
Deleted an unlabelled utterance in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param utterance [String] The utterance text to delete. @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/versions.rb, line 770 def delete_unlabelled_utterance(app_id, version_id, utterance, custom_headers:nil) response = delete_unlabelled_utterance_async(app_id, version_id, utterance, custom_headers:custom_headers).value! response.body unless response.nil? end
Deleted an unlabelled utterance in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param utterance [String] The utterance text to delete. @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/versions.rb, line 801 def delete_unlabelled_utterance_async(app_id, version_id, utterance, 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, 'utterance is nil' if utterance.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 = { client_side_validation: true, required: true, serialized_name: 'utterance', type: { name: 'String' } } request_content = @client.serialize(request_mapper, utterance) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/{versionId}/suggest' 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(: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
Deleted an unlabelled utterance in a version of the application.
@param app_id The application ID. @param version_id [String] The version ID. @param utterance [String] The utterance text to delete. @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/versions.rb, line 786 def delete_unlabelled_utterance_with_http_info(app_id, version_id, utterance, custom_headers:nil) delete_unlabelled_utterance_async(app_id, version_id, utterance, custom_headers:custom_headers).value! end
Deletes an application version.
@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/versions.rb, line 484 def delete_with_http_info(app_id, version_id, custom_headers:nil) delete_async(app_id, version_id, custom_headers:custom_headers).value! end
Exports a LUIS application to JSON format.
@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 [LuisApp] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb, line 562 def export(app_id, version_id, custom_headers:nil) response = export_async(app_id, version_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Exports a LUIS application to JSON format.
@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/versions.rb, line 591 def export_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 = 'apps/{appId}/versions/{versionId}/export' 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 = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::LuisApp.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
Exports a LUIS application to JSON format.
@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/versions.rb, line 577 def export_with_http_info(app_id, version_id, custom_headers:nil) export_async(app_id, version_id, custom_headers:custom_headers).value! end
Gets the version information such as date created, last modified date, endpoint URL, count of intents and entities, training and publishing status.
@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 [VersionInfo] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb, line 267 def get(app_id, version_id, custom_headers:nil) response = get_async(app_id, version_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the version information such as date created, last modified date, endpoint URL, count of intents and entities, training and publishing status.
@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/versions.rb, line 298 def get_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 = 'apps/{appId}/versions/{versionId}/' 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 = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::VersionInfo.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 version information such as date created, last modified date, endpoint URL, count of intents and entities, training and publishing status.
@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/versions.rb, line 283 def get_with_http_info(app_id, version_id, custom_headers:nil) get_async(app_id, version_id, custom_headers:custom_headers).value! end
Imports a new version into a LUIS application.
@param app_id The application ID. @param luis_app [LuisApp] A LUIS application structure. @param version_id [String] The new versionId to import. If not specified, the versionId will be read from the imported object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [String] operation results.
# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb, line 657 def import(app_id, luis_app, version_id:nil, custom_headers:nil) response = import_async(app_id, luis_app, version_id:version_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Imports a new version into a LUIS application.
@param app_id The application ID. @param luis_app [LuisApp] A LUIS application structure. @param version_id [String] The new versionId to import. If not specified, the versionId will be read from the imported object. @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/versions.rb, line 690 def import_async(app_id, luis_app, version_id: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, '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/{appId}/versions/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]], path_params: {'appId' => app_id}, query_params: {'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: '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 a new version into a LUIS application.
@param app_id The application ID. @param luis_app [LuisApp] A LUIS application structure. @param version_id [String] The new versionId to import. If not specified, the versionId will be read from the imported object. @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/versions.rb, line 674 def import_with_http_info(app_id, luis_app, version_id:nil, custom_headers:nil) import_async(app_id, luis_app, version_id:version_id, custom_headers:custom_headers).value! end
Gets a list of versions for this application ID.
@param app_id The application 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/versions.rb, line 150 def list(app_id, skip:0, take:100, custom_headers:nil) response = list_async(app_id, skip:skip, take:take, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets a list of versions for this application ID.
@param app_id The application 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/versions.rb, line 183 def list_async(app_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, "'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' 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: {'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: 'VersionInfoElementType', type: { name: 'Composite', class_name: 'VersionInfo' } } } } 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 versions for this application ID.
@param app_id The application 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/versions.rb, line 167 def list_with_http_info(app_id, skip:0, take:100, custom_headers:nil) list_async(app_id, skip:skip, take:take, custom_headers:custom_headers).value! end
Updates the name or description of the application version.
@param app_id The application ID. @param version_id [String] The version ID. @param version_update_object [TaskUpdateObject] 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/versions.rb, line 364 def update(app_id, version_id, version_update_object, custom_headers:nil) response = update_async(app_id, version_id, version_update_object, custom_headers:custom_headers).value! response.body unless response.nil? end
Updates the name or description of the application version.
@param app_id The application ID. @param version_id [String] The version ID. @param version_update_object [TaskUpdateObject] 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/versions.rb, line 397 def update_async(app_id, version_id, version_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, 'version_id is nil' if version_id.nil? fail ArgumentError, 'version_update_object is nil' if version_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::TaskUpdateObject.mapper() request_content = @client.serialize(request_mapper, version_update_object) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'apps/{appId}/versions/{versionId}/' 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(: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 name or description of the application version.
@param app_id The application ID. @param version_id [String] The version ID. @param version_update_object [TaskUpdateObject] 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/versions.rb, line 381 def update_with_http_info(app_id, version_id, version_update_object, custom_headers:nil) update_async(app_id, version_id, version_update_object, custom_headers:custom_headers).value! end