# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.pipeline import ClientRawResponse
from msrest.exceptions import HttpOperationError
from .. import models
[docs]class ModelOperations(object):
"""ModelOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.config = config
[docs] def add_intent(
self, app_id, version_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Adds an intent classifier to the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param name: Name of the new entity extractor.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
"""
intent_create_object = models.ModelCreateObject(name=name)
# Construct URL
url = self.add_intent.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(intent_create_object, 'ModelCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise HttpOperationError(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents'}
[docs] def list_intents(
self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Gets information about the intent models.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.IntentClassifier]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_intents.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[IntentClassifier]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_intents.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents'}
[docs] def add_entity(
self, app_id, version_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Adds an entity extractor to the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param name: Name of the new entity extractor.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
model_create_object = models.ModelCreateObject(name=name)
# Construct URL
url = self.add_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(model_create_object, 'ModelCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities'}
[docs] def list_entities(
self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Gets information about the entity models.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityExtractor]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_entities.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityExtractor]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities'}
[docs] def add_hierarchical_entity(
self, app_id, version_id, children=None, name=None, custom_headers=None, raw=False, **operation_config):
"""Adds a hierarchical entity extractor to the application version.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param children: Child entities.
:type children: list[str]
:param name: Entity name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
hierarchical_model_create_object = models.HierarchicalEntityModel(children=children, name=name)
# Construct URL
url = self.add_hierarchical_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(hierarchical_model_create_object, 'HierarchicalEntityModel')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities'}
[docs] def list_hierarchical_entities(
self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Gets information about the hierarchical entity models.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.HierarchicalEntityExtractor]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_hierarchical_entities.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[HierarchicalEntityExtractor]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_hierarchical_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities'}
[docs] def add_composite_entity(
self, app_id, version_id, children=None, name=None, custom_headers=None, raw=False, **operation_config):
"""Adds a composite entity extractor to the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param children: Child entities.
:type children: list[str]
:param name: Entity name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
composite_model_create_object = models.CompositeEntityModel(children=children, name=name)
# Construct URL
url = self.add_composite_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(composite_model_create_object, 'CompositeEntityModel')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities'}
[docs] def list_composite_entities(
self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Gets information about the composite entity models.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.CompositeEntityExtractor]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_composite_entities.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[CompositeEntityExtractor]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_composite_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities'}
[docs] def list_closed_lists(
self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Gets information about the closedlist models.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.ClosedListEntityExtractor]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_closed_lists.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[ClosedListEntityExtractor]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_closed_lists.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists'}
[docs] def add_closed_list(
self, app_id, version_id, sub_lists=None, name=None, custom_headers=None, raw=False, **operation_config):
"""Adds a closed list model to the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param sub_lists: Sublists for the feature.
:type sub_lists:
list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject]
:param name: Name of the closed list feature.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
closed_list_model_create_object = models.ClosedListModelCreateObject(sub_lists=sub_lists, name=name)
# Construct URL
url = self.add_closed_list.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(closed_list_model_create_object, 'ClosedListModelCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists'}
[docs] def add_prebuilt(
self, app_id, version_id, prebuilt_extractor_names, custom_headers=None, raw=False, **operation_config):
"""Adds a list of prebuilt entity extractors to the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param prebuilt_extractor_names: An array of prebuilt entity extractor
names.
:type prebuilt_extractor_names: list[str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntityExtractor]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.add_prebuilt.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(prebuilt_extractor_names, '[str]')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('[PrebuiltEntityExtractor]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_prebuilt.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts'}
[docs] def list_prebuilts(
self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Gets information about the prebuilt entity models.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntityExtractor]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_prebuilts.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[PrebuiltEntityExtractor]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_prebuilts.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts'}
[docs] def list_prebuilt_entities(
self, app_id, version_id, custom_headers=None, raw=False, **operation_config):
"""Gets all the available prebuilt entity extractors for the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.AvailablePrebuiltEntityModel]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_prebuilt_entities.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[AvailablePrebuiltEntityModel]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_prebuilt_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/listprebuilts'}
[docs] def list_models(
self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Gets information about the application version models.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.ModelInfoResponse]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_models.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[ModelInfoResponse]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_models.metadata = {'url': '/apps/{appId}/versions/{versionId}/models'}
[docs] def examples_method(
self, app_id, version_id, model_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Gets the utterances for the given model in the given app version.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param model_id: The ID (GUID) of the model.
:type model_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.LabelTextObject]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.examples_method.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'modelId': self._serialize.url("model_id", model_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[LabelTextObject]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
examples_method.metadata = {'url': '/apps/{appId}/versions/{versionId}/models/{modelId}/examples'}
[docs] def get_intent(
self, app_id, version_id, intent_id, custom_headers=None, raw=False, **operation_config):
"""Gets information about the intent model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param intent_id: The intent classifier ID.
:type intent_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: IntentClassifier or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.IntentClassifier
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_intent.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'intentId': self._serialize.url("intent_id", intent_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('IntentClassifier', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}'}
[docs] def update_intent(
self, app_id, version_id, intent_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Updates the name of an intent classifier.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param intent_id: The intent classifier ID.
:type intent_id: str
:param name: The entity's new name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
model_update_object = models.ModelUpdateObject(name=name)
# Construct URL
url = self.update_intent.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'intentId': self._serialize.url("intent_id", intent_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(model_update_object, 'ModelUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}'}
[docs] def delete_intent(
self, app_id, version_id, intent_id, delete_utterances=False, custom_headers=None, raw=False, **operation_config):
"""Deletes an intent classifier from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param intent_id: The intent classifier ID.
:type intent_id: str
:param delete_utterances: Also delete the intent's utterances (true).
Or move the utterances to the None intent (false - the default value).
:type delete_utterances: bool
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_intent.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'intentId': self._serialize.url("intent_id", intent_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if delete_utterances is not None:
query_parameters['deleteUtterances'] = self._serialize.query("delete_utterances", delete_utterances, 'bool')
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}'}
[docs] def get_entity(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Gets information about the entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity extractor ID.
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EntityExtractor or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.EntityExtractor
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('EntityExtractor', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'}
[docs] def update_entity(
self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Updates the name of an entity extractor.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity extractor ID.
:type entity_id: str
:param name: The entity's new name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
model_update_object = models.ModelUpdateObject(name=name)
# Construct URL
url = self.update_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(model_update_object, 'ModelUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'}
[docs] def delete_entity(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Deletes an entity extractor from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity extractor ID.
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'}
[docs] def get_hierarchical_entity(
self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config):
"""Gets information about the hierarchical entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: HierarchicalEntityExtractor or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.HierarchicalEntityExtractor
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_hierarchical_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('HierarchicalEntityExtractor', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'}
[docs] def update_hierarchical_entity(
self, app_id, version_id, h_entity_id, children=None, name=None, custom_headers=None, raw=False, **operation_config):
"""Updates the name and children of a hierarchical entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param children: Child entities.
:type children: list[str]
:param name: Entity name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
hierarchical_model_update_object = models.HierarchicalEntityModel(children=children, name=name)
# Construct URL
url = self.update_hierarchical_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(hierarchical_model_update_object, 'HierarchicalEntityModel')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'}
[docs] def delete_hierarchical_entity(
self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config):
"""Deletes a hierarchical entity extractor from the application version.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_hierarchical_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'}
[docs] def get_composite_entity(
self, app_id, version_id, c_entity_id, custom_headers=None, raw=False, **operation_config):
"""Gets information about the composite entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: CompositeEntityExtractor or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.CompositeEntityExtractor
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_composite_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('CompositeEntityExtractor', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'}
[docs] def update_composite_entity(
self, app_id, version_id, c_entity_id, children=None, name=None, custom_headers=None, raw=False, **operation_config):
"""Updates the composite entity extractor.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param children: Child entities.
:type children: list[str]
:param name: Entity name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
composite_model_update_object = models.CompositeEntityModel(children=children, name=name)
# Construct URL
url = self.update_composite_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(composite_model_update_object, 'CompositeEntityModel')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'}
[docs] def delete_composite_entity(
self, app_id, version_id, c_entity_id, custom_headers=None, raw=False, **operation_config):
"""Deletes a composite entity extractor from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_composite_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_composite_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}'}
[docs] def get_closed_list(
self, app_id, version_id, cl_entity_id, custom_headers=None, raw=False, **operation_config):
"""Gets information of a closed list model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param cl_entity_id: The closed list model ID.
:type cl_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: ClosedListEntityExtractor or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.ClosedListEntityExtractor
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_closed_list.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('ClosedListEntityExtractor', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'}
[docs] def update_closed_list(
self, app_id, version_id, cl_entity_id, sub_lists=None, name=None, custom_headers=None, raw=False, **operation_config):
"""Updates the closed list model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param cl_entity_id: The closed list model ID.
:type cl_entity_id: str
:param sub_lists: The new sublists for the feature.
:type sub_lists:
list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject]
:param name: The new name of the closed list feature.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
closed_list_model_update_object = models.ClosedListModelUpdateObject(sub_lists=sub_lists, name=name)
# Construct URL
url = self.update_closed_list.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(closed_list_model_update_object, 'ClosedListModelUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'}
[docs] def patch_closed_list(
self, app_id, version_id, cl_entity_id, sub_lists=None, custom_headers=None, raw=False, **operation_config):
"""Adds a batch of sublists to an existing closedlist.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param cl_entity_id: The closed list model ID.
:type cl_entity_id: str
:param sub_lists: Sublists to add.
:type sub_lists:
list[~azure.cognitiveservices.language.luis.authoring.models.WordListObject]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
closed_list_model_patch_object = models.ClosedListModelPatchObject(sub_lists=sub_lists)
# Construct URL
url = self.patch_closed_list.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(closed_list_model_patch_object, 'ClosedListModelPatchObject')
# Construct and send request
request = self._client.patch(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
patch_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'}
[docs] def delete_closed_list(
self, app_id, version_id, cl_entity_id, custom_headers=None, raw=False, **operation_config):
"""Deletes a closed list model from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param cl_entity_id: The closed list model ID.
:type cl_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_closed_list.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_closed_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}'}
[docs] def get_prebuilt(
self, app_id, version_id, prebuilt_id, custom_headers=None, raw=False, **operation_config):
"""Gets information about the prebuilt entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param prebuilt_id: The prebuilt entity extractor ID.
:type prebuilt_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: PrebuiltEntityExtractor or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.PrebuiltEntityExtractor
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_prebuilt.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'prebuiltId': self._serialize.url("prebuilt_id", prebuilt_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('PrebuiltEntityExtractor', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_prebuilt.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}'}
[docs] def delete_prebuilt(
self, app_id, version_id, prebuilt_id, custom_headers=None, raw=False, **operation_config):
"""Deletes a prebuilt entity extractor from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param prebuilt_id: The prebuilt entity extractor ID.
:type prebuilt_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_prebuilt.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'prebuiltId': self._serialize.url("prebuilt_id", prebuilt_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_prebuilt.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{prebuiltId}'}
[docs] def delete_sub_list(
self, app_id, version_id, cl_entity_id, sub_list_id, custom_headers=None, raw=False, **operation_config):
"""Deletes a sublist of a specific closed list model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param cl_entity_id: The closed list entity extractor ID.
:type cl_entity_id: str
:param sub_list_id: The sublist ID.
:type sub_list_id: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_sub_list.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str'),
'subListId': self._serialize.url("sub_list_id", sub_list_id, 'int')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_sub_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}'}
[docs] def update_sub_list(
self, app_id, version_id, cl_entity_id, sub_list_id, canonical_form=None, list=None, custom_headers=None, raw=False, **operation_config):
"""Updates one of the closed list's sublists.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param cl_entity_id: The closed list entity extractor ID.
:type cl_entity_id: str
:param sub_list_id: The sublist ID.
:type sub_list_id: int
:param canonical_form: The standard form that the list represents.
:type canonical_form: str
:param list: List of synonym words.
:type list: list[str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
word_list_base_update_object = models.WordListBaseUpdateObject(canonical_form=canonical_form, list=list)
# Construct URL
url = self.update_sub_list.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str'),
'subListId': self._serialize.url("sub_list_id", sub_list_id, 'int')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(word_list_base_update_object, 'WordListBaseUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_sub_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists/{subListId}'}
[docs] def get_intent_suggestions(
self, app_id, version_id, intent_id, take=100, custom_headers=None, raw=False, **operation_config):
"""Suggests examples that would improve the accuracy of the intent model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param intent_id: The intent classifier ID.
:type intent_id: str
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.IntentsSuggestionExample]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_intent_suggestions.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'intentId': self._serialize.url("intent_id", intent_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[IntentsSuggestionExample]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_intent_suggestions.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents/{intentId}/suggest'}
[docs] def get_entity_suggestions(
self, app_id, version_id, entity_id, take=100, custom_headers=None, raw=False, **operation_config):
"""Get suggestion examples that would improve the accuracy of the entity
model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The target entity extractor model to enhance.
:type entity_id: str
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntitiesSuggestionExample]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_entity_suggestions.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntitiesSuggestionExample]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_entity_suggestions.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/suggest'}
[docs] def add_sub_list(
self, app_id, version_id, cl_entity_id, canonical_form=None, list=None, custom_headers=None, raw=False, **operation_config):
"""Adds a list to an existing closed list.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param cl_entity_id: The closed list entity extractor ID.
:type cl_entity_id: str
:param canonical_form: The standard form that the list represents.
:type canonical_form: str
:param list: List of synonym words.
:type list: list[str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: int or ClientRawResponse if raw=true
:rtype: int or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
word_list_create_object = models.WordListObject(canonical_form=canonical_form, list=list)
# Construct URL
url = self.add_sub_list.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'clEntityId': self._serialize.url("cl_entity_id", cl_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(word_list_create_object, 'WordListObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('int', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_sub_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{clEntityId}/sublists'}
[docs] def add_custom_prebuilt_domain(
self, app_id, version_id, domain_name=None, custom_headers=None, raw=False, **operation_config):
"""Adds a customizable prebuilt domain along with all of its models to
this application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param domain_name: The domain name.
:type domain_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype: list[str] or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
prebuilt_domain_object = models.PrebuiltDomainCreateBaseObject(domain_name=domain_name)
# Construct URL
url = self.add_custom_prebuilt_domain.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(prebuilt_domain_object, 'PrebuiltDomainCreateBaseObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('[str]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_custom_prebuilt_domain.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltdomains'}
[docs] def add_custom_prebuilt_intent(
self, app_id, version_id, domain_name=None, model_name=None, custom_headers=None, raw=False, **operation_config):
"""Adds a custom prebuilt intent model to the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param domain_name: The domain name.
:type domain_name: str
:param model_name: The intent name or entity name.
:type model_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
prebuilt_domain_model_create_object = models.PrebuiltDomainModelCreateObject(domain_name=domain_name, model_name=model_name)
# Construct URL
url = self.add_custom_prebuilt_intent.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(prebuilt_domain_model_create_object, 'PrebuiltDomainModelCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_custom_prebuilt_intent.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltintents'}
[docs] def list_custom_prebuilt_intents(
self, app_id, version_id, custom_headers=None, raw=False, **operation_config):
"""Gets custom prebuilt intents information of this application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.IntentClassifier]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_custom_prebuilt_intents.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[IntentClassifier]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_custom_prebuilt_intents.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltintents'}
[docs] def add_custom_prebuilt_entity(
self, app_id, version_id, domain_name=None, model_name=None, custom_headers=None, raw=False, **operation_config):
"""Adds a custom prebuilt entity model to the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param domain_name: The domain name.
:type domain_name: str
:param model_name: The intent name or entity name.
:type model_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
prebuilt_domain_model_create_object = models.PrebuiltDomainModelCreateObject(domain_name=domain_name, model_name=model_name)
# Construct URL
url = self.add_custom_prebuilt_entity.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(prebuilt_domain_model_create_object, 'PrebuiltDomainModelCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_custom_prebuilt_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities'}
[docs] def list_custom_prebuilt_entities(
self, app_id, version_id, custom_headers=None, raw=False, **operation_config):
"""Gets all custom prebuilt entities information of this application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityExtractor]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_custom_prebuilt_entities.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityExtractor]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_custom_prebuilt_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities'}
[docs] def list_custom_prebuilt_models(
self, app_id, version_id, custom_headers=None, raw=False, **operation_config):
"""Gets all custom prebuilt models information of this application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.CustomPrebuiltModel]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.list_custom_prebuilt_models.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[CustomPrebuiltModel]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
list_custom_prebuilt_models.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltmodels'}
[docs] def delete_custom_prebuilt_domain(
self, app_id, version_id, domain_name, custom_headers=None, raw=False, **operation_config):
"""Deletes a prebuilt domain's models from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param domain_name: Domain name.
:type domain_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_custom_prebuilt_domain.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'domainName': self._serialize.url("domain_name", domain_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_custom_prebuilt_domain.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltdomains/{domainName}'}
[docs] def get_hierarchical_entity_child(
self, app_id, version_id, h_entity_id, h_child_id, custom_headers=None, raw=False, **operation_config):
"""Gets information about the hierarchical entity child model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param h_child_id: The hierarchical entity extractor child ID.
:type h_child_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: HierarchicalChildEntity or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.HierarchicalChildEntity
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_hierarchical_entity_child.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'),
'hChildId': self._serialize.url("h_child_id", h_child_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('HierarchicalChildEntity', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'}
[docs] def update_hierarchical_entity_child(
self, app_id, version_id, h_entity_id, h_child_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Renames a single child in an existing hierarchical entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param h_child_id: The hierarchical entity extractor child ID.
:type h_child_id: str
:param name:
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
hierarchical_child_model_update_object = models.HierarchicalChildModelUpdateObject(name=name)
# Construct URL
url = self.update_hierarchical_entity_child.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'),
'hChildId': self._serialize.url("h_child_id", h_child_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(hierarchical_child_model_update_object, 'HierarchicalChildModelUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'}
[docs] def delete_hierarchical_entity_child(
self, app_id, version_id, h_entity_id, h_child_id, custom_headers=None, raw=False, **operation_config):
"""Deletes a hierarchical entity extractor child from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param h_child_id: The hierarchical entity extractor child ID.
:type h_child_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_hierarchical_entity_child.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'),
'hChildId': self._serialize.url("h_child_id", h_child_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'}
[docs] def add_hierarchical_entity_child(
self, app_id, version_id, h_entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Creates a single child in an existing hierarchical entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param name:
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
hierarchical_child_model_create_object = models.HierarchicalChildModelCreateObject(name=name)
# Construct URL
url = self.add_hierarchical_entity_child.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(hierarchical_child_model_create_object, 'HierarchicalChildModelCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children'}
[docs] def add_composite_entity_child(
self, app_id, version_id, c_entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Creates a single child in an existing composite entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param name:
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
composite_child_model_create_object = models.CompositeChildModelCreateObject(name=name)
# Construct URL
url = self.add_composite_entity_child.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(composite_child_model_create_object, 'CompositeChildModelCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_composite_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children'}
[docs] def delete_composite_entity_child(
self, app_id, version_id, c_entity_id, c_child_id, custom_headers=None, raw=False, **operation_config):
"""Deletes a composite entity extractor child from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param c_child_id: The hierarchical entity extractor child ID.
:type c_child_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_composite_entity_child.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'),
'cChildId': self._serialize.url("c_child_id", c_child_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_composite_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/children/{cChildId}'}
[docs] def get_regex_entity_infos(
self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Gets information about the regex entity models.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.RegexEntityExtractor]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_regex_entity_infos.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[RegexEntityExtractor]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_regex_entity_infos.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities'}
[docs] def create_regex_entity_model(
self, app_id, version_id, regex_pattern=None, name=None, custom_headers=None, raw=False, **operation_config):
"""Adds a regex entity model to the application version.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param regex_pattern: The regex entity pattern.
:type regex_pattern: str
:param name: The model name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
regex_entity_extractor_create_obj = models.RegexModelCreateObject(regex_pattern=regex_pattern, name=name)
# Construct URL
url = self.create_regex_entity_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(regex_entity_extractor_create_obj, 'RegexModelCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_regex_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities'}
[docs] def get_pattern_any_entity_infos(
self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config):
"""Get information about the Pattern.Any entity models.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param skip: The number of entries to skip. Default value is 0.
:type skip: int
:param take: The number of entries to return. Maximum page size is
500. Default is 100.
:type take: int
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.PatternAnyEntityExtractor]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_pattern_any_entity_infos.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if skip is not None:
query_parameters['skip'] = self._serialize.query("skip", skip, 'int', minimum=0)
if take is not None:
query_parameters['take'] = self._serialize.query("take", take, 'int', maximum=500, minimum=0)
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[PatternAnyEntityExtractor]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_pattern_any_entity_infos.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities'}
[docs] def create_pattern_any_entity_model(
self, app_id, version_id, name=None, explicit_list=None, custom_headers=None, raw=False, **operation_config):
"""Adds a pattern.any entity extractor to the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param name: The model name.
:type name: str
:param explicit_list: The Pattern.Any explicit list.
:type explicit_list: list[str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
extractor_create_object = models.PatternAnyModelCreateObject(name=name, explicit_list=explicit_list)
# Construct URL
url = self.create_pattern_any_entity_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(extractor_create_object, 'PatternAnyModelCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_pattern_any_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities'}
[docs] def get_entity_roles(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Get All Entity Roles for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity Id
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_entity_roles.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityRole]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles'}
[docs] def create_entity_role(
self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Create an entity role for an entity in the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity model ID.
:type entity_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_create_object = models.EntityRoleCreateObject(name=name)
# Construct URL
url = self.create_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles'}
[docs] def get_prebuilt_entity_roles(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Get All Entity Roles for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity Id
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_prebuilt_entity_roles.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityRole]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_prebuilt_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles'}
[docs] def create_prebuilt_entity_role(
self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Create an entity role for an entity in the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity model ID.
:type entity_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_create_object = models.EntityRoleCreateObject(name=name)
# Construct URL
url = self.create_prebuilt_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles'}
[docs] def get_closed_list_entity_roles(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Get All Entity Roles for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity Id
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_closed_list_entity_roles.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityRole]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_closed_list_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles'}
[docs] def create_closed_list_entity_role(
self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Create an entity role for an entity in the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity model ID.
:type entity_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_create_object = models.EntityRoleCreateObject(name=name)
# Construct URL
url = self.create_closed_list_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles'}
[docs] def get_regex_entity_roles(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Get All Entity Roles for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity Id
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_regex_entity_roles.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityRole]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_regex_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles'}
[docs] def create_regex_entity_role(
self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Create an entity role for an entity in the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity model ID.
:type entity_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_create_object = models.EntityRoleCreateObject(name=name)
# Construct URL
url = self.create_regex_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles'}
[docs] def get_composite_entity_roles(
self, app_id, version_id, c_entity_id, custom_headers=None, raw=False, **operation_config):
"""Get All Entity Roles for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_composite_entity_roles.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityRole]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_composite_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles'}
[docs] def create_composite_entity_role(
self, app_id, version_id, c_entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Create an entity role for an entity in the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_create_object = models.EntityRoleCreateObject(name=name)
# Construct URL
url = self.create_composite_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles'}
[docs] def get_pattern_any_entity_roles(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Get All Entity Roles for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity Id
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_pattern_any_entity_roles.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityRole]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_pattern_any_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles'}
[docs] def create_pattern_any_entity_role(
self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Create an entity role for an entity in the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity model ID.
:type entity_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_create_object = models.EntityRoleCreateObject(name=name)
# Construct URL
url = self.create_pattern_any_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles'}
[docs] def get_hierarchical_entity_roles(
self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config):
"""Get All Entity Roles for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_hierarchical_entity_roles.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityRole]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_hierarchical_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles'}
[docs] def create_hierarchical_entity_role(
self, app_id, version_id, h_entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Create an entity role for an entity in the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_create_object = models.EntityRoleCreateObject(name=name)
# Construct URL
url = self.create_hierarchical_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles'}
[docs] def get_custom_prebuilt_entity_roles(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Get All Entity Roles for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity Id
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_custom_prebuilt_entity_roles.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[EntityRole]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_custom_prebuilt_entity_roles.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles'}
[docs] def create_custom_prebuilt_entity_role(
self, app_id, version_id, entity_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Create an entity role for an entity in the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity model ID.
:type entity_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: str or ClientRawResponse if raw=true
:rtype: str or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_create_object = models.EntityRoleCreateObject(name=name)
# Construct URL
url = self.create_custom_prebuilt_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_create_object, 'EntityRoleCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('str', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
create_custom_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles'}
[docs] def get_explicit_list(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Get the explicit list of the pattern.any entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The Pattern.Any entity id.
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: list or ClientRawResponse if raw=true
:rtype:
list[~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem]
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_explicit_list.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('[ExplicitListItem]', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_explicit_list.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist'}
[docs] def add_explicit_list_item(
self, app_id, version_id, entity_id, explicit_list_item=None, custom_headers=None, raw=False, **operation_config):
"""Add a new item to the explicit list for the Pattern.Any entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The Pattern.Any entity extractor ID.
:type entity_id: str
:param explicit_list_item: The explicit list item.
:type explicit_list_item: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: int or ClientRawResponse if raw=true
:rtype: int or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
item = models.ExplicitListItemCreateObject(explicit_list_item=explicit_list_item)
# Construct URL
url = self.add_explicit_list_item.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(item, 'ExplicitListItemCreateObject')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [201]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 201:
deserialized = self._deserialize('int', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
add_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist'}
[docs] def get_regex_entity_entity_info(
self, app_id, version_id, regex_entity_id, custom_headers=None, raw=False, **operation_config):
"""Gets information of a regex entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param regex_entity_id: The regex entity model ID.
:type regex_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: RegexEntityExtractor or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.RegexEntityExtractor
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_regex_entity_entity_info.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'regexEntityId': self._serialize.url("regex_entity_id", regex_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('RegexEntityExtractor', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_regex_entity_entity_info.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'}
[docs] def update_regex_entity_model(
self, app_id, version_id, regex_entity_id, regex_pattern=None, name=None, custom_headers=None, raw=False, **operation_config):
"""Updates the regex entity model .
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param regex_entity_id: The regex entity extractor ID.
:type regex_entity_id: str
:param regex_pattern: The regex entity pattern.
:type regex_pattern: str
:param name: The model name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
regex_entity_update_object = models.RegexModelUpdateObject(regex_pattern=regex_pattern, name=name)
# Construct URL
url = self.update_regex_entity_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'regexEntityId': self._serialize.url("regex_entity_id", regex_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(regex_entity_update_object, 'RegexModelUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_regex_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'}
[docs] def delete_regex_entity_model(
self, app_id, version_id, regex_entity_id, custom_headers=None, raw=False, **operation_config):
"""Deletes a regex entity model from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param regex_entity_id: The regex entity extractor ID.
:type regex_entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_regex_entity_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'regexEntityId': self._serialize.url("regex_entity_id", regex_entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_regex_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}'}
[docs] def get_pattern_any_entity_info(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Gets information about the application version's Pattern.Any model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity extractor ID.
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: PatternAnyEntityExtractor or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.PatternAnyEntityExtractor
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_pattern_any_entity_info.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('PatternAnyEntityExtractor', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_pattern_any_entity_info.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'}
[docs] def update_pattern_any_entity_model(
self, app_id, version_id, entity_id, name=None, explicit_list=None, custom_headers=None, raw=False, **operation_config):
"""Updates the name and explicit list of a Pattern.Any entity model.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The Pattern.Any entity extractor ID.
:type entity_id: str
:param name: The model name.
:type name: str
:param explicit_list: The Pattern.Any explicit list.
:type explicit_list: list[str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
pattern_any_update_object = models.PatternAnyModelUpdateObject(name=name, explicit_list=explicit_list)
# Construct URL
url = self.update_pattern_any_entity_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(pattern_any_update_object, 'PatternAnyModelUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_pattern_any_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'}
[docs] def delete_pattern_any_entity_model(
self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config):
"""Deletes a Pattern.Any entity extractor from the application.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The Pattern.Any entity extractor ID.
:type entity_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_pattern_any_entity_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_pattern_any_entity_model.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}'}
[docs] def get_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Get one entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity ID.
:type entity_id: str
:param role_id: entity role ID.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EntityRole or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.EntityRole or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('EntityRole', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'}
[docs] def update_entity_role(
self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Update an entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role ID.
:type role_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_update_object = models.EntityRoleUpdateObject(name=name)
# Construct URL
url = self.update_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'}
[docs] def delete_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Delete an entity role.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role Id.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/roles/{roleId}'}
[docs] def get_prebuilt_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Get one entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity ID.
:type entity_id: str
:param role_id: entity role ID.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EntityRole or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.EntityRole or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_prebuilt_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('EntityRole', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'}
[docs] def update_prebuilt_entity_role(
self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Update an entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role ID.
:type role_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_update_object = models.EntityRoleUpdateObject(name=name)
# Construct URL
url = self.update_prebuilt_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'}
[docs] def delete_prebuilt_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Delete an entity role.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role Id.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_prebuilt_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/prebuilts/{entityId}/roles/{roleId}'}
[docs] def get_closed_list_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Get one entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity ID.
:type entity_id: str
:param role_id: entity role ID.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EntityRole or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.EntityRole or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_closed_list_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('EntityRole', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'}
[docs] def update_closed_list_entity_role(
self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Update an entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role ID.
:type role_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_update_object = models.EntityRoleUpdateObject(name=name)
# Construct URL
url = self.update_closed_list_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'}
[docs] def delete_closed_list_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Delete an entity role.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role Id.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_closed_list_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_closed_list_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/closedlists/{entityId}/roles/{roleId}'}
[docs] def get_regex_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Get one entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity ID.
:type entity_id: str
:param role_id: entity role ID.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EntityRole or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.EntityRole or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_regex_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('EntityRole', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'}
[docs] def update_regex_entity_role(
self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Update an entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role ID.
:type role_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_update_object = models.EntityRoleUpdateObject(name=name)
# Construct URL
url = self.update_regex_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'}
[docs] def delete_regex_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Delete an entity role.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role Id.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_regex_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_regex_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/regexentities/{entityId}/roles/{roleId}'}
[docs] def get_composite_entity_role(
self, app_id, version_id, c_entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Get one entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param role_id: entity role ID.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EntityRole or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.EntityRole or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_composite_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('EntityRole', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'}
[docs] def update_composite_entity_role(
self, app_id, version_id, c_entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Update an entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param role_id: The entity role ID.
:type role_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_update_object = models.EntityRoleUpdateObject(name=name)
# Construct URL
url = self.update_composite_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'}
[docs] def delete_composite_entity_role(
self, app_id, version_id, c_entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Delete an entity role.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param c_entity_id: The composite entity extractor ID.
:type c_entity_id: str
:param role_id: The entity role Id.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_composite_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'cEntityId': self._serialize.url("c_entity_id", c_entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_composite_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/compositeentities/{cEntityId}/roles/{roleId}'}
[docs] def get_pattern_any_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Get one entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity ID.
:type entity_id: str
:param role_id: entity role ID.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EntityRole or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.EntityRole or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_pattern_any_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('EntityRole', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'}
[docs] def update_pattern_any_entity_role(
self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Update an entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role ID.
:type role_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_update_object = models.EntityRoleUpdateObject(name=name)
# Construct URL
url = self.update_pattern_any_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'}
[docs] def delete_pattern_any_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Delete an entity role.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role Id.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_pattern_any_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_pattern_any_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/roles/{roleId}'}
[docs] def get_hierarchical_entity_role(
self, app_id, version_id, h_entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Get one entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param role_id: entity role ID.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EntityRole or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.EntityRole or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_hierarchical_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('EntityRole', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'}
[docs] def update_hierarchical_entity_role(
self, app_id, version_id, h_entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Update an entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param role_id: The entity role ID.
:type role_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_update_object = models.EntityRoleUpdateObject(name=name)
# Construct URL
url = self.update_hierarchical_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'}
[docs] def delete_hierarchical_entity_role(
self, app_id, version_id, h_entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Delete an entity role.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param h_entity_id: The hierarchical entity extractor ID.
:type h_entity_id: str
:param role_id: The entity role Id.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_hierarchical_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'hEntityId': self._serialize.url("h_entity_id", h_entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_hierarchical_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/roles/{roleId}'}
[docs] def get_custom_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Get one entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: entity ID.
:type entity_id: str
:param role_id: entity role ID.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: EntityRole or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.EntityRole or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_custom_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('EntityRole', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_custom_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'}
[docs] def update_custom_prebuilt_entity_role(
self, app_id, version_id, entity_id, role_id, name=None, custom_headers=None, raw=False, **operation_config):
"""Update an entity role for a given entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role ID.
:type role_id: str
:param name: The entity role name.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
entity_role_update_object = models.EntityRoleUpdateObject(name=name)
# Construct URL
url = self.update_custom_prebuilt_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(entity_role_update_object, 'EntityRoleUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_custom_prebuilt_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'}
[docs] def delete_custom_entity_role(
self, app_id, version_id, entity_id, role_id, custom_headers=None, raw=False, **operation_config):
"""Delete an entity role.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The entity ID.
:type entity_id: str
:param role_id: The entity role Id.
:type role_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_custom_entity_role.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'roleId': self._serialize.url("role_id", role_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_custom_entity_role.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltentities/{entityId}/roles/{roleId}'}
[docs] def get_explicit_list_item(
self, app_id, version_id, entity_id, item_id, custom_headers=None, raw=False, **operation_config):
"""Get the explicit list of the pattern.any entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The Pattern.Any entity Id.
:type entity_id: str
:param item_id: The explicit list item Id.
:type item_id: long
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: ExplicitListItem or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.ExplicitListItem
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_explicit_list_item.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'itemId': self._serialize.url("item_id", item_id, 'long')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('ExplicitListItem', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'}
[docs] def update_explicit_list_item(
self, app_id, version_id, entity_id, item_id, explicit_list_item=None, custom_headers=None, raw=False, **operation_config):
"""Updates an explicit list item for a Pattern.Any entity.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The Pattern.Any entity extractor ID.
:type entity_id: str
:param item_id: The explicit list item ID.
:type item_id: long
:param explicit_list_item: The explicit list item.
:type explicit_list_item: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
item = models.ExplicitListItemUpdateObject(explicit_list_item=explicit_list_item)
# Construct URL
url = self.update_explicit_list_item.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'itemId': self._serialize.url("item_id", item_id, 'long')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(item, 'ExplicitListItemUpdateObject')
# Construct and send request
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
update_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'}
[docs] def delete_explicit_list_item(
self, app_id, version_id, entity_id, item_id, custom_headers=None, raw=False, **operation_config):
"""Delete the explicit list item from the Pattern.any explicit list.
:param app_id: The application ID.
:type app_id: str
:param version_id: The version ID.
:type version_id: str
:param entity_id: The pattern.any entity id.
:type entity_id: str
:param item_id: The explicit list item which will be deleted.
:type item_id: long
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: OperationStatus or ClientRawResponse if raw=true
:rtype:
~azure.cognitiveservices.language.luis.authoring.models.OperationStatus
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_explicit_list_item.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'appId': self._serialize.url("app_id", app_id, 'str'),
'versionId': self._serialize.url("version_id", version_id, 'str'),
'entityId': self._serialize.url("entity_id", entity_id, 'str'),
'itemId': self._serialize.url("item_id", item_id, 'long')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('OperationStatus', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
delete_explicit_list_item.metadata = {'url': '/apps/{appId}/versions/{versionId}/patternanyentities/{entityId}/explicitlist/{itemId}'}