class Azure::CognitiveServices::LuisAuthoring::V2_0::Model

Model

Attributes

client[R]

@return [LuisAuthoringClient] reference to the LuisAuthoringClient

Public Class Methods

new(client) click to toggle source

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

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 17
def initialize(client)
  @client = client
end

Public Instance Methods

add_closed_list(app_id, version_id, closed_list_model_create_object, custom_headers:nil) click to toggle source

Adds a list entity model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param closed_list_model_create_object [ClosedListModelCreateObject] A model containing the name and words for the new list entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1114
def add_closed_list(app_id, version_id, closed_list_model_create_object, custom_headers:nil)
  response = add_closed_list_async(app_id, version_id, closed_list_model_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_closed_list_async(app_id, version_id, closed_list_model_create_object, custom_headers:nil) click to toggle source

Adds a list entity model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param closed_list_model_create_object [ClosedListModelCreateObject] A model containing the name and words for the new list entity extractor. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1147
def add_closed_list_async(app_id, version_id, closed_list_model_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'closed_list_model_create_object is nil' if closed_list_model_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ClosedListModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  closed_list_model_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_closed_list_with_http_info(app_id, version_id, closed_list_model_create_object, custom_headers:nil) click to toggle source

Adds a list entity model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param closed_list_model_create_object [ClosedListModelCreateObject] A model containing the name and words for the new list entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1131
def add_closed_list_with_http_info(app_id, version_id, closed_list_model_create_object, custom_headers:nil)
  add_closed_list_async(app_id, version_id, closed_list_model_create_object, custom_headers:custom_headers).value!
end
add_composite_entity(app_id, version_id, composite_model_create_object, custom_headers:nil) click to toggle source

Adds a composite entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param composite_model_create_object [CompositeEntityModel] A model containing the name and children of the new entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 750
def add_composite_entity(app_id, version_id, composite_model_create_object, custom_headers:nil)
  response = add_composite_entity_async(app_id, version_id, composite_model_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_composite_entity_async(app_id, version_id, composite_model_create_object, custom_headers:nil) click to toggle source

Adds a composite entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param composite_model_create_object [CompositeEntityModel] A model containing the name and children of the new entity extractor. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 783
def add_composite_entity_async(app_id, version_id, composite_model_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'composite_model_create_object is nil' if composite_model_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::CompositeEntityModel.mapper()
  request_content = @client.serialize(request_mapper,  composite_model_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_composite_entity_child(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:nil) click to toggle source

Creates a single child in an existing composite entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param composite_child_model_create_object [CompositeChildModelCreateObject] A model object containing the name of the new composite child model. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5531
def add_composite_entity_child(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:nil)
  response = add_composite_entity_child_async(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_composite_entity_child_async(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:nil) click to toggle source

Creates a single child in an existing composite entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param composite_child_model_create_object [CompositeChildModelCreateObject] A model object containing the name of the new composite child model. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5568
def add_composite_entity_child_async(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?
  fail ArgumentError, 'composite_child_model_create_object is nil' if composite_child_model_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::CompositeChildModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  composite_child_model_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children'

  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,'cEntityId' => c_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_composite_entity_child_with_http_info(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:nil) click to toggle source

Creates a single child in an existing composite entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param composite_child_model_create_object [CompositeChildModelCreateObject] A model object containing the name of the new composite child model. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5550
def add_composite_entity_child_with_http_info(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:nil)
  add_composite_entity_child_async(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:custom_headers).value!
end
add_composite_entity_with_http_info(app_id, version_id, composite_model_create_object, custom_headers:nil) click to toggle source

Adds a composite entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param composite_model_create_object [CompositeEntityModel] A model containing the name and children of the new entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 767
def add_composite_entity_with_http_info(app_id, version_id, composite_model_create_object, custom_headers:nil)
  add_composite_entity_async(app_id, version_id, composite_model_create_object, custom_headers:custom_headers).value!
end
add_custom_prebuilt_domain(app_id, version_id, prebuilt_domain_object, custom_headers:nil) click to toggle source

Adds a customizable prebuilt domain along with all of its intent and entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_domain_object [PrebuiltDomainCreateBaseObject] A prebuilt domain create object containing the name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4288
def add_custom_prebuilt_domain(app_id, version_id, prebuilt_domain_object, custom_headers:nil)
  response = add_custom_prebuilt_domain_async(app_id, version_id, prebuilt_domain_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_custom_prebuilt_domain_async(app_id, version_id, prebuilt_domain_object, custom_headers:nil) click to toggle source

Adds a customizable prebuilt domain along with all of its intent and entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_domain_object [PrebuiltDomainCreateBaseObject] A prebuilt domain create object containing the name of the domain. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4323
def add_custom_prebuilt_domain_async(app_id, version_id, prebuilt_domain_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'prebuilt_domain_object is nil' if prebuilt_domain_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PrebuiltDomainCreateBaseObject.mapper()
  request_content = @client.serialize(request_mapper,  prebuilt_domain_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/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]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'UuidElementType',
                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(app_id, version_id, prebuilt_domain_object, custom_headers:nil) click to toggle source

Adds a customizable prebuilt domain along with all of its intent and entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_domain_object [PrebuiltDomainCreateBaseObject] A prebuilt domain create object containing the name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4306
def add_custom_prebuilt_domain_with_http_info(app_id, version_id, prebuilt_domain_object, custom_headers:nil)
  add_custom_prebuilt_domain_async(app_id, version_id, prebuilt_domain_object, custom_headers:custom_headers).value!
end
add_custom_prebuilt_entity(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil) click to toggle source

Adds a prebuilt entity model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_domain_model_create_object [PrebuiltDomainModelCreateObject] A model object containing the name of the prebuilt entity and the name of the domain to which this model belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4642
def add_custom_prebuilt_entity(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil)
  response = add_custom_prebuilt_entity_async(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_custom_prebuilt_entity_async(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil) click to toggle source

Adds a prebuilt entity model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_domain_model_create_object [PrebuiltDomainModelCreateObject] A model object containing the name of the prebuilt entity and the name of the domain to which this model belongs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4677
def add_custom_prebuilt_entity_async(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'prebuilt_domain_model_create_object is nil' if prebuilt_domain_model_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PrebuiltDomainModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  prebuilt_domain_model_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_custom_prebuilt_entity_with_http_info(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil) click to toggle source

Adds a prebuilt entity model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_domain_model_create_object [PrebuiltDomainModelCreateObject] A model object containing the name of the prebuilt entity and the name of the domain to which this model belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4660
def add_custom_prebuilt_entity_with_http_info(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil)
  add_custom_prebuilt_entity_async(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:custom_headers).value!
end
add_custom_prebuilt_intent(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil) click to toggle source

Adds a customizable prebuilt intent model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_domain_model_create_object [PrebuiltDomainModelCreateObject] A model object containing the name of the customizable prebuilt intent and the name of the domain to which this model belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4413
def add_custom_prebuilt_intent(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil)
  response = add_custom_prebuilt_intent_async(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_custom_prebuilt_intent_async(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil) click to toggle source

Adds a customizable prebuilt intent model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_domain_model_create_object [PrebuiltDomainModelCreateObject] A model object containing the name of the customizable prebuilt intent and the name of the domain to which this model belongs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4448
def add_custom_prebuilt_intent_async(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'prebuilt_domain_model_create_object is nil' if prebuilt_domain_model_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PrebuiltDomainModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  prebuilt_domain_model_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_custom_prebuilt_intent_with_http_info(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil) click to toggle source

Adds a customizable prebuilt intent model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_domain_model_create_object [PrebuiltDomainModelCreateObject] A model object containing the name of the customizable prebuilt intent and the name of the domain to which this model belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4431
def add_custom_prebuilt_intent_with_http_info(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:nil)
  add_custom_prebuilt_intent_async(app_id, version_id, prebuilt_domain_model_create_object, custom_headers:custom_headers).value!
end
add_entity(app_id, version_id, model_create_object, custom_headers:nil) click to toggle source

Adds a simple entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param model_create_object [ModelCreateObject] A model object containing the name for the new simple entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 272
def add_entity(app_id, version_id, model_create_object, custom_headers:nil)
  response = add_entity_async(app_id, version_id, model_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_entity_async(app_id, version_id, model_create_object, custom_headers:nil) click to toggle source

Adds a simple entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param model_create_object [ModelCreateObject] A model object containing the name for the new simple entity extractor. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 305
def add_entity_async(app_id, version_id, model_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'model_create_object is nil' if model_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  model_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_entity_with_http_info(app_id, version_id, model_create_object, custom_headers:nil) click to toggle source

Adds a simple entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param model_create_object [ModelCreateObject] A model object containing the name for the new simple entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 289
def add_entity_with_http_info(app_id, version_id, model_create_object, custom_headers:nil)
  add_entity_async(app_id, version_id, model_create_object, custom_headers:custom_headers).value!
end
add_explicit_list_item(app_id, version_id, entity_id, item, custom_headers:nil) click to toggle source

Add a new exception to the explicit list for the Pattern.Any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param item [ExplicitListItemCreateObject] The new explicit list item. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Number] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8206
def add_explicit_list_item(app_id, version_id, entity_id, item, custom_headers:nil)
  response = add_explicit_list_item_async(app_id, version_id, entity_id, item, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_explicit_list_item_async(app_id, version_id, entity_id, item, custom_headers:nil) click to toggle source

Add a new exception to the explicit list for the Pattern.Any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param item [ExplicitListItemCreateObject] The new explicit list item. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8241
def add_explicit_list_item_async(app_id, version_id, entity_id, item, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'item is nil' if item.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ExplicitListItemCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  item)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist'

  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,'entityId' => entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Number'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_explicit_list_item_with_http_info(app_id, version_id, entity_id, item, custom_headers:nil) click to toggle source

Add a new exception to the explicit list for the Pattern.Any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param item [ExplicitListItemCreateObject] The new explicit list item. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8224
def add_explicit_list_item_with_http_info(app_id, version_id, entity_id, item, custom_headers:nil)
  add_explicit_list_item_async(app_id, version_id, entity_id, item, custom_headers:custom_headers).value!
end
add_hierarchical_entity(app_id, version_id, hierarchical_model_create_object, custom_headers:nil) click to toggle source

Adds a hierarchical entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param hierarchical_model_create_object [HierarchicalEntityModel] A model containing the name and children of the new entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 511
def add_hierarchical_entity(app_id, version_id, hierarchical_model_create_object, custom_headers:nil)
  response = add_hierarchical_entity_async(app_id, version_id, hierarchical_model_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_hierarchical_entity_async(app_id, version_id, hierarchical_model_create_object, custom_headers:nil) click to toggle source

Adds a hierarchical entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param hierarchical_model_create_object [HierarchicalEntityModel] A model containing the name and children of the new entity extractor. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 544
def add_hierarchical_entity_async(app_id, version_id, hierarchical_model_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'hierarchical_model_create_object is nil' if hierarchical_model_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::HierarchicalEntityModel.mapper()
  request_content = @client.serialize(request_mapper,  hierarchical_model_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_hierarchical_entity_child(app_id, version_id, h_entity_id, hierarchical_child_model_create_object, custom_headers:nil) click to toggle source

Creates a single child in an existing hierarchical entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param hierarchical_child_model_create_object

HierarchicalChildModelCreateObject

A model object containing the name of

the new hierarchical child model. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5408
def add_hierarchical_entity_child(app_id, version_id, h_entity_id, hierarchical_child_model_create_object, custom_headers:nil)
  response = add_hierarchical_entity_child_async(app_id, version_id, h_entity_id, hierarchical_child_model_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_hierarchical_entity_child_async(app_id, version_id, h_entity_id, hierarchical_child_model_create_object, custom_headers:nil) click to toggle source

Creates a single child in an existing hierarchical entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param hierarchical_child_model_create_object

HierarchicalChildModelCreateObject

A model object containing the name of

the new hierarchical child model. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5447
def add_hierarchical_entity_child_async(app_id, version_id, h_entity_id, hierarchical_child_model_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?
  fail ArgumentError, 'hierarchical_child_model_create_object is nil' if hierarchical_child_model_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::HierarchicalChildModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  hierarchical_child_model_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children'

  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,'hEntityId' => h_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_hierarchical_entity_child_with_http_info(app_id, version_id, h_entity_id, hierarchical_child_model_create_object, custom_headers:nil) click to toggle source

Creates a single child in an existing hierarchical entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param hierarchical_child_model_create_object

HierarchicalChildModelCreateObject

A model object containing the name of

the new hierarchical child model. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5428
def add_hierarchical_entity_child_with_http_info(app_id, version_id, h_entity_id, hierarchical_child_model_create_object, custom_headers:nil)
  add_hierarchical_entity_child_async(app_id, version_id, h_entity_id, hierarchical_child_model_create_object, custom_headers:custom_headers).value!
end
add_hierarchical_entity_with_http_info(app_id, version_id, hierarchical_model_create_object, custom_headers:nil) click to toggle source

Adds a hierarchical entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param hierarchical_model_create_object [HierarchicalEntityModel] A model containing the name and children of the new entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 528
def add_hierarchical_entity_with_http_info(app_id, version_id, hierarchical_model_create_object, custom_headers:nil)
  add_hierarchical_entity_async(app_id, version_id, hierarchical_model_create_object, custom_headers:custom_headers).value!
end
add_intent(app_id, version_id, intent_create_object, custom_headers:nil) click to toggle source

Adds an intent to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_create_object [ModelCreateObject] A model object containing the name of the new intent. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 36
def add_intent(app_id, version_id, intent_create_object, custom_headers:nil)
  response = add_intent_async(app_id, version_id, intent_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_intent_async(app_id, version_id, intent_create_object, custom_headers:nil) click to toggle source

Adds an intent to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_create_object [ModelCreateObject] A model object containing the name of the new intent. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 69
def add_intent_async(app_id, version_id, intent_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'intent_create_object is nil' if intent_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  intent_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_intent_with_http_info(app_id, version_id, intent_create_object, custom_headers:nil) click to toggle source

Adds an intent to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_create_object [ModelCreateObject] A model object containing the name of the new intent. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 53
def add_intent_with_http_info(app_id, version_id, intent_create_object, custom_headers:nil)
  add_intent_async(app_id, version_id, intent_create_object, custom_headers:custom_headers).value!
end
add_prebuilt(app_id, version_id, prebuilt_extractor_names, custom_headers:nil) click to toggle source

Adds a list of prebuilt entities to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_extractor_names [Array<String>] An array of prebuilt entity extractor names. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1228
def add_prebuilt(app_id, version_id, prebuilt_extractor_names, custom_headers:nil)
  response = add_prebuilt_async(app_id, version_id, prebuilt_extractor_names, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_prebuilt_async(app_id, version_id, prebuilt_extractor_names, custom_headers:nil) click to toggle source

Adds a list of prebuilt entities to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_extractor_names [Array<String>] An array of prebuilt entity extractor names. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1261
def add_prebuilt_async(app_id, version_id, prebuilt_extractor_names, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'prebuilt_extractor_names is nil' if prebuilt_extractor_names.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = {
    client_side_validation: true,
    required: true,
    serialized_name: 'prebuiltExtractorNames',
    type: {
      name: 'Sequence',
      element: {
          client_side_validation: true,
          required: false,
          serialized_name: 'StringElementType',
          type: {
            name: 'String'
          }
      }
    }
  }
  request_content = @client.serialize(request_mapper,  prebuilt_extractor_names)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PrebuiltEntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'PrebuiltEntityExtractor'
                }
            }
          }
        }
        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_prebuilt_with_http_info(app_id, version_id, prebuilt_extractor_names, custom_headers:nil) click to toggle source

Adds a list of prebuilt entities to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_extractor_names [Array<String>] An array of prebuilt entity extractor names. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1245
def add_prebuilt_with_http_info(app_id, version_id, prebuilt_extractor_names, custom_headers:nil)
  add_prebuilt_async(app_id, version_id, prebuilt_extractor_names, custom_headers:custom_headers).value!
end
add_sub_list(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:nil) click to toggle source

Adds a sublist to an existing list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity extractor ID. @param word_list_create_object [WordListObject] Words list. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Bignum] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4172
def add_sub_list(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:nil)
  response = add_sub_list_async(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_sub_list_async(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:nil) click to toggle source

Adds a sublist to an existing list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity extractor ID. @param word_list_create_object [WordListObject] Words list. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4205
def add_sub_list_async(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'cl_entity_id is nil' if cl_entity_id.nil?
  fail ArgumentError, 'word_list_create_object is nil' if word_list_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::WordListObject.mapper()
  request_content = @client.serialize(request_mapper,  word_list_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists'

  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,'clEntityId' => cl_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Number'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
add_sub_list_with_http_info(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:nil) click to toggle source

Adds a sublist to an existing list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity extractor ID. @param word_list_create_object [WordListObject] Words list. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4189
def add_sub_list_with_http_info(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:nil)
  add_sub_list_async(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:custom_headers).value!
end
create_closed_list_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6811
def create_closed_list_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  response = create_closed_list_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_closed_list_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6846
def create_closed_list_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'entity_role_create_object is nil' if entity_role_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles'

  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,'entityId' => entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_closed_list_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6829
def create_closed_list_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  create_closed_list_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end
create_composite_entity_role(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7279
def create_composite_entity_role(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:nil)
  response = create_composite_entity_role_async(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_composite_entity_role_async(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7314
def create_composite_entity_role_async(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?
  fail ArgumentError, 'entity_role_create_object is nil' if entity_role_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles'

  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,'cEntityId' => c_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_composite_entity_role_with_http_info(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7297
def create_composite_entity_role_with_http_info(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:nil)
  create_composite_entity_role_async(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end
create_custom_prebuilt_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7972
def create_custom_prebuilt_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  response = create_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8007
def create_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'entity_role_create_object is nil' if entity_role_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles'

  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,'entityId' => entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_custom_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7990
def create_custom_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  create_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end
create_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create an entity role in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6349
def create_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  response = create_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create an entity role in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6384
def create_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'entity_role_create_object is nil' if entity_role_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}/roles'

  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,'entityId' => entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create an entity role in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6367
def create_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  create_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end
create_hierarchical_entity_role(app_id, version_id, h_entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for an hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7741
def create_hierarchical_entity_role(app_id, version_id, h_entity_id, entity_role_create_object, custom_headers:nil)
  response = create_hierarchical_entity_role_async(app_id, version_id, h_entity_id, entity_role_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_hierarchical_entity_role_async(app_id, version_id, h_entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for an hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7776
def create_hierarchical_entity_role_async(app_id, version_id, h_entity_id, entity_role_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?
  fail ArgumentError, 'entity_role_create_object is nil' if entity_role_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles'

  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,'hEntityId' => h_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for an hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7759
def create_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, entity_role_create_object, custom_headers:nil)
  create_hierarchical_entity_role_async(app_id, version_id, h_entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end
create_pattern_any_entity_model(app_id, version_id, extractor_create_object, custom_headers:nil) click to toggle source

Adds a pattern.any entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param extractor_create_object [PatternAnyModelCreateObject] A model object containing the name and explicit list for the new Pattern.Any entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6119
def create_pattern_any_entity_model(app_id, version_id, extractor_create_object, custom_headers:nil)
  response = create_pattern_any_entity_model_async(app_id, version_id, extractor_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_pattern_any_entity_model_async(app_id, version_id, extractor_create_object, custom_headers:nil) click to toggle source

Adds a pattern.any entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param extractor_create_object [PatternAnyModelCreateObject] A model object containing the name and explicit list for the new Pattern.Any entity extractor. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6154
def create_pattern_any_entity_model_async(app_id, version_id, extractor_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'extractor_create_object is nil' if extractor_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PatternAnyModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  extractor_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_pattern_any_entity_model_with_http_info(app_id, version_id, extractor_create_object, custom_headers:nil) click to toggle source

Adds a pattern.any entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param extractor_create_object [PatternAnyModelCreateObject] A model object containing the name and explicit list for the new Pattern.Any entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6137
def create_pattern_any_entity_model_with_http_info(app_id, version_id, extractor_create_object, custom_headers:nil)
  create_pattern_any_entity_model_async(app_id, version_id, extractor_create_object, custom_headers:custom_headers).value!
end
create_pattern_any_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for an Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7510
def create_pattern_any_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  response = create_pattern_any_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_pattern_any_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for an Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7545
def create_pattern_any_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'entity_role_create_object is nil' if entity_role_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles'

  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,'entityId' => entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_pattern_any_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for an Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7528
def create_pattern_any_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  create_pattern_any_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end
create_prebuilt_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6580
def create_prebuilt_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  response = create_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6615
def create_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'entity_role_create_object is nil' if entity_role_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles'

  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,'entityId' => entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for a prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6598
def create_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  create_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end
create_regex_entity_model(app_id, version_id, regex_entity_extractor_create_obj, custom_headers:nil) click to toggle source

Adds a regular expression entity model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_extractor_create_obj [RegexModelCreateObject] A model object containing the name and regex pattern for the new regular expression entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5877
def create_regex_entity_model(app_id, version_id, regex_entity_extractor_create_obj, custom_headers:nil)
  response = create_regex_entity_model_async(app_id, version_id, regex_entity_extractor_create_obj, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_regex_entity_model_async(app_id, version_id, regex_entity_extractor_create_obj, custom_headers:nil) click to toggle source

Adds a regular expression entity model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_extractor_create_obj [RegexModelCreateObject] A model object containing the name and regex pattern for the new regular expression entity extractor. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5912
def create_regex_entity_model_async(app_id, version_id, regex_entity_extractor_create_obj, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'regex_entity_extractor_create_obj is nil' if regex_entity_extractor_create_obj.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::RegexModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  regex_entity_extractor_create_obj)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_regex_entity_model_with_http_info(app_id, version_id, regex_entity_extractor_create_obj, custom_headers:nil) click to toggle source

Adds a regular expression entity model to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_extractor_create_obj [RegexModelCreateObject] A model object containing the name and regex pattern for the new regular expression entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5895
def create_regex_entity_model_with_http_info(app_id, version_id, regex_entity_extractor_create_obj, custom_headers:nil)
  create_regex_entity_model_async(app_id, version_id, regex_entity_extractor_create_obj, custom_headers:custom_headers).value!
end
create_regex_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for an regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7046
def create_regex_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  response = create_regex_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_regex_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for an regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7083
def create_regex_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'entity_role_create_object is nil' if entity_role_create_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles'

  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,'entityId' => entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'String'
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
create_regex_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil) click to toggle source

Create a role for an regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity model ID. @param entity_role_create_object [EntityRoleCreateObject] An entity role object containing the name of role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7065
def create_regex_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
  create_regex_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end
delete_closed_list(app_id, version_id, cl_entity_id, custom_headers:nil) click to toggle source

Deletes a list entity model from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity model ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3408
def delete_closed_list(app_id, version_id, cl_entity_id, custom_headers:nil)
  response = delete_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:nil) click to toggle source

Deletes a list entity model from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity model ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3439
def delete_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'cl_entity_id is nil' if cl_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'

  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,'clEntityId' => cl_entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_closed_list_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9789
def delete_closed_list_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = delete_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9822
def delete_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_closed_list_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9806
def delete_closed_list_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  delete_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
delete_closed_list_with_http_info(app_id, version_id, cl_entity_id, custom_headers:nil) click to toggle source

Deletes a list entity model from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity model ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3424
def delete_closed_list_with_http_info(app_id, version_id, cl_entity_id, custom_headers:nil)
  delete_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:custom_headers).value!
end
delete_composite_entity(app_id, version_id, c_entity_id, custom_headers:nil) click to toggle source

Deletes a composite entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2989
def delete_composite_entity(app_id, version_id, c_entity_id, custom_headers:nil)
  response = delete_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:nil) click to toggle source

Deletes a composite entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3020
def delete_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'

  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,'cEntityId' => c_entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_composite_entity_child(app_id, version_id, c_entity_id, c_child_id, custom_headers:nil) click to toggle source

Deletes a composite entity extractor child from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param c_child_id The hierarchical entity extractor child ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5650
def delete_composite_entity_child(app_id, version_id, c_entity_id, c_child_id, custom_headers:nil)
  response = delete_composite_entity_child_async(app_id, version_id, c_entity_id, c_child_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_composite_entity_child_async(app_id, version_id, c_entity_id, c_child_id, custom_headers:nil) click to toggle source

Deletes a composite entity extractor child from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param c_child_id The hierarchical entity extractor child ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5683
def delete_composite_entity_child_async(app_id, version_id, c_entity_id, c_child_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?
  fail ArgumentError, 'c_child_id is nil' if c_child_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children/{cChildId}'

  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,'cEntityId' => c_entity_id,'cChildId' => c_child_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_composite_entity_child_with_http_info(app_id, version_id, c_entity_id, c_child_id, custom_headers:nil) click to toggle source

Deletes a composite entity extractor child from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param c_child_id The hierarchical entity extractor child ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5667
def delete_composite_entity_child_with_http_info(app_id, version_id, c_entity_id, c_child_id, custom_headers:nil)
  delete_composite_entity_child_async(app_id, version_id, c_entity_id, c_child_id, custom_headers:custom_headers).value!
end
delete_composite_entity_role(app_id, version_id, c_entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10429
def delete_composite_entity_role(app_id, version_id, c_entity_id, role_id, custom_headers:nil)
  response = delete_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param role_id The entity role Id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10462
def delete_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'

  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,'cEntityId' => c_entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_composite_entity_role_with_http_info(app_id, version_id, c_entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10446
def delete_composite_entity_role_with_http_info(app_id, version_id, c_entity_id, role_id, custom_headers:nil)
  delete_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:custom_headers).value!
end
delete_composite_entity_with_http_info(app_id, version_id, c_entity_id, custom_headers:nil) click to toggle source

Deletes a composite entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3005
def delete_composite_entity_with_http_info(app_id, version_id, c_entity_id, custom_headers:nil)
  delete_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value!
end
delete_custom_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11383
def delete_custom_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = delete_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11416
def delete_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_custom_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11400
def delete_custom_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  delete_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
delete_custom_prebuilt_domain(app_id, version_id, domain_name, custom_headers:nil) click to toggle source

Deletes a prebuilt domain's models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param domain_name [String] Domain name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4978
def delete_custom_prebuilt_domain(app_id, version_id, domain_name, custom_headers:nil)
  response = delete_custom_prebuilt_domain_async(app_id, version_id, domain_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_custom_prebuilt_domain_async(app_id, version_id, domain_name, custom_headers:nil) click to toggle source

Deletes a prebuilt domain's models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param domain_name [String] Domain name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5009
def delete_custom_prebuilt_domain_async(app_id, version_id, domain_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, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'domain_name is nil' if domain_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 = 'apps/{appId}/versions/{versionId}/customprebuiltdomains/{domainName}'

  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,'domainName' => domain_name},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_custom_prebuilt_domain_with_http_info(app_id, version_id, domain_name, custom_headers:nil) click to toggle source

Deletes a prebuilt domain's models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param domain_name [String] Domain name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4994
def delete_custom_prebuilt_domain_with_http_info(app_id, version_id, domain_name, custom_headers:nil)
  delete_custom_prebuilt_domain_async(app_id, version_id, domain_name, custom_headers:custom_headers).value!
end
delete_entity(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Deletes an entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2376
def delete_entity(app_id, version_id, entity_id, custom_headers:nil)
  response = delete_entity_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_entity_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Deletes an entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2407
def delete_entity_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}'

  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,'entityId' => entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete an entity role in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9155
def delete_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = delete_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete an entity role in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9188
def delete_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete an entity role in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9172
def delete_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  delete_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
delete_entity_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Deletes an entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2392
def delete_entity_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  delete_entity_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
delete_explicit_list_item(app_id, version_id, entity_id, item_id, custom_headers:nil) click to toggle source

Delete an item from the explicit (exception) list for a Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The pattern.any entity id. @param item_id [Integer] The explicit list item which will be deleted. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11704
def delete_explicit_list_item(app_id, version_id, entity_id, item_id, custom_headers:nil)
  response = delete_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:nil) click to toggle source

Delete an item from the explicit (exception) list for a Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The pattern.any entity id. @param item_id [Integer] The explicit list item which will be deleted. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11739
def delete_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'item_id is nil' if item_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'

  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,'entityId' => entity_id,'itemId' => item_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, custom_headers:nil) click to toggle source

Delete an item from the explicit (exception) list for a Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The pattern.any entity id. @param item_id [Integer] The explicit list item which will be deleted. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11722
def delete_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, custom_headers:nil)
  delete_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:custom_headers).value!
end
delete_hierarchical_entity(app_id, version_id, h_entity_id, custom_headers:nil) click to toggle source

Deletes a hierarchical entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2684
def delete_hierarchical_entity(app_id, version_id, h_entity_id, custom_headers:nil)
  response = delete_hierarchical_entity_async(app_id, version_id, h_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_hierarchical_entity_async(app_id, version_id, h_entity_id, custom_headers:nil) click to toggle source

Deletes a hierarchical entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2715
def delete_hierarchical_entity_async(app_id, version_id, h_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'

  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,'hEntityId' => h_entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil) click to toggle source

Deletes a hierarchical entity extractor child in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5302
def delete_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil)
  response = delete_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil) click to toggle source

Deletes a hierarchical entity extractor child in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5337
def delete_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?
  fail ArgumentError, 'h_child_id is nil' if h_child_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'

  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,'hEntityId' => h_entity_id,'hChildId' => h_child_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_hierarchical_entity_child_with_http_info(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil) click to toggle source

Deletes a hierarchical entity extractor child in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5320
def delete_hierarchical_entity_child_with_http_info(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil)
  delete_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:custom_headers).value!
end
delete_hierarchical_entity_role(app_id, version_id, h_entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given hierarchical role in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11066
def delete_hierarchical_entity_role(app_id, version_id, h_entity_id, role_id, custom_headers:nil)
  response = delete_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given hierarchical role in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param role_id The entity role Id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11099
def delete_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'

  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,'hEntityId' => h_entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given hierarchical role in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11083
def delete_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, role_id, custom_headers:nil)
  delete_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:custom_headers).value!
end
delete_hierarchical_entity_with_http_info(app_id, version_id, h_entity_id, custom_headers:nil) click to toggle source

Deletes a hierarchical entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2700
def delete_hierarchical_entity_with_http_info(app_id, version_id, h_entity_id, custom_headers:nil)
  delete_hierarchical_entity_async(app_id, version_id, h_entity_id, custom_headers:custom_headers).value!
end
delete_intent(app_id, version_id, intent_id, delete_utterances:false, custom_headers:nil) click to toggle source

Deletes an intent from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @param delete_utterances [Boolean] If true, deletes the intent's example utterances. If false, moves the example utterances to the None intent. The default value is false. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2064
def delete_intent(app_id, version_id, intent_id, delete_utterances:false, custom_headers:nil)
  response = delete_intent_async(app_id, version_id, intent_id, delete_utterances:delete_utterances, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_intent_async(app_id, version_id, intent_id, delete_utterances:false, custom_headers:nil) click to toggle source

Deletes an intent from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @param delete_utterances [Boolean] If true, deletes the intent's example utterances. If false, moves the example utterances to the None intent. The default value is false. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2101
def delete_intent_async(app_id, version_id, intent_id, delete_utterances:false, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'intent_id is nil' if intent_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/intents/{intentId}'

  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,'intentId' => intent_id},
      query_params: {'deleteUtterances' => delete_utterances},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_intent_with_http_info(app_id, version_id, intent_id, delete_utterances:false, custom_headers:nil) click to toggle source

Deletes an intent from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @param delete_utterances [Boolean] If true, deletes the intent's example utterances. If false, moves the example utterances to the None intent. The default value is false. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2083
def delete_intent_with_http_info(app_id, version_id, intent_id, delete_utterances:false, custom_headers:nil)
  delete_intent_async(app_id, version_id, intent_id, delete_utterances:delete_utterances, custom_headers:custom_headers).value!
end
delete_pattern_any_entity_model(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Deletes a Pattern.Any entity extractor from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8841
def delete_pattern_any_entity_model(app_id, version_id, entity_id, custom_headers:nil)
  response = delete_pattern_any_entity_model_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_pattern_any_entity_model_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Deletes a Pattern.Any entity extractor from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8872
def delete_pattern_any_entity_model_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'

  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,'entityId' => entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_pattern_any_entity_model_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Deletes a Pattern.Any entity extractor from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8857
def delete_pattern_any_entity_model_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  delete_pattern_any_entity_model_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
delete_pattern_any_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10746
def delete_pattern_any_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = delete_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10779
def delete_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_pattern_any_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10763
def delete_pattern_any_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  delete_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
delete_prebuilt(app_id, version_id, prebuilt_id, custom_headers:nil) click to toggle source

Deletes a prebuilt entity extractor from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_id The prebuilt entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3605
def delete_prebuilt(app_id, version_id, prebuilt_id, custom_headers:nil)
  response = delete_prebuilt_async(app_id, version_id, prebuilt_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_prebuilt_async(app_id, version_id, prebuilt_id, custom_headers:nil) click to toggle source

Deletes a prebuilt entity extractor from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_id The prebuilt entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3636
def delete_prebuilt_async(app_id, version_id, prebuilt_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'prebuilt_id is nil' if prebuilt_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}'

  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,'prebuiltId' => prebuilt_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_prebuilt_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role in a prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9472
def delete_prebuilt_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = delete_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role in a prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9505
def delete_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role in a prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9489
def delete_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  delete_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
delete_prebuilt_with_http_info(app_id, version_id, prebuilt_id, custom_headers:nil) click to toggle source

Deletes a prebuilt entity extractor from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_id The prebuilt entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3621
def delete_prebuilt_with_http_info(app_id, version_id, prebuilt_id, custom_headers:nil)
  delete_prebuilt_async(app_id, version_id, prebuilt_id, custom_headers:custom_headers).value!
end
delete_regex_entity_model(app_id, version_id, regex_entity_id, custom_headers:nil) click to toggle source

Deletes a regular expression entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_id The regular expression entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8533
def delete_regex_entity_model(app_id, version_id, regex_entity_id, custom_headers:nil)
  response = delete_regex_entity_model_async(app_id, version_id, regex_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_regex_entity_model_async(app_id, version_id, regex_entity_id, custom_headers:nil) click to toggle source

Deletes a regular expression entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_id The regular expression entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8564
def delete_regex_entity_model_async(app_id, version_id, regex_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'regex_entity_id is nil' if regex_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'

  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,'regexEntityId' => regex_entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_regex_entity_model_with_http_info(app_id, version_id, regex_entity_id, custom_headers:nil) click to toggle source

Deletes a regular expression entity from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_id The regular expression entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8549
def delete_regex_entity_model_with_http_info(app_id, version_id, regex_entity_id, custom_headers:nil)
  delete_regex_entity_model_async(app_id, version_id, regex_entity_id, custom_headers:custom_headers).value!
end
delete_regex_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given regular expression in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10112
def delete_regex_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = delete_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given regular expression in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10145
def delete_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_regex_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Delete a role for a given regular expression in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10129
def delete_regex_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  delete_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
delete_sub_list(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:nil) click to toggle source

Deletes a sublist of a specific list entity model from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity extractor ID. @param sub_list_id [Integer] The sublist ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3704
def delete_sub_list(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:nil)
  response = delete_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:nil) click to toggle source

Deletes a sublist of a specific list entity model from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity extractor ID. @param sub_list_id [Integer] The sublist ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3739
def delete_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'cl_entity_id is nil' if cl_entity_id.nil?
  fail ArgumentError, 'sub_list_id is nil' if sub_list_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}'

  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,'clEntityId' => cl_entity_id,'subListId' => sub_list_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_sub_list_with_http_info(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:nil) click to toggle source

Deletes a sublist of a specific list entity model from a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity extractor ID. @param sub_list_id [Integer] The sublist ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3722
def delete_sub_list_with_http_info(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:nil)
  delete_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:custom_headers).value!
end
examples_method(app_id, version_id, model_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets the example utterances for the given intent or entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param model_id [String] The ID (GUID) of the model. @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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1728
def examples_method(app_id, version_id, model_id, skip:0, take:100, custom_headers:nil)
  response = examples_method_async(app_id, version_id, model_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
examples_method_async(app_id, version_id, model_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets the example utterances for the given intent or entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param model_id [String] The ID (GUID) of the model. @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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1767
def examples_method_async(app_id, version_id, model_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'model_id is nil' if model_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/models/{modelId}/examples'

  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,'modelId' => model_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'LabelTextObjectElementType',
                type: {
                  name: 'Composite',
                  class_name: 'LabelTextObject'
                }
            }
          }
        }
        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
examples_method_with_http_info(app_id, version_id, model_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets the example utterances for the given intent or entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param model_id [String] The ID (GUID) of the model. @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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1748
def examples_method_with_http_info(app_id, version_id, model_id, skip:0, take:100, custom_headers:nil)
  examples_method_async(app_id, version_id, model_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
get_closed_list(app_id, version_id, cl_entity_id, custom_headers:nil) click to toggle source

Gets information about a list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list model ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ClosedListEntityExtractor] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3086
def get_closed_list(app_id, version_id, cl_entity_id, custom_headers:nil)
  response = get_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:nil) click to toggle source

Gets information about a list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list model ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3117
def get_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'cl_entity_id is nil' if cl_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'

  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,'clEntityId' => cl_entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ClosedListEntityExtractor.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_closed_list_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [EntityRole] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9573
def get_closed_list_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = get_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9606
def get_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRole.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_closed_list_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9590
def get_closed_list_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  get_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
get_closed_list_with_http_info(app_id, version_id, cl_entity_id, custom_headers:nil) click to toggle source

Gets information about a list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list model ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3102
def get_closed_list_with_http_info(app_id, version_id, cl_entity_id, custom_headers:nil)
  get_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:custom_headers).value!
end
get_composite_entity(app_id, version_id, c_entity_id, custom_headers:nil) click to toggle source

Gets information about a composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [CompositeEntityExtractor] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2781
def get_composite_entity(app_id, version_id, c_entity_id, custom_headers:nil)
  response = get_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:nil) click to toggle source

Gets information about a composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2812
def get_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'

  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,'cEntityId' => c_entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::CompositeEntityExtractor.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_composite_entity_role(app_id, version_id, c_entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given composite entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [EntityRole] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10213
def get_composite_entity_role(app_id, version_id, c_entity_id, role_id, custom_headers:nil)
  response = get_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given composite entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param role_id entity role ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10246
def get_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'

  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,'cEntityId' => c_entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRole.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_composite_entity_role_with_http_info(app_id, version_id, c_entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given composite entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10230
def get_composite_entity_role_with_http_info(app_id, version_id, c_entity_id, role_id, custom_headers:nil)
  get_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:custom_headers).value!
end
get_composite_entity_with_http_info(app_id, version_id, c_entity_id, custom_headers:nil) click to toggle source

Gets information about a composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2797
def get_composite_entity_with_http_info(app_id, version_id, c_entity_id, custom_headers:nil)
  get_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value!
end
get_custom_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [EntityRole] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11167
def get_custom_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = get_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11200
def get_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRole.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_custom_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11184
def get_custom_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  get_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
get_entity(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Gets information about an entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [EntityExtractor] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2168
def get_entity(app_id, version_id, entity_id, custom_headers:nil)
  response = get_entity_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_entity_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Gets information about an entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2199
def get_entity_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}'

  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,'entityId' => entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityExtractor.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_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [EntityRole] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8939
def get_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = get_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8972
def get_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRole.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_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8956
def get_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  get_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
get_entity_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Gets information about an entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2184
def get_entity_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  get_entity_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
get_explicit_list(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get the explicit (exception) list of the pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8089
def get_explicit_list(app_id, version_id, entity_id, custom_headers:nil)
  response = get_explicit_list_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_explicit_list_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get the explicit (exception) list of the pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8122
def get_explicit_list_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist'

  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,'entityId' => entity_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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ExplicitListItemElementType',
                type: {
                  name: 'Composite',
                  class_name: 'ExplicitListItem'
                }
            }
          }
        }
        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_explicit_list_item(app_id, version_id, entity_id, item_id, custom_headers:nil) click to toggle source

Get the explicit (exception) list of the pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity Id. @param item_id [Integer] The explicit list item Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ExplicitListItem] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11485
def get_explicit_list_item(app_id, version_id, entity_id, item_id, custom_headers:nil)
  response = get_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:nil) click to toggle source

Get the explicit (exception) list of the pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity Id. @param item_id [Integer] The explicit list item Id. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11520
def get_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'item_id is nil' if item_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'

  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,'entityId' => entity_id,'itemId' => item_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ExplicitListItem.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_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, custom_headers:nil) click to toggle source

Get the explicit (exception) list of the pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity Id. @param item_id [Integer] The explicit list item Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11503
def get_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, custom_headers:nil)
  get_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:custom_headers).value!
end
get_explicit_list_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get the explicit (exception) list of the pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8106
def get_explicit_list_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  get_explicit_list_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
get_hierarchical_entity(app_id, version_id, h_entity_id, custom_headers:nil) click to toggle source

Gets information about a hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [HierarchicalEntityExtractor] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2473
def get_hierarchical_entity(app_id, version_id, h_entity_id, custom_headers:nil)
  response = get_hierarchical_entity_async(app_id, version_id, h_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_hierarchical_entity_async(app_id, version_id, h_entity_id, custom_headers:nil) click to toggle source

Gets information about a hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2504
def get_hierarchical_entity_async(app_id, version_id, h_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'

  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,'hEntityId' => h_entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::HierarchicalEntityExtractor.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_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil) click to toggle source

Gets information about the child's model contained in an hierarchical entity child model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [HierarchicalChildEntity] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5077
def get_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil)
  response = get_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil) click to toggle source

Gets information about the child's model contained in an hierarchical entity child model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5112
def get_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?
  fail ArgumentError, 'h_child_id is nil' if h_child_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'

  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,'hEntityId' => h_entity_id,'hChildId' => h_child_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::HierarchicalChildEntity.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_hierarchical_entity_child_with_http_info(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil) click to toggle source

Gets information about the child's model contained in an hierarchical entity child model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5095
def get_hierarchical_entity_child_with_http_info(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil)
  get_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:custom_headers).value!
end
get_hierarchical_entity_role(app_id, version_id, h_entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [EntityRole] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10847
def get_hierarchical_entity_role(app_id, version_id, h_entity_id, role_id, custom_headers:nil)
  response = get_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param role_id entity role ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10880
def get_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'

  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,'hEntityId' => h_entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRole.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_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10864
def get_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, role_id, custom_headers:nil)
  get_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:custom_headers).value!
end
get_hierarchical_entity_with_http_info(app_id, version_id, h_entity_id, custom_headers:nil) click to toggle source

Gets information about a hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2489
def get_hierarchical_entity_with_http_info(app_id, version_id, h_entity_id, custom_headers:nil)
  get_hierarchical_entity_async(app_id, version_id, h_entity_id, custom_headers:custom_headers).value!
end
get_intent(app_id, version_id, intent_id, custom_headers:nil) click to toggle source

Gets information about the intent model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [IntentClassifier] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1853
def get_intent(app_id, version_id, intent_id, custom_headers:nil)
  response = get_intent_async(app_id, version_id, intent_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_intent_async(app_id, version_id, intent_id, custom_headers:nil) click to toggle source

Gets information about the intent model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1884
def get_intent_async(app_id, version_id, intent_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'intent_id is nil' if intent_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/intents/{intentId}'

  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,'intentId' => intent_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::IntentClassifier.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_intent_with_http_info(app_id, version_id, intent_id, custom_headers:nil) click to toggle source

Gets information about the intent model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1869
def get_intent_with_http_info(app_id, version_id, intent_id, custom_headers:nil)
  get_intent_async(app_id, version_id, intent_id, custom_headers:custom_headers).value!
end
get_pattern_any_entity_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Gets information about the Pattern.Any model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [PatternAnyEntityExtractor] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8630
def get_pattern_any_entity_info(app_id, version_id, entity_id, custom_headers:nil)
  response = get_pattern_any_entity_info_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_pattern_any_entity_info_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Gets information about the Pattern.Any model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8661
def get_pattern_any_entity_info_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'

  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,'entityId' => entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PatternAnyEntityExtractor.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_pattern_any_entity_info_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Gets information about the Pattern.Any model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8646
def get_pattern_any_entity_info_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  get_pattern_any_entity_info_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
get_pattern_any_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [EntityRole] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10530
def get_pattern_any_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = get_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10563
def get_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRole.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_pattern_any_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10547
def get_pattern_any_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  get_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
get_prebuilt(app_id, version_id, prebuilt_id, custom_headers:nil) click to toggle source

Gets information about a prebuilt entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_id The prebuilt entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [PrebuiltEntityExtractor] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3506
def get_prebuilt(app_id, version_id, prebuilt_id, custom_headers:nil)
  response = get_prebuilt_async(app_id, version_id, prebuilt_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_prebuilt_async(app_id, version_id, prebuilt_id, custom_headers:nil) click to toggle source

Gets information about a prebuilt entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_id The prebuilt entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3539
def get_prebuilt_async(app_id, version_id, prebuilt_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'prebuilt_id is nil' if prebuilt_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}'

  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,'prebuiltId' => prebuilt_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PrebuiltEntityExtractor.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_prebuilt_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given prebuilt entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [EntityRole] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9256
def get_prebuilt_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = get_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given prebuilt entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9289
def get_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRole.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_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given prebuilt entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9273
def get_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  get_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
get_prebuilt_with_http_info(app_id, version_id, prebuilt_id, custom_headers:nil) click to toggle source

Gets information about a prebuilt entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param prebuilt_id The prebuilt entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3523
def get_prebuilt_with_http_info(app_id, version_id, prebuilt_id, custom_headers:nil)
  get_prebuilt_async(app_id, version_id, prebuilt_id, custom_headers:custom_headers).value!
end
get_regex_entity_entity_info(app_id, version_id, regex_entity_id, custom_headers:nil) click to toggle source

Gets information about a regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_id The regular expression entity model ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [RegexEntityExtractor] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8323
def get_regex_entity_entity_info(app_id, version_id, regex_entity_id, custom_headers:nil)
  response = get_regex_entity_entity_info_async(app_id, version_id, regex_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_regex_entity_entity_info_async(app_id, version_id, regex_entity_id, custom_headers:nil) click to toggle source

Gets information about a regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_id The regular expression entity model ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8356
def get_regex_entity_entity_info_async(app_id, version_id, regex_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'regex_entity_id is nil' if regex_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'

  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,'regexEntityId' => regex_entity_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::RegexEntityExtractor.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_regex_entity_entity_info_with_http_info(app_id, version_id, regex_entity_id, custom_headers:nil) click to toggle source

Gets information about a regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_id The regular expression entity model ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8340
def get_regex_entity_entity_info_with_http_info(app_id, version_id, regex_entity_id, custom_headers:nil)
  get_regex_entity_entity_info_async(app_id, version_id, regex_entity_id, custom_headers:custom_headers).value!
end
get_regex_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [EntityRole] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9891
def get_regex_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
  response = get_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9926
def get_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRole.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_regex_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil) click to toggle source

Get one role for a given regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity ID. @param role_id entity role ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9909
def get_regex_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
  get_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end
list_closed_list_entity_roles(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6696
def list_closed_list_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
  response = list_closed_list_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_closed_list_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6727
def list_closed_list_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles'

  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,'entityId' => entity_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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityRoleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityRole'
                }
            }
          }
        }
        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_closed_list_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6712
def list_closed_list_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  list_closed_list_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
list_closed_lists(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the list entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 991
def list_closed_lists(app_id, version_id, skip:0, take:100, custom_headers:nil)
  response = list_closed_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_closed_lists_async(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the list entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1028
def list_closed_lists_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/closedlists'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ClosedListEntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'ClosedListEntityExtractor'
                }
            }
          }
        }
        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_closed_lists_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the list entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1010
def list_closed_lists_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
  list_closed_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
list_composite_entities(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the composite entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 866
def list_composite_entities(app_id, version_id, skip:0, take:100, custom_headers:nil)
  response = list_composite_entities_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_composite_entities_async(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the composite entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 903
def list_composite_entities_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/compositeentities'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'CompositeEntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'CompositeEntityExtractor'
                }
            }
          }
        }
        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_composite_entities_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the composite entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 885
def list_composite_entities_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
  list_composite_entities_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
list_composite_entity_roles(app_id, version_id, c_entity_id, custom_headers:nil) click to toggle source

Get all roles for a composite entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7164
def list_composite_entity_roles(app_id, version_id, c_entity_id, custom_headers:nil)
  response = list_composite_entity_roles_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_composite_entity_roles_async(app_id, version_id, c_entity_id, custom_headers:nil) click to toggle source

Get all roles for a composite entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7195
def list_composite_entity_roles_async(app_id, version_id, c_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles'

  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,'cEntityId' => c_entity_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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityRoleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityRole'
                }
            }
          }
        }
        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_composite_entity_roles_with_http_info(app_id, version_id, c_entity_id, custom_headers:nil) click to toggle source

Get all roles for a composite entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7180
def list_composite_entity_roles_with_http_info(app_id, version_id, c_entity_id, custom_headers:nil)
  list_composite_entity_roles_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value!
end
list_custom_prebuilt_entities(app_id, version_id, custom_headers:nil) click to toggle source

Gets all prebuilt entities used in a version of the application.

@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 [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4756
def list_custom_prebuilt_entities(app_id, version_id, custom_headers:nil)
  response = list_custom_prebuilt_entities_async(app_id, version_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_custom_prebuilt_entities_async(app_id, version_id, custom_headers:nil) click to toggle source

Gets all prebuilt entities used in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4785
def list_custom_prebuilt_entities_async(app_id, version_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/customprebuiltentities'

  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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityExtractor'
                }
            }
          }
        }
        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_custom_prebuilt_entities_with_http_info(app_id, version_id, custom_headers:nil) click to toggle source

Gets all prebuilt entities used in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4771
def list_custom_prebuilt_entities_with_http_info(app_id, version_id, custom_headers:nil)
  list_custom_prebuilt_entities_async(app_id, version_id, custom_headers:custom_headers).value!
end
list_custom_prebuilt_entity_roles(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a prebuilt entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7857
def list_custom_prebuilt_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
  response = list_custom_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_custom_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a prebuilt entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7888
def list_custom_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles'

  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,'entityId' => entity_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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityRoleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityRole'
                }
            }
          }
        }
        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_custom_prebuilt_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a prebuilt entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7873
def list_custom_prebuilt_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  list_custom_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
list_custom_prebuilt_intents(app_id, version_id, custom_headers:nil) click to toggle source

Gets information about customizable prebuilt intents added to a version of the application.

@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 [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4528
def list_custom_prebuilt_intents(app_id, version_id, custom_headers:nil)
  response = list_custom_prebuilt_intents_async(app_id, version_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_custom_prebuilt_intents_async(app_id, version_id, custom_headers:nil) click to toggle source

Gets information about customizable prebuilt intents added to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4559
def list_custom_prebuilt_intents_async(app_id, version_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/customprebuiltintents'

  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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'IntentClassifierElementType',
                type: {
                  name: 'Composite',
                  class_name: 'IntentClassifier'
                }
            }
          }
        }
        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_custom_prebuilt_intents_with_http_info(app_id, version_id, custom_headers:nil) click to toggle source

Gets information about customizable prebuilt intents added to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4544
def list_custom_prebuilt_intents_with_http_info(app_id, version_id, custom_headers:nil)
  list_custom_prebuilt_intents_async(app_id, version_id, custom_headers:custom_headers).value!
end
list_custom_prebuilt_models(app_id, version_id, custom_headers:nil) click to toggle source

Gets all prebuilt intent and entity model information used in a version of this application.

@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 [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4866
def list_custom_prebuilt_models(app_id, version_id, custom_headers:nil)
  response = list_custom_prebuilt_models_async(app_id, version_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_custom_prebuilt_models_async(app_id, version_id, custom_headers:nil) click to toggle source

Gets all prebuilt intent and entity model information used in a version of this application.

@param app_id The application ID. @param version_id [String] The version ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4897
def list_custom_prebuilt_models_async(app_id, version_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/customprebuiltmodels'

  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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'CustomPrebuiltModelElementType',
                type: {
                  name: 'Composite',
                  class_name: 'CustomPrebuiltModel'
                }
            }
          }
        }
        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_custom_prebuilt_models_with_http_info(app_id, version_id, custom_headers:nil) click to toggle source

Gets all prebuilt intent and entity model information used in a version of this application.

@param app_id The application ID. @param version_id [String] The version ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4882
def list_custom_prebuilt_models_with_http_info(app_id, version_id, custom_headers:nil)
  list_custom_prebuilt_models_async(app_id, version_id, custom_headers:custom_headers).value!
end
list_entities(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the simple entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 388
def list_entities(app_id, version_id, skip:0, take:100, custom_headers:nil)
  response = list_entities_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_entities_async(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the simple entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 425
def list_entities_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/entities'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityExtractor'
                }
            }
          }
        }
        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_entities_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the simple entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 407
def list_entities_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
  list_entities_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
list_entity_roles(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for an entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6234
def list_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
  response = list_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for an entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6265
def list_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}/roles'

  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,'entityId' => entity_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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityRoleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityRole'
                }
            }
          }
        }
        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_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for an entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6250
def list_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  list_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
list_entity_suggestions(app_id, version_id, entity_id, take:100, custom_headers:nil) click to toggle source

Get suggested example utterances that would improve the accuracy of the entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The target entity extractor model to enhance. @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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4049
def list_entity_suggestions(app_id, version_id, entity_id, take:100, custom_headers:nil)
  response = list_entity_suggestions_async(app_id, version_id, entity_id, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_entity_suggestions_async(app_id, version_id, entity_id, take:100, custom_headers:nil) click to toggle source

Get suggested example utterances that would improve the accuracy of the entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The target entity extractor model to enhance. @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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4086
def list_entity_suggestions_async(app_id, version_id, entity_id, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}/suggest'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id,'entityId' => entity_id},
      query_params: {'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: 'EntitiesSuggestionExampleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntitiesSuggestionExample'
                }
            }
          }
        }
        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_entity_suggestions_with_http_info(app_id, version_id, entity_id, take:100, custom_headers:nil) click to toggle source

Get suggested example utterances that would improve the accuracy of the entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The target entity extractor model to enhance. @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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4068
def list_entity_suggestions_with_http_info(app_id, version_id, entity_id, take:100, custom_headers:nil)
  list_entity_suggestions_async(app_id, version_id, entity_id, take:take, custom_headers:custom_headers).value!
end
list_hierarchical_entities(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the hierarchical entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 627
def list_hierarchical_entities(app_id, version_id, skip:0, take:100, custom_headers:nil)
  response = list_hierarchical_entities_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_hierarchical_entities_async(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the hierarchical entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 664
def list_hierarchical_entities_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'HierarchicalEntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'HierarchicalEntityExtractor'
                }
            }
          }
        }
        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_hierarchical_entities_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the hierarchical entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 646
def list_hierarchical_entities_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
  list_hierarchical_entities_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
list_hierarchical_entity_roles(app_id, version_id, h_entity_id, custom_headers:nil) click to toggle source

Get all roles for a hierarchical entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7626
def list_hierarchical_entity_roles(app_id, version_id, h_entity_id, custom_headers:nil)
  response = list_hierarchical_entity_roles_async(app_id, version_id, h_entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_hierarchical_entity_roles_async(app_id, version_id, h_entity_id, custom_headers:nil) click to toggle source

Get all roles for a hierarchical entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7657
def list_hierarchical_entity_roles_async(app_id, version_id, h_entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles'

  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,'hEntityId' => h_entity_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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityRoleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityRole'
                }
            }
          }
        }
        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_hierarchical_entity_roles_with_http_info(app_id, version_id, h_entity_id, custom_headers:nil) click to toggle source

Get all roles for a hierarchical entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7642
def list_hierarchical_entity_roles_with_http_info(app_id, version_id, h_entity_id, custom_headers:nil)
  list_hierarchical_entity_roles_async(app_id, version_id, h_entity_id, custom_headers:custom_headers).value!
end
list_intent_suggestions(app_id, version_id, intent_id, take:100, custom_headers:nil) click to toggle source

Suggests example utterances that would improve the accuracy of the intent model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3924
def list_intent_suggestions(app_id, version_id, intent_id, take:100, custom_headers:nil)
  response = list_intent_suggestions_async(app_id, version_id, intent_id, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_intent_suggestions_async(app_id, version_id, intent_id, take:100, custom_headers:nil) click to toggle source

Suggests example utterances that would improve the accuracy of the intent model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3961
def list_intent_suggestions_async(app_id, version_id, intent_id, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'intent_id is nil' if intent_id.nil?
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/intents/{intentId}/suggest'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id,'intentId' => intent_id},
      query_params: {'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: 'IntentsSuggestionExampleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'IntentsSuggestionExample'
                }
            }
          }
        }
        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_intent_suggestions_with_http_info(app_id, version_id, intent_id, take:100, custom_headers:nil) click to toggle source

Suggests example utterances that would improve the accuracy of the intent model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3943
def list_intent_suggestions_with_http_info(app_id, version_id, intent_id, take:100, custom_headers:nil)
  list_intent_suggestions_async(app_id, version_id, intent_id, take:take, custom_headers:custom_headers).value!
end
list_intents(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about the intent models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 151
def list_intents(app_id, version_id, skip:0, take:100, custom_headers:nil)
  response = list_intents_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_intents_async(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about the intent models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 186
def list_intents_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/intents'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'IntentClassifierElementType',
                type: {
                  name: 'Composite',
                  class_name: 'IntentClassifier'
                }
            }
          }
        }
        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_intents_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about the intent models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 169
def list_intents_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
  list_intents_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
list_models(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the intent and entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1602
def list_models(app_id, version_id, skip:0, take:100, custom_headers:nil)
  response = list_models_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_models_async(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the intent and entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1639
def list_models_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/models'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ModelInfoResponseElementType',
                type: {
                  name: 'Composite',
                  class_name: 'ModelInfoResponse'
                }
            }
          }
        }
        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_models_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the intent and entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1621
def list_models_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
  list_models_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
list_pattern_any_entity_infos(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Get information about the Pattern.Any entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5995
def list_pattern_any_entity_infos(app_id, version_id, skip:0, take:100, custom_headers:nil)
  response = list_pattern_any_entity_infos_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_pattern_any_entity_infos_async(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Get information about the Pattern.Any entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6032
def list_pattern_any_entity_infos_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PatternAnyEntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'PatternAnyEntityExtractor'
                }
            }
          }
        }
        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_pattern_any_entity_infos_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Get information about the Pattern.Any entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6014
def list_pattern_any_entity_infos_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
  list_pattern_any_entity_infos_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
list_pattern_any_entity_roles(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a Pattern.any entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7395
def list_pattern_any_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
  response = list_pattern_any_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_pattern_any_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a Pattern.any entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7426
def list_pattern_any_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles'

  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,'entityId' => entity_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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityRoleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityRole'
                }
            }
          }
        }
        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_pattern_any_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a Pattern.any entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7411
def list_pattern_any_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  list_pattern_any_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
list_prebuilt_entities(app_id, version_id, custom_headers:nil) click to toggle source

Gets all the available prebuilt entities in a version of the application.

@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 [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1489
def list_prebuilt_entities(app_id, version_id, custom_headers:nil)
  response = list_prebuilt_entities_async(app_id, version_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_prebuilt_entities_async(app_id, version_id, custom_headers:nil) click to toggle source

Gets all the available prebuilt entities in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1518
def list_prebuilt_entities_async(app_id, version_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/listprebuilts'

  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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'AvailablePrebuiltEntityModelElementType',
                type: {
                  name: 'Composite',
                  class_name: 'AvailablePrebuiltEntityModel'
                }
            }
          }
        }
        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_prebuilt_entities_with_http_info(app_id, version_id, custom_headers:nil) click to toggle source

Gets all the available prebuilt entities in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1504
def list_prebuilt_entities_with_http_info(app_id, version_id, custom_headers:nil)
  list_prebuilt_entities_async(app_id, version_id, custom_headers:custom_headers).value!
end
list_prebuilt_entity_roles(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get a prebuilt entity's roles in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6465
def list_prebuilt_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
  response = list_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get a prebuilt entity's roles in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6496
def list_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles'

  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,'entityId' => entity_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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityRoleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityRole'
                }
            }
          }
        }
        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_prebuilt_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get a prebuilt entity's roles in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6481
def list_prebuilt_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  list_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
list_prebuilts(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the prebuilt entities in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1368
def list_prebuilts(app_id, version_id, skip:0, take:100, custom_headers:nil)
  response = list_prebuilts_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_prebuilts_async(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the prebuilt entities in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1405
def list_prebuilts_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/prebuilts'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'PrebuiltEntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'PrebuiltEntityExtractor'
                }
            }
          }
        }
        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_prebuilts_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about all the prebuilt entities in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1387
def list_prebuilts_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
  list_prebuilts_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
list_regex_entity_infos(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about the regular expression entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5753
def list_regex_entity_infos(app_id, version_id, skip:0, take:100, custom_headers:nil)
  response = list_regex_entity_infos_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_regex_entity_infos_async(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about the regular expression entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5790
def list_regex_entity_infos_async(app_id, version_id, skip:0, take:100, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMaximum': '500'" if !take.nil? && take > 500
  fail ArgumentError, "'take' should satisfy the constraint - 'InclusiveMinimum': '0'" if !take.nil? && take < 0


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/regexentities'

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

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'appId' => app_id,'versionId' => version_id},
      query_params: {'skip' => skip,'take' => take},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'RegexEntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'RegexEntityExtractor'
                }
            }
          }
        }
        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_regex_entity_infos_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil) click to toggle source

Gets information about the regular expression entity models in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param skip [Integer] The number of entries to skip. Default value is 0. @param take [Integer] The number of entries to return. Maximum page size is

  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/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5772
def list_regex_entity_infos_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
  list_regex_entity_infos_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end
list_regex_entity_roles(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6928
def list_regex_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
  response = list_regex_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_regex_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6961
def list_regex_entity_roles_async(app_id, version_id, entity_id, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles'

  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,'entityId' => entity_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: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'EntityRoleElementType',
                type: {
                  name: 'Composite',
                  class_name: 'EntityRole'
                }
            }
          }
        }
        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_regex_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Get all roles for a regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id entity Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6945
def list_regex_entity_roles_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  list_regex_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
end
patch_closed_list(app_id, version_id, cl_entity_id, closed_list_model_patch_object, custom_headers:nil) click to toggle source

Adds a batch of sublists to an existing list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity model ID. @param closed_list_model_patch_object [ClosedListModelPatchObject] A words list batch. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3297
def patch_closed_list(app_id, version_id, cl_entity_id, closed_list_model_patch_object, custom_headers:nil)
  response = patch_closed_list_async(app_id, version_id, cl_entity_id, closed_list_model_patch_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
patch_closed_list_async(app_id, version_id, cl_entity_id, closed_list_model_patch_object, custom_headers:nil) click to toggle source

Adds a batch of sublists to an existing list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity model ID. @param closed_list_model_patch_object [ClosedListModelPatchObject] A words list batch. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3334
def patch_closed_list_async(app_id, version_id, cl_entity_id, closed_list_model_patch_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'cl_entity_id is nil' if cl_entity_id.nil?
  fail ArgumentError, 'closed_list_model_patch_object is nil' if closed_list_model_patch_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ClosedListModelPatchObject.mapper()
  request_content = @client.serialize(request_mapper,  closed_list_model_patch_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'

  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,'clEntityId' => cl_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
patch_closed_list_with_http_info(app_id, version_id, cl_entity_id, closed_list_model_patch_object, custom_headers:nil) click to toggle source

Adds a batch of sublists to an existing list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity model ID. @param closed_list_model_patch_object [ClosedListModelPatchObject] A words list batch. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3316
def patch_closed_list_with_http_info(app_id, version_id, cl_entity_id, closed_list_model_patch_object, custom_headers:nil)
  patch_closed_list_async(app_id, version_id, cl_entity_id, closed_list_model_patch_object, custom_headers:custom_headers).value!
end
update_closed_list(app_id, version_id, cl_entity_id, closed_list_model_update_object, custom_headers:nil) click to toggle source

Updates the list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list model ID. @param closed_list_model_update_object [ClosedListModelUpdateObject] The new list entity name and words list. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3185
def update_closed_list(app_id, version_id, cl_entity_id, closed_list_model_update_object, custom_headers:nil)
  response = update_closed_list_async(app_id, version_id, cl_entity_id, closed_list_model_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_closed_list_async(app_id, version_id, cl_entity_id, closed_list_model_update_object, custom_headers:nil) click to toggle source

Updates the list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list model ID. @param closed_list_model_update_object [ClosedListModelUpdateObject] The new list entity name and words list. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3220
def update_closed_list_async(app_id, version_id, cl_entity_id, closed_list_model_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'cl_entity_id is nil' if cl_entity_id.nil?
  fail ArgumentError, 'closed_list_model_update_object is nil' if closed_list_model_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ClosedListModelUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  closed_list_model_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'

  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,'clEntityId' => cl_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_closed_list_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9676
def update_closed_list_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  response = update_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9713
def update_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?
  fail ArgumentError, 'entity_role_update_object is nil' if entity_role_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_closed_list_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9695
def update_closed_list_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  update_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end
update_closed_list_with_http_info(app_id, version_id, cl_entity_id, closed_list_model_update_object, custom_headers:nil) click to toggle source

Updates the list entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list model ID. @param closed_list_model_update_object [ClosedListModelUpdateObject] The new list entity name and words list. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3203
def update_closed_list_with_http_info(app_id, version_id, cl_entity_id, closed_list_model_update_object, custom_headers:nil)
  update_closed_list_async(app_id, version_id, cl_entity_id, closed_list_model_update_object, custom_headers:custom_headers).value!
end
update_composite_entity(app_id, version_id, c_entity_id, composite_model_update_object, custom_headers:nil) click to toggle source

Updates a composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param composite_model_update_object [CompositeEntityModel] A model object containing the new entity extractor name and children. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2880
def update_composite_entity(app_id, version_id, c_entity_id, composite_model_update_object, custom_headers:nil)
  response = update_composite_entity_async(app_id, version_id, c_entity_id, composite_model_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_composite_entity_async(app_id, version_id, c_entity_id, composite_model_update_object, custom_headers:nil) click to toggle source

Updates a composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param composite_model_update_object [CompositeEntityModel] A model object containing the new entity extractor name and children. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2915
def update_composite_entity_async(app_id, version_id, c_entity_id, composite_model_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?
  fail ArgumentError, 'composite_model_update_object is nil' if composite_model_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::CompositeEntityModel.mapper()
  request_content = @client.serialize(request_mapper,  composite_model_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'

  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,'cEntityId' => c_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_composite_entity_role(app_id, version_id, c_entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given composite entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10316
def update_composite_entity_role(app_id, version_id, c_entity_id, role_id, entity_role_update_object, custom_headers:nil)
  response = update_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given composite entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10353
def update_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, entity_role_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'c_entity_id is nil' if c_entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?
  fail ArgumentError, 'entity_role_update_object is nil' if entity_role_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'

  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,'cEntityId' => c_entity_id,'roleId' => role_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_composite_entity_role_with_http_info(app_id, version_id, c_entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given composite entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10335
def update_composite_entity_role_with_http_info(app_id, version_id, c_entity_id, role_id, entity_role_update_object, custom_headers:nil)
  update_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end
update_composite_entity_with_http_info(app_id, version_id, c_entity_id, composite_model_update_object, custom_headers:nil) click to toggle source

Updates a composite entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param composite_model_update_object [CompositeEntityModel] A model object containing the new entity extractor name and children. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2898
def update_composite_entity_with_http_info(app_id, version_id, c_entity_id, composite_model_update_object, custom_headers:nil)
  update_composite_entity_async(app_id, version_id, c_entity_id, composite_model_update_object, custom_headers:custom_headers).value!
end
update_custom_prebuilt_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11270
def update_custom_prebuilt_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  response = update_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11307
def update_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?
  fail ArgumentError, 'entity_role_update_object is nil' if entity_role_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_custom_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given prebuilt entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11289
def update_custom_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  update_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end
update_entity(app_id, version_id, entity_id, model_update_object, custom_headers:nil) click to toggle source

Updates the name of an entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param model_update_object [ModelUpdateObject] A model object containing the new entity extractor name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2267
def update_entity(app_id, version_id, entity_id, model_update_object, custom_headers:nil)
  response = update_entity_async(app_id, version_id, entity_id, model_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_entity_async(app_id, version_id, entity_id, model_update_object, custom_headers:nil) click to toggle source

Updates the name of an entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param model_update_object [ModelUpdateObject] A model object containing the new entity extractor name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2302
def update_entity_async(app_id, version_id, entity_id, model_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'model_update_object is nil' if model_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ModelUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  model_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}'

  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,'entityId' => entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9042
def update_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  response = update_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9079
def update_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?
  fail ArgumentError, 'entity_role_update_object is nil' if entity_role_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9061
def update_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  update_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end
update_entity_with_http_info(app_id, version_id, entity_id, model_update_object, custom_headers:nil) click to toggle source

Updates the name of an entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor ID. @param model_update_object [ModelUpdateObject] A model object containing the new entity extractor name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2285
def update_entity_with_http_info(app_id, version_id, entity_id, model_update_object, custom_headers:nil)
  update_entity_async(app_id, version_id, entity_id, model_update_object, custom_headers:custom_headers).value!
end
update_explicit_list_item(app_id, version_id, entity_id, item_id, item, custom_headers:nil) click to toggle source

Updates an explicit (exception) list item for a Pattern.Any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param item_id [Integer] The explicit list item ID. @param item [ExplicitListItemUpdateObject] The new explicit list item. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11590
def update_explicit_list_item(app_id, version_id, entity_id, item_id, item, custom_headers:nil)
  response = update_explicit_list_item_async(app_id, version_id, entity_id, item_id, item, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_explicit_list_item_async(app_id, version_id, entity_id, item_id, item, custom_headers:nil) click to toggle source

Updates an explicit (exception) list item for a Pattern.Any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param item_id [Integer] The explicit list item ID. @param item [ExplicitListItemUpdateObject] The new explicit list item. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11627
def update_explicit_list_item_async(app_id, version_id, entity_id, item_id, item, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'item_id is nil' if item_id.nil?
  fail ArgumentError, 'item is nil' if item.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ExplicitListItemUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  item)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'

  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,'entityId' => entity_id,'itemId' => item_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, item, custom_headers:nil) click to toggle source

Updates an explicit (exception) list item for a Pattern.Any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param item_id [Integer] The explicit list item ID. @param item [ExplicitListItemUpdateObject] The new explicit list item. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11609
def update_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, item, custom_headers:nil)
  update_explicit_list_item_async(app_id, version_id, entity_id, item_id, item, custom_headers:custom_headers).value!
end
update_hierarchical_entity(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:nil) click to toggle source

Updates the name and children of a hierarchical entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param hierarchical_model_update_object [HierarchicalEntityModel] Model containing names of the children of the hierarchical entity. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2573
def update_hierarchical_entity(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:nil)
  response = update_hierarchical_entity_async(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_hierarchical_entity_async(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:nil) click to toggle source

Updates the name and children of a hierarchical entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param hierarchical_model_update_object [HierarchicalEntityModel] Model containing names of the children of the hierarchical entity. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2610
def update_hierarchical_entity_async(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?
  fail ArgumentError, 'hierarchical_model_update_object is nil' if hierarchical_model_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::HierarchicalEntityModel.mapper()
  request_content = @client.serialize(request_mapper,  hierarchical_model_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'

  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,'hEntityId' => h_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:nil) click to toggle source

Renames a single child in an existing hierarchical entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param hierarchical_child_model_update_object

HierarchicalChildModelUpdateObject

Model object containing new name of the

hierarchical entity child. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5184
def update_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:nil)
  response = update_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:nil) click to toggle source

Renames a single child in an existing hierarchical entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param hierarchical_child_model_update_object

HierarchicalChildModelUpdateObject

Model object containing new name of the

hierarchical entity child. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5225
def update_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?
  fail ArgumentError, 'h_child_id is nil' if h_child_id.nil?
  fail ArgumentError, 'hierarchical_child_model_update_object is nil' if hierarchical_child_model_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::HierarchicalChildModelUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  hierarchical_child_model_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'

  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,'hEntityId' => h_entity_id,'hChildId' => h_child_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_hierarchical_entity_child_with_http_info(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:nil) click to toggle source

Renames a single child in an existing hierarchical entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param hierarchical_child_model_update_object

HierarchicalChildModelUpdateObject

Model object containing new name of the

hierarchical entity child. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5205
def update_hierarchical_entity_child_with_http_info(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:nil)
  update_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:custom_headers).value!
end
update_hierarchical_entity_role(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10951
def update_hierarchical_entity_role(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:nil)
  response = update_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10990
def update_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'h_entity_id is nil' if h_entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?
  fail ArgumentError, 'entity_role_update_object is nil' if entity_role_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'

  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,'hEntityId' => h_entity_id,'roleId' => role_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given hierarchical entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10971
def update_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:nil)
  update_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end
update_hierarchical_entity_with_http_info(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:nil) click to toggle source

Updates the name and children of a hierarchical entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param hierarchical_model_update_object [HierarchicalEntityModel] Model containing names of the children of the hierarchical entity. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2592
def update_hierarchical_entity_with_http_info(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:nil)
  update_hierarchical_entity_async(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:custom_headers).value!
end
update_intent(app_id, version_id, intent_id, model_update_object, custom_headers:nil) click to toggle source

Updates the name of an intent in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @param model_update_object [ModelUpdateObject] A model object containing the new intent name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1952
def update_intent(app_id, version_id, intent_id, model_update_object, custom_headers:nil)
  response = update_intent_async(app_id, version_id, intent_id, model_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_intent_async(app_id, version_id, intent_id, model_update_object, custom_headers:nil) click to toggle source

Updates the name of an intent in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @param model_update_object [ModelUpdateObject] A model object containing the new intent name. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1987
def update_intent_async(app_id, version_id, intent_id, model_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'intent_id is nil' if intent_id.nil?
  fail ArgumentError, 'model_update_object is nil' if model_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::ModelUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  model_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/intents/{intentId}'

  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,'intentId' => intent_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_intent_with_http_info(app_id, version_id, intent_id, model_update_object, custom_headers:nil) click to toggle source

Updates the name of an intent in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param intent_id The intent classifier ID. @param model_update_object [ModelUpdateObject] A model object containing the new intent name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1970
def update_intent_with_http_info(app_id, version_id, intent_id, model_update_object, custom_headers:nil)
  update_intent_async(app_id, version_id, intent_id, model_update_object, custom_headers:custom_headers).value!
end
update_pattern_any_entity_model(app_id, version_id, entity_id, pattern_any_update_object, custom_headers:nil) click to toggle source

Updates the name and explicit (exception) list of a Pattern.Any entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param pattern_any_update_object [PatternAnyModelUpdateObject] An object containing the explicit list of the Pattern.Any entity. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8730
def update_pattern_any_entity_model(app_id, version_id, entity_id, pattern_any_update_object, custom_headers:nil)
  response = update_pattern_any_entity_model_async(app_id, version_id, entity_id, pattern_any_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_pattern_any_entity_model_async(app_id, version_id, entity_id, pattern_any_update_object, custom_headers:nil) click to toggle source

Updates the name and explicit (exception) list of a Pattern.Any entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param pattern_any_update_object [PatternAnyModelUpdateObject] An object containing the explicit list of the Pattern.Any entity. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8767
def update_pattern_any_entity_model_async(app_id, version_id, entity_id, pattern_any_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'pattern_any_update_object is nil' if pattern_any_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::PatternAnyModelUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  pattern_any_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'

  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,'entityId' => entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_pattern_any_entity_model_with_http_info(app_id, version_id, entity_id, pattern_any_update_object, custom_headers:nil) click to toggle source

Updates the name and explicit (exception) list of a Pattern.Any entity model in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The Pattern.Any entity extractor ID. @param pattern_any_update_object [PatternAnyModelUpdateObject] An object containing the explicit list of the Pattern.Any entity. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8749
def update_pattern_any_entity_model_with_http_info(app_id, version_id, entity_id, pattern_any_update_object, custom_headers:nil)
  update_pattern_any_entity_model_async(app_id, version_id, entity_id, pattern_any_update_object, custom_headers:custom_headers).value!
end
update_pattern_any_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10633
def update_pattern_any_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  response = update_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10670
def update_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?
  fail ArgumentError, 'entity_role_update_object is nil' if entity_role_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_pattern_any_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given Pattern.any entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10652
def update_pattern_any_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  update_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end
update_prebuilt_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given prebuilt entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9359
def update_prebuilt_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  response = update_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given prebuilt entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9396
def update_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?
  fail ArgumentError, 'entity_role_update_object is nil' if entity_role_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given prebuilt entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9378
def update_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  update_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end
update_regex_entity_model(app_id, version_id, regex_entity_id, regex_entity_update_object, custom_headers:nil) click to toggle source

Updates the regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_id The regular expression entity extractor ID. @param regex_entity_update_object [RegexModelUpdateObject] An object containing the new entity name and regex pattern. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8424
def update_regex_entity_model(app_id, version_id, regex_entity_id, regex_entity_update_object, custom_headers:nil)
  response = update_regex_entity_model_async(app_id, version_id, regex_entity_id, regex_entity_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_regex_entity_model_async(app_id, version_id, regex_entity_id, regex_entity_update_object, custom_headers:nil) click to toggle source

Updates the regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_id The regular expression entity extractor ID. @param regex_entity_update_object [RegexModelUpdateObject] An object containing the new entity name and regex pattern. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8459
def update_regex_entity_model_async(app_id, version_id, regex_entity_id, regex_entity_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'regex_entity_id is nil' if regex_entity_id.nil?
  fail ArgumentError, 'regex_entity_update_object is nil' if regex_entity_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::RegexModelUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  regex_entity_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'

  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,'regexEntityId' => regex_entity_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_regex_entity_model_with_http_info(app_id, version_id, regex_entity_id, regex_entity_update_object, custom_headers:nil) click to toggle source

Updates the regular expression entity in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param regex_entity_id The regular expression entity extractor ID. @param regex_entity_update_object [RegexModelUpdateObject] An object containing the new entity name and regex pattern. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8442
def update_regex_entity_model_with_http_info(app_id, version_id, regex_entity_id, regex_entity_update_object, custom_headers:nil)
  update_regex_entity_model_async(app_id, version_id, regex_entity_id, regex_entity_update_object, custom_headers:custom_headers).value!
end
update_regex_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given regular expression entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9997
def update_regex_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  response = update_regex_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_regex_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given regular expression entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10036
def update_regex_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'role_id is nil' if role_id.nil?
  fail ArgumentError, 'entity_role_update_object is nil' if entity_role_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::EntityRoleUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_role_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'

  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,'entityId' => entity_id,'roleId' => role_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_regex_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) click to toggle source

Update a role for a given regular expression entity in a version of the application

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10017
def update_regex_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
  update_regex_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end
update_sub_list(app_id, version_id, cl_entity_id, sub_list_id, word_list_base_update_object, custom_headers:nil) click to toggle source

Updates one of the list entity's sublists in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity extractor ID. @param sub_list_id [Integer] The sublist ID. @param word_list_base_update_object [WordListBaseUpdateObject] A sublist update object containing the new canonical form and the list of words. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3809
def update_sub_list(app_id, version_id, cl_entity_id, sub_list_id, word_list_base_update_object, custom_headers:nil)
  response = update_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, word_list_base_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, word_list_base_update_object, custom_headers:nil) click to toggle source

Updates one of the list entity's sublists in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity extractor ID. @param sub_list_id [Integer] The sublist ID. @param word_list_base_update_object [WordListBaseUpdateObject] A sublist update object containing the new canonical form and the list of words. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3846
def update_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, word_list_base_update_object, custom_headers:nil)
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
  fail ArgumentError, 'app_id is nil' if app_id.nil?
  fail ArgumentError, 'version_id is nil' if version_id.nil?
  fail ArgumentError, 'cl_entity_id is nil' if cl_entity_id.nil?
  fail ArgumentError, 'sub_list_id is nil' if sub_list_id.nil?
  fail ArgumentError, 'word_list_base_update_object is nil' if word_list_base_update_object.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::WordListBaseUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  word_list_base_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}'

  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,'clEntityId' => cl_entity_id,'subListId' => sub_list_id},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::CognitiveServices::LuisAuthoring::V2_0::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_sub_list_with_http_info(app_id, version_id, cl_entity_id, sub_list_id, word_list_base_update_object, custom_headers:nil) click to toggle source

Updates one of the list entity's sublists in a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param cl_entity_id The list entity extractor ID. @param sub_list_id [Integer] The sublist ID. @param word_list_base_update_object [WordListBaseUpdateObject] A sublist update object containing the new canonical form and the list of words. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# File lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3828
def update_sub_list_with_http_info(app_id, version_id, cl_entity_id, sub_list_id, word_list_base_update_object, custom_headers:nil)
  update_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, word_list_base_update_object, custom_headers:custom_headers).value!
end