class Azure::CognitiveServices::LuisAuthoring::V3_0_preview::Model

Model

Attributes

client[R]

@return [LuisAuthoringClient] reference to the LuisAuthoringClient

Private Class Methods

new(client) click to toggle source

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

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

Private 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 886
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 919
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 903
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_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6026
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6063
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6045
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_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4786
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4821
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4804
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5140
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5175
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5158
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4911
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4946
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4929
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, entity_model_create_object, custom_headers:nil) click to toggle source

Adds an entity extractor to a version of the application.

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

@return [Uuid] operation results.

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

Adds an entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_model_create_object [EntityModelCreateObject] A model object containing the name of the new entity extractor and its 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 305
def add_entity_async(app_id, version_id, entity_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, 'entity_model_create_object is nil' if entity_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::V3_0_preview::Models::EntityModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_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_child(app_id, version_id, entity_id, child_entity_model_create_object, custom_headers:nil) click to toggle source

Creates a single child in an existing entity model hierarchy 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 child_entity_model_create_object [ChildEntityModelCreateObject] A model object containing the name of the new child model and its children. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Uuid] operation results.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5576
def add_entity_child(app_id, version_id, entity_id, child_entity_model_create_object, custom_headers:nil)
  response = add_entity_child_async(app_id, version_id, entity_id, child_entity_model_create_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
add_entity_child_async(app_id, version_id, entity_id, child_entity_model_create_object, custom_headers:nil) click to toggle source

Creates a single child in an existing entity model hierarchy 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 child_entity_model_create_object [ChildEntityModelCreateObject] A model object containing the name of the new child model and its 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5613
def add_entity_child_async(app_id, version_id, entity_id, child_entity_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, 'entity_id is nil' if entity_id.nil?
  fail ArgumentError, 'child_entity_model_create_object is nil' if child_entity_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::V3_0_preview::Models::ChildEntityModelCreateObject.mapper()
  request_content = @client.serialize(request_mapper,  child_entity_model_create_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'apps/{appId}/versions/{versionId}/entities/{entityId}/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,'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
add_entity_child_with_http_info(app_id, version_id, entity_id, child_entity_model_create_object, custom_headers:nil) click to toggle source

Creates a single child in an existing entity model hierarchy 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 child_entity_model_create_object [ChildEntityModelCreateObject] A model object containing the name of the new child model and its 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5595
def add_entity_child_with_http_info(app_id, version_id, entity_id, child_entity_model_create_object, custom_headers:nil)
  add_entity_child_async(app_id, version_id, entity_id, child_entity_model_create_object, custom_headers:custom_headers).value!
end
add_entity_with_http_info(app_id, version_id, entity_model_create_object, custom_headers:nil) click to toggle source

Adds an entity extractor to a version of the application.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_model_create_object [EntityModelCreateObject] A model object containing the name of the new entity extractor and its 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 289
def add_entity_with_http_info(app_id, version_id, entity_model_create_object, custom_headers:nil)
  add_entity_async(app_id, version_id, entity_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8701
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8736
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8719
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_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/3.0-preview/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/3.0-preview/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::V3_0_preview::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/3.0-preview/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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1000
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1033
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1017
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4670
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4703
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4687
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7306
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7341
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7324
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7774
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7809
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7792
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8467
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8502
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8485
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6844
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6879
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6862
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8236
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8271
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8254
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6614
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6649
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6632
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8005
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8040
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8023
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7075
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7110
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7093
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6372
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6407
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6390
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7541
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7578
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7560
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3906
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3937
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10284
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10317
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10301
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3922
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3487
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3518
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6145
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6178
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6162
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10924
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10957
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10941
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3503
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11878
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11911
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11895
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5476
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5507
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5492
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 or a child 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 or the child 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2037
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 or a child 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 or the child 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2068
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

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

Deletes a relation from the feature relations used by the 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 feature_relation_delete_object [ModelFeatureInformation] A feature information object containing the feature relation to delete. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2860
def delete_entity_feature(app_id, version_id, entity_id, feature_relation_delete_object, custom_headers:nil)
  response = delete_entity_feature_async(app_id, version_id, entity_id, feature_relation_delete_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_entity_feature_async(app_id, version_id, entity_id, feature_relation_delete_object, custom_headers:nil) click to toggle source

Deletes a relation from the feature relations used by the 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 feature_relation_delete_object [ModelFeatureInformation] A feature information object containing the feature relation to delete. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2897
def delete_entity_feature_async(app_id, version_id, entity_id, feature_relation_delete_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, 'feature_relation_delete_object is nil' if feature_relation_delete_object.nil?


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

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

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

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

  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(:delete, path_template, options)

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

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

    result
  end

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

Deletes a relation from the feature relations used by the 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 feature_relation_delete_object [ModelFeatureInformation] A feature information object containing the feature relation to delete. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2879
def delete_entity_feature_with_http_info(app_id, version_id, entity_id, feature_relation_delete_object, custom_headers:nil)
  delete_entity_feature_async(app_id, version_id, entity_id, feature_relation_delete_object, custom_headers:custom_headers).value!
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9650
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9683
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9667
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 or a child 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 or the child 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2053
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 12199
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 12234
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 12217
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3182
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3213
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5921
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5956
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5939
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11561
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11594
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11578
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3198
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1836
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1873
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_intent_feature(app_id, version_id, intent_id, feature_relation_delete_object, custom_headers:nil) click to toggle source

Deletes a relation from the feature relations used by the 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 feature_relation_delete_object [ModelFeatureInformation] A feature information object containing the feature relation to delete. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2500
def delete_intent_feature(app_id, version_id, intent_id, feature_relation_delete_object, custom_headers:nil)
  response = delete_intent_feature_async(app_id, version_id, intent_id, feature_relation_delete_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
delete_intent_feature_async(app_id, version_id, intent_id, feature_relation_delete_object, custom_headers:nil) click to toggle source

Deletes a relation from the feature relations used by the 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 feature_relation_delete_object [ModelFeatureInformation] A feature information object containing the feature relation to delete. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2537
def delete_intent_feature_async(app_id, version_id, intent_id, feature_relation_delete_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, 'feature_relation_delete_object is nil' if feature_relation_delete_object.nil?


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

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

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

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

  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(:delete, path_template, options)

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

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

    result
  end

  promise.execute
end
delete_intent_feature_with_http_info(app_id, version_id, intent_id, feature_relation_delete_object, custom_headers:nil) click to toggle source

Deletes a relation from the feature relations used by the 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 feature_relation_delete_object [ModelFeatureInformation] A feature information object containing the feature relation to delete. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2519
def delete_intent_feature_with_http_info(app_id, version_id, intent_id, feature_relation_delete_object, custom_headers:nil)
  delete_intent_feature_async(app_id, version_id, intent_id, feature_relation_delete_object, custom_headers:custom_headers).value!
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1855
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9336
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9367
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9352
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11241
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11274
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11258
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4103
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4134
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9967
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10000
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9984
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4119
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9028
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9059
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9044
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10607
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10640
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10624
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4202
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4237
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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
delete_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4220
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1500
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1539
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1520
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3584
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3615
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10068
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10101
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10085
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3600
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3279
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3310
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10708
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10741
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10725
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3295
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11662
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11695
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11679
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 [NDepthEntityExtractor] operation results.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1940
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1971
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::V3_0_preview::Models::NDepthEntityExtractor.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_features(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Gets the information of the features used by the 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 custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2612
def get_entity_features(app_id, version_id, entity_id, custom_headers:nil)
  response = get_entity_features_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_entity_features_async(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Gets the information of the features used by the 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 [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2645
def get_entity_features_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}/features'

  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: 'ModelFeatureInformationElementType',
                type: {
                  name: 'Composite',
                  class_name: 'ModelFeatureInformation'
                }
            }
          }
        }
        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_features_with_http_info(app_id, version_id, entity_id, custom_headers:nil) click to toggle source

Gets the information of the features used by the 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 custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2629
def get_entity_features_with_http_info(app_id, version_id, entity_id, custom_headers:nil)
  get_entity_features_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9434
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9467
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9451
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1956
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8584
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8617
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11980
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 12015
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11998
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8601
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2971
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3002
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5696
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5731
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5714
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11342
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11375
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11359
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2987
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1625
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1656
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::V3_0_preview::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_features(app_id, version_id, intent_id, custom_headers:nil) click to toggle source

Gets the information of the features used by the 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 custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array] operation results.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2252
def get_intent_features(app_id, version_id, intent_id, custom_headers:nil)
  response = get_intent_features_async(app_id, version_id, intent_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_intent_features_async(app_id, version_id, intent_id, custom_headers:nil) click to toggle source

Gets the information of the features used by the 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 [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2285
def get_intent_features_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}/features'

  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 = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ModelFeatureInformationElementType',
                type: {
                  name: 'Composite',
                  class_name: 'ModelFeatureInformation'
                }
            }
          }
        }
        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_features_with_http_info(app_id, version_id, intent_id, custom_headers:nil) click to toggle source

Gets the information of the features used by the 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 custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2269
def get_intent_features_with_http_info(app_id, version_id, intent_id, custom_headers:nil)
  get_intent_features_async(app_id, version_id, intent_id, custom_headers:custom_headers).value!
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1641
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9125
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9156
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9141
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11025
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11058
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11042
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4004
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4037
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9751
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9784
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9768
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4021
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8818
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8851
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8835
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10386
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10421
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::V3_0_preview::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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10404
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7191
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7222
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7207
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 763
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 800
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 782
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 638
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 675
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 657
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7659
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7690
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7675
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5254
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5283
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5269
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8352
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8383
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8368
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5026
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5057
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5042
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5364
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5395
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5380
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/3.0-preview/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/3.0-preview/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: 'NDepthEntityExtractorElementType',
                type: {
                  name: 'Composite',
                  class_name: 'NDepthEntityExtractor'
                }
            }
          }
        }
        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/3.0-preview/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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6729
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6760
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6745
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4547
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4584
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4566
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 513
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 550
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 532
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8121
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8152
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8137
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4422
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4459
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4441
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/3.0-preview/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/3.0-preview/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/3.0-preview/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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1374
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1411
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1393
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6490
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6527
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6509
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7890
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7921
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7906
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1261
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1290
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1276
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6960
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6991
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6976
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1140
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1177
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1159
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6248
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6285
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 6267
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7423
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7456
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 7440
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3795
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3832
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3814
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
replace_entity_features(app_id, version_id, entity_id, feature_relations_update_object, custom_headers:nil) click to toggle source

Updates the information of the features used by the 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 feature_relations_update_object [Array<ModelFeatureInformation>] A list of feature information objects containing the new feature relations. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2730
def replace_entity_features(app_id, version_id, entity_id, feature_relations_update_object, custom_headers:nil)
  response = replace_entity_features_async(app_id, version_id, entity_id, feature_relations_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
replace_entity_features_async(app_id, version_id, entity_id, feature_relations_update_object, custom_headers:nil) click to toggle source

Updates the information of the features used by the 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 feature_relations_update_object [Array<ModelFeatureInformation>] A list of feature information objects containing the new feature relations. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2767
def replace_entity_features_async(app_id, version_id, entity_id, feature_relations_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, 'feature_relations_update_object is nil' if feature_relations_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 = {
    client_side_validation: true,
    required: true,
    serialized_name: 'featureRelationsUpdateObject',
    type: {
      name: 'Sequence',
      element: {
          client_side_validation: true,
          required: false,
          serialized_name: 'ModelFeatureInformationElementType',
          type: {
            name: 'Composite',
            class_name: 'ModelFeatureInformation'
          }
      }
    }
  }
  request_content = @client.serialize(request_mapper,  feature_relations_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

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

Updates the information of the features used by the 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 feature_relations_update_object [Array<ModelFeatureInformation>] A list of feature information objects containing the new feature relations. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2749
def replace_entity_features_with_http_info(app_id, version_id, entity_id, feature_relations_update_object, custom_headers:nil)
  replace_entity_features_async(app_id, version_id, entity_id, feature_relations_update_object, custom_headers:custom_headers).value!
end
replace_intent_features(app_id, version_id, intent_id, feature_relations_update_object, custom_headers:nil) click to toggle source

Updates the information of the features used by the 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 feature_relations_update_object [Array<ModelFeatureInformation>] A list of feature information objects containing the new feature relations. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2370
def replace_intent_features(app_id, version_id, intent_id, feature_relations_update_object, custom_headers:nil)
  response = replace_intent_features_async(app_id, version_id, intent_id, feature_relations_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
replace_intent_features_async(app_id, version_id, intent_id, feature_relations_update_object, custom_headers:nil) click to toggle source

Updates the information of the features used by the 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 feature_relations_update_object [Array<ModelFeatureInformation>] A list of feature information objects containing the new feature relations. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2407
def replace_intent_features_async(app_id, version_id, intent_id, feature_relations_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, 'feature_relations_update_object is nil' if feature_relations_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 = {
    client_side_validation: true,
    required: true,
    serialized_name: 'featureRelationsUpdateObject',
    type: {
      name: 'Sequence',
      element: {
          client_side_validation: true,
          required: false,
          serialized_name: 'ModelFeatureInformationElementType',
          type: {
            name: 'Composite',
            class_name: 'ModelFeatureInformation'
          }
      }
    }
  }
  request_content = @client.serialize(request_mapper,  feature_relations_update_object)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
replace_intent_features_with_http_info(app_id, version_id, intent_id, feature_relations_update_object, custom_headers:nil) click to toggle source

Updates the information of the features used by the 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 feature_relations_update_object [Array<ModelFeatureInformation>] A list of feature information objects containing the new feature relations. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2389
def replace_intent_features_with_http_info(app_id, version_id, intent_id, feature_relations_update_object, custom_headers:nil)
  replace_intent_features_async(app_id, version_id, intent_id, feature_relations_update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3683
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3718
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10171
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10208
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10190
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3701
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3378
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3413
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10811
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10848
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10830
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3396
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11765
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11802
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11784
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_child(app_id, version_id, entity_id, entity_model_update_object, custom_headers:nil) click to toggle source

Updates the name of an entity extractor or the name and instanceOf model of a child entity extractor.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor or the child entity extractor ID. @param entity_model_update_object [EntityModelUpdateObject] A model object containing the name new entity extractor or the name and instance of model of a child entity extractor @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [OperationStatus] operation results.

# File lib/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2138
def update_entity_child(app_id, version_id, entity_id, entity_model_update_object, custom_headers:nil)
  response = update_entity_child_async(app_id, version_id, entity_id, entity_model_update_object, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_entity_child_async(app_id, version_id, entity_id, entity_model_update_object, custom_headers:nil) click to toggle source

Updates the name of an entity extractor or the name and instanceOf model of a child entity extractor.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor or the child entity extractor ID. @param entity_model_update_object [EntityModelUpdateObject] A model object containing the name new entity extractor or the name and instance of model of a child 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2177
def update_entity_child_async(app_id, version_id, entity_id, entity_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, 'entity_model_update_object is nil' if entity_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::V3_0_preview::Models::EntityModelUpdateObject.mapper()
  request_content = @client.serialize(request_mapper,  entity_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(: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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

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

Updates the name of an entity extractor or the name and instanceOf model of a child entity extractor.

@param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity extractor or the child entity extractor ID. @param entity_model_update_object [EntityModelUpdateObject] A model object containing the name new entity extractor or the name and instance of model of a child 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 2158
def update_entity_child_with_http_info(app_id, version_id, entity_id, entity_model_update_object, custom_headers:nil)
  update_entity_child_async(app_id, version_id, entity_id, entity_model_update_object, custom_headers:custom_headers).value!
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9537
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9574
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9556
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_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 12085
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 12122
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 12104
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, model_update_object, custom_headers:nil) click to toggle source

Updates the name 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 model_update_object [ModelUpdateObject] Model containing names 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3071
def update_hierarchical_entity(app_id, version_id, h_entity_id, model_update_object, custom_headers:nil)
  response = update_hierarchical_entity_async(app_id, version_id, h_entity_id, 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, model_update_object, custom_headers:nil) click to toggle source

Updates the name 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 model_update_object [ModelUpdateObject] Model containing names 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3108
def update_hierarchical_entity_async(app_id, version_id, h_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, 'h_entity_id is nil' if h_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::V3_0_preview::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}/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(: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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5803
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5844
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::V3_0_preview::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(: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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 5824
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11446
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11485
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11466
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, model_update_object, custom_headers:nil) click to toggle source

Updates the name 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 model_update_object [ModelUpdateObject] Model containing names 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 3090
def update_hierarchical_entity_with_http_info(app_id, version_id, h_entity_id, model_update_object, custom_headers:nil)
  update_hierarchical_entity_async(app_id, version_id, h_entity_id, 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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1724
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1759
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 1742
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9225
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9262
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9244
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11128
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11165
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 11147
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9854
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9891
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 9873
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8919
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8954
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 8937
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10492
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10531
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 10512
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4307
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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4344
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::V3_0_preview::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::V3_0_preview::Models::OperationStatus.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
update_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/3.0-preview/generated/azure_cognitiveservices_luisauthoring/model.rb, line 4326
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