class Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Apps

Apps

Attributes

client[R]

@return [LuisAuthoringClient] reference to the LuisAuthoringClient

Private Class Methods

new(client) click to toggle source

Creates and initializes a new instance of the Apps class. @param client service class for accessing basic functionality.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 17
def initialize(client)
  @client = client
end

Private Instance Methods

add(application_create_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
add_async(application_create_object, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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
add_custom_prebuilt_domain(prebuilt_domain_create_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
add_custom_prebuilt_domain_async(prebuilt_domain_create_object, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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
add_custom_prebuilt_domain_with_http_info(prebuilt_domain_create_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
add_with_http_info(application_create_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
delete(app_id, force:false, custom_headers:nil) click to toggle source

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/3.0-preview/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
delete_async(app_id, force:false, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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
delete_with_http_info(app_id, force:false, custom_headers:nil) click to toggle source

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/3.0-preview/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
download_query_logs(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
download_query_logs_async(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
download_query_logs_with_http_info(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
get(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
get_async(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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_publish_settings(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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_publish_settings_async(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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_publish_settings_with_http_info(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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_settings(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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_settings_async(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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_settings_with_http_info(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
get_with_http_info(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
import(luis_app, app_name:nil, custom_headers:nil) click to toggle source

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/3.0-preview/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
import_async(luis_app, app_name:nil, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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
import_lu_format(luis_app_lu, app_name:nil, custom_headers:nil) click to toggle source

Imports an application to LUIS, the application's structure is included in the request body.

@param luis_app_lu [String] 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2401
def import_lu_format(luis_app_lu, app_name:nil, custom_headers:nil)
  response = import_lu_format_async(luis_app_lu, app_name:app_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
import_lu_format_async(luis_app_lu, app_name:nil, custom_headers:nil) click to toggle source

Imports an application to LUIS, the application's structure is included in the request body.

@param luis_app_lu [String] 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2436
def import_lu_format_async(luis_app_lu, app_name:nil, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'luis_app_lu is nil' if luis_app_lu.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'text/plain'

  # 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: 'luisAppLu',
    type: {
      name: 'String'
    }
  }
  request_content = @client.serialize(request_mapper,  luis_app_lu)
  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
import_lu_format_with_http_info(luis_app_lu, app_name:nil, custom_headers:nil) click to toggle source

Imports an application to LUIS, the application's structure is included in the request body.

@param luis_app_lu [String] 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2419
def import_lu_format_with_http_info(luis_app_lu, app_name:nil, custom_headers:nil)
  import_lu_format_async(luis_app_lu, app_name:app_name, custom_headers:custom_headers).value!
end
import_v2app(luis_app_v2, app_name:nil, custom_headers:nil) click to toggle source

Imports an application to LUIS, the application's structure is included in the request body.

@param luis_app_v2 [LuisAppV2] 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2286
def import_v2app(luis_app_v2, app_name:nil, custom_headers:nil)
  response = import_v2app_async(luis_app_v2, app_name:app_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
import_v2app_async(luis_app_v2, app_name:nil, custom_headers:nil) click to toggle source

Imports an application to LUIS, the application's structure is included in the request body.

@param luis_app_v2 [LuisAppV2] 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2321
def import_v2app_async(luis_app_v2, app_name:nil, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'luis_app_v2 is nil' if luis_app_v2.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::V3_0_preview::Models::LuisAppV2.mapper()
  request_content = @client.serialize(request_mapper,  luis_app_v2)
  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
import_v2app_with_http_info(luis_app_v2, app_name:nil, custom_headers:nil) click to toggle source

Imports an application to LUIS, the application's structure is included in the request body.

@param luis_app_v2 [LuisAppV2] 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/apps.rb, line 2304
def import_v2app_with_http_info(luis_app_v2, app_name:nil, custom_headers:nil)
  import_v2app_async(luis_app_v2, app_name:app_name, custom_headers:custom_headers).value!
end
import_with_http_info(luis_app, app_name:nil, custom_headers:nil) click to toggle source

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/3.0-preview/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
list(skip:0, take:100, custom_headers:nil) click to toggle source

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

  1. 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/3.0-preview/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
list_async(skip:0, take:100, custom_headers:nil) click to toggle source

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

  1. 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/3.0-preview/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
list_available_custom_prebuilt_domains(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_available_custom_prebuilt_domains_async(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_available_custom_prebuilt_domains_for_culture(culture, custom_headers:nil) click to toggle source

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/3.0-preview/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
list_available_custom_prebuilt_domains_for_culture_async(culture, custom_headers:nil) click to toggle source

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/3.0-preview/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
list_available_custom_prebuilt_domains_for_culture_with_http_info(culture, custom_headers:nil) click to toggle source

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/3.0-preview/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
list_available_custom_prebuilt_domains_with_http_info(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_cortana_endpoints(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_cortana_endpoints_async(custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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
list_cortana_endpoints_with_http_info(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_domains(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_domains_async(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_domains_with_http_info(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_endpoints(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
list_endpoints_async(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
list_endpoints_with_http_info(app_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
list_supported_cultures(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_supported_cultures_async(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_supported_cultures_with_http_info(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_usage_scenarios(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_usage_scenarios_async(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_usage_scenarios_with_http_info(custom_headers:nil) click to toggle source

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/3.0-preview/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
list_with_http_info(skip:0, take:100, custom_headers:nil) click to toggle source

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

  1. 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/3.0-preview/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_published_application_as_gzip(app_id, slot_name, custom_headers:nil) click to toggle source

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/3.0-preview/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_published_application_as_gzip_async(app_id, slot_name, custom_headers:nil) click to toggle source

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/3.0-preview/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_published_application_as_gzip_with_http_info(app_id, slot_name, custom_headers:nil) click to toggle source

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/3.0-preview/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_trained_application_as_gzip(app_id, version_id, custom_headers:nil) click to toggle source

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/3.0-preview/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_trained_application_as_gzip_async(app_id, version_id, custom_headers:nil) click to toggle source

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/3.0-preview/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_trained_application_as_gzip_with_http_info(app_id, version_id, custom_headers:nil) click to toggle source

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/3.0-preview/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
publish(app_id, application_publish_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
publish_async(app_id, application_publish_object, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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::V3_0_preview::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::V3_0_preview::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
publish_with_http_info(app_id, application_publish_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
update(app_id, application_update_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
update_async(app_id, application_update_object, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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::V3_0_preview::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
update_publish_settings(app_id, publish_setting_update_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
update_publish_settings_async(app_id, publish_setting_update_object, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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::V3_0_preview::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
update_publish_settings_with_http_info(app_id, publish_setting_update_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
update_settings(app_id, application_setting_update_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
update_settings_async(app_id, application_setting_update_object, custom_headers:nil) click to toggle source

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/3.0-preview/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::V3_0_preview::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::V3_0_preview::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
update_settings_with_http_info(app_id, application_setting_update_object, custom_headers:nil) click to toggle source

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/3.0-preview/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
update_with_http_info(app_id, application_update_object, custom_headers:nil) click to toggle source

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/3.0-preview/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