def get_version_prediction_async(app_id, version_id, prediction_request, verbose:nil, show_all_intents:nil, log:nil, custom_headers:nil)
      fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
      fail ArgumentError, 'app_id is nil' if app_id.nil?
      fail ArgumentError, 'version_id is nil' if version_id.nil?
      fail ArgumentError, 'prediction_request is nil' if prediction_request.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::LuisRuntime::V3_0_preview::Models::PredictionRequest.mapper()
      request_content = @client.serialize(request_mapper,  prediction_request)
      request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

      path_template = 'apps/{appId}/versions/{versionId}/predict'

      request_url = @base_url || @client.base_url
    request_url = request_url.gsub('{Endpoint}', @client.endpoint)

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'appId' => app_id,'versionId' => version_id},
          query_params: {'verbose' => verbose,'show-all-intents' => show_all_intents,'log' => log},
          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 == 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?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::CognitiveServices::LuisRuntime::V3_0_preview::Models::PredictionResponse.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
def get_version_prediction_async(app_id, version_id, prediction_request, verbose:nil, show_all_intents:nil, log:nil, custom_headers:nil)
      fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
      fail ArgumentError, 'app_id is nil' if app_id.nil?
      fail ArgumentError, 'version_id is nil' if version_id.nil?
      fail ArgumentError, 'prediction_request is nil' if prediction_request.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::LuisRuntime::V3_0_preview::Models::PredictionRequest.mapper()
      request_content = @client.serialize(request_mapper,  prediction_request)
      request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

      path_template = 'apps/{appId}/versions/{versionId}/predict'

      request_url = @base_url || @client.base_url
    request_url = request_url.gsub('{Endpoint}', @client.endpoint)

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'appId' => app_id,'versionId' => version_id},
          query_params: {'verbose' => verbose,'show-all-intents' => show_all_intents,'log' => log},
          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 == 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?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::CognitiveServices::LuisRuntime::V3_0_preview::Models::PredictionResponse.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 predictions for an application version.

 @param app_id The application ID.
 @param version_id [String] The application version ID.
 @param prediction_request [PredictionRequest] The prediction request
 parameters.
 @param verbose [Boolean] Indicates whether to get extra metadata for the
 entities predictions or not.
 @param show_all_intents [Boolean] Indicates whether to return all the intents
 in the response or just the top intent.
 @param log [Boolean] Indicates whether to log the endpoint query or not.
 @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.