diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/_configuration.py b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/_configuration.py index 398cd5176478..62414bc0745b 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/_configuration.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/_configuration.py @@ -34,7 +34,7 @@ def __init__( raise ValueError("Parameter 'endpoint' must not be None.") if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") - base_url = '{Endpoint}/luis/api/v2.0' + base_url = '{Endpoint}/luis/api/v3.0-preview' super(LUISAuthoringClientConfiguration, self).__init__(base_url) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/_luis_authoring_client.py b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/_luis_authoring_client.py index f56535085591..1a4854c8b590 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/_luis_authoring_client.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/_luis_authoring_client.py @@ -69,7 +69,7 @@ def __init__( super(LUISAuthoringClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2.0' + self.api_version = '3.0-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py index 1cf335db76a5..4a0ecb5d8eb8 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/__init__.py @@ -22,6 +22,7 @@ from ._models_py3 import AzureAccountInfoObject from ._models_py3 import BatchLabelExample from ._models_py3 import ChildEntity + from ._models_py3 import ChildEntityModelCreateObject from ._models_py3 import ClosedList from ._models_py3 import ClosedListEntityExtractor from ._models_py3 import ClosedListModelCreateObject @@ -38,7 +39,9 @@ from ._models_py3 import EntityExtractor from ._models_py3 import EntityLabel from ._models_py3 import EntityLabelObject + from ._models_py3 import EntityModelCreateObject from ._models_py3 import EntityModelInfo + from ._models_py3 import EntityModelUpdateObject from ._models_py3 import EntityPrediction from ._models_py3 import EntityRole from ._models_py3 import EntityRoleCreateObject @@ -51,10 +54,8 @@ from ._models_py3 import FeatureInfoObject from ._models_py3 import FeaturesResponseObject from ._models_py3 import HierarchicalChildEntity - from ._models_py3 import HierarchicalChildModelCreateObject from ._models_py3 import HierarchicalChildModelUpdateObject from ._models_py3 import HierarchicalEntityExtractor - from ._models_py3 import HierarchicalEntityModel from ._models_py3 import HierarchicalModel from ._models_py3 import IntentClassifier from ._models_py3 import IntentPrediction @@ -73,6 +74,7 @@ from ._models_py3 import ModelTrainingDetails from ._models_py3 import ModelTrainingInfo from ._models_py3 import ModelUpdateObject + from ._models_py3 import NDepthEntityExtractor from ._models_py3 import OperationError from ._models_py3 import OperationStatus from ._models_py3 import PatternAny @@ -126,6 +128,7 @@ from ._models import AzureAccountInfoObject from ._models import BatchLabelExample from ._models import ChildEntity + from ._models import ChildEntityModelCreateObject from ._models import ClosedList from ._models import ClosedListEntityExtractor from ._models import ClosedListModelCreateObject @@ -142,7 +145,9 @@ from ._models import EntityExtractor from ._models import EntityLabel from ._models import EntityLabelObject + from ._models import EntityModelCreateObject from ._models import EntityModelInfo + from ._models import EntityModelUpdateObject from ._models import EntityPrediction from ._models import EntityRole from ._models import EntityRoleCreateObject @@ -155,10 +160,8 @@ from ._models import FeatureInfoObject from ._models import FeaturesResponseObject from ._models import HierarchicalChildEntity - from ._models import HierarchicalChildModelCreateObject from ._models import HierarchicalChildModelUpdateObject from ._models import HierarchicalEntityExtractor - from ._models import HierarchicalEntityModel from ._models import HierarchicalModel from ._models import IntentClassifier from ._models import IntentPrediction @@ -177,6 +180,7 @@ from ._models import ModelTrainingDetails from ._models import ModelTrainingInfo from ._models import ModelUpdateObject + from ._models import NDepthEntityExtractor from ._models import OperationError from ._models import OperationStatus from ._models import PatternAny @@ -235,6 +239,7 @@ 'AzureAccountInfoObject', 'BatchLabelExample', 'ChildEntity', + 'ChildEntityModelCreateObject', 'ClosedList', 'ClosedListEntityExtractor', 'ClosedListModelCreateObject', @@ -251,7 +256,9 @@ 'EntityExtractor', 'EntityLabel', 'EntityLabelObject', + 'EntityModelCreateObject', 'EntityModelInfo', + 'EntityModelUpdateObject', 'EntityPrediction', 'EntityRole', 'EntityRoleCreateObject', @@ -264,10 +271,8 @@ 'FeatureInfoObject', 'FeaturesResponseObject', 'HierarchicalChildEntity', - 'HierarchicalChildModelCreateObject', 'HierarchicalChildModelUpdateObject', 'HierarchicalEntityExtractor', - 'HierarchicalEntityModel', 'HierarchicalModel', 'IntentClassifier', 'IntentPrediction', @@ -286,6 +291,7 @@ 'ModelTrainingDetails', 'ModelTrainingInfo', 'ModelUpdateObject', + 'NDepthEntityExtractor', 'OperationError', 'OperationStatus', 'PatternAny', diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_luis_authoring_client_enums.py b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_luis_authoring_client_enums.py index f85ad6da8c8e..3bfeb07e7bff 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_luis_authoring_client_enums.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_luis_authoring_client_enums.py @@ -22,4 +22,5 @@ class TrainingStatus(str, Enum): class OperationStatusType(str, Enum): failed = "Failed" + failed = "FAILED" success = "Success" diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_models.py b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_models.py index 6cbdbeb5836b..ce6ae6478cca 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_models.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_models.py @@ -336,6 +336,20 @@ class ChildEntity(Model): :type id: str :param name: The name of a child entity. :type name: str + :param instance_of: Instance of Model. + :type instance_of: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Possible values include: 'Entity Extractor', 'Child + Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child + Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', + 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param children: List of children + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] """ _validation = { @@ -345,12 +359,45 @@ class ChildEntity(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, } def __init__(self, **kwargs): super(ChildEntity, self).__init__(**kwargs) self.id = kwargs.get('id', None) self.name = kwargs.get('name', None) + self.instance_of = kwargs.get('instance_of', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.children = kwargs.get('children', None) + + +class ChildEntityModelCreateObject(Model): + """A child entity extractor create object. + + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ChildEntityModelCreateObject, self).__init__(**kwargs) + self.children = kwargs.get('children', None) + self.name = kwargs.get('name', None) + self.instance_of = kwargs.get('instance_of', None) class ClosedList(Model): @@ -390,10 +437,11 @@ class ClosedListEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -531,10 +579,11 @@ class CompositeEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -601,10 +650,11 @@ class CustomPrebuiltModel(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param custom_prebuilt_domain_name: The domain name. @@ -752,10 +802,11 @@ class EntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -807,9 +858,9 @@ class EntityLabel(Model): :param end_token_index: Required. The index within the utterance where the extracted entity ends. :type end_token_index: int - :param role: The role of the entity within the utterance. + :param role: The role of the predicted entity. :type role: str - :param role_id: The role Id. + :param role_id: The role id for the predicted entity. :type role_id: str """ @@ -850,7 +901,7 @@ class EntityLabelObject(Model): :param end_char_index: Required. The index within the utterance where the extracted entity ends. :type end_char_index: int - :param role: The role of the entity within the utterance. + :param role: The role the entity plays in the utterance. :type role: str """ @@ -875,6 +926,27 @@ def __init__(self, **kwargs): self.role = kwargs.get('role', None) +class EntityModelCreateObject(Model): + """An entity extractor create object. + + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :param name: Entity name. + :type name: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityModelCreateObject, self).__init__(**kwargs) + self.children = kwargs.get('children', None) + self.name = kwargs.get('name', None) + + class ModelInfo(Model): """Base type used in entity types. @@ -887,10 +959,11 @@ class ModelInfo(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum """ @@ -927,10 +1000,11 @@ class EntityModelInfo(ModelInfo): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -956,6 +1030,26 @@ def __init__(self, **kwargs): self.roles = kwargs.get('roles', None) +class EntityModelUpdateObject(Model): + """An entity extractor update object. + + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityModelUpdateObject, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.instance_of = kwargs.get('instance_of', None) + + class EntityPrediction(Model): """A suggested entity. @@ -1214,15 +1308,20 @@ class HierarchicalChildEntity(ChildEntity): :type id: str :param name: The name of a child entity. :type name: str + :param instance_of: Instance of Model. + :type instance_of: str :param type_id: The type ID of the Entity Model. :type type_id: int - :param readable_type: Possible values include: 'Entity Extractor', - 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - 'Composite Entity Extractor', 'List Entity Extractor', 'Prebuilt Entity - Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Closed - List Entity Extractor', 'Regex Entity Extractor' + :param readable_type: Possible values include: 'Entity Extractor', 'Child + Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child + Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', + 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum + :param children: List of children + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] """ _validation = { @@ -1232,30 +1331,14 @@ class HierarchicalChildEntity(ChildEntity): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, 'type_id': {'key': 'typeId', 'type': 'int'}, 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, } def __init__(self, **kwargs): super(HierarchicalChildEntity, self).__init__(**kwargs) - self.type_id = kwargs.get('type_id', None) - self.readable_type = kwargs.get('readable_type', None) - - -class HierarchicalChildModelCreateObject(Model): - """HierarchicalChildModelCreateObject. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(HierarchicalChildModelCreateObject, self).__init__(**kwargs) - self.name = kwargs.get('name', None) class HierarchicalChildModelUpdateObject(Model): @@ -1286,10 +1369,11 @@ class HierarchicalEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -1324,26 +1408,6 @@ def __init__(self, **kwargs): self.children = kwargs.get('children', None) -class HierarchicalEntityModel(Model): - """A hierarchical entity extractor. - - :param children: Child entities. - :type children: list[str] - :param name: Entity name. - :type name: str - """ - - _attribute_map = { - 'children': {'key': 'children', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(HierarchicalEntityModel, self).__init__(**kwargs) - self.children = kwargs.get('children', None) - self.name = kwargs.get('name', None) - - class HierarchicalModel(Model): """HierarchicalModel. @@ -1385,10 +1449,11 @@ class IntentClassifier(ModelInfo): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param custom_prebuilt_domain_name: The domain name. @@ -1481,7 +1546,7 @@ class JSONEntity(Model): :type end_pos: int :param entity: Required. The entity name. :type entity: str - :param role: The role of the entity within the utterance. + :param role: The role the entity plays in the utterance. :type role: str """ @@ -1791,10 +1856,11 @@ class ModelInfoResponse(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -1922,6 +1988,65 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) +class NDepthEntityExtractor(Model): + """N-Depth Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, **kwargs): + super(NDepthEntityExtractor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type_id = kwargs.get('type_id', None) + self.readable_type = kwargs.get('readable_type', None) + self.roles = kwargs.get('roles', None) + self.custom_prebuilt_domain_name = kwargs.get('custom_prebuilt_domain_name', None) + self.custom_prebuilt_model_name = kwargs.get('custom_prebuilt_model_name', None) + self.children = kwargs.get('children', None) + + class OperationError(Model): """Operation error details when invoking an operation on the API. @@ -2000,10 +2125,11 @@ class PatternAnyEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -2541,10 +2667,11 @@ class PrebuiltEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -2713,10 +2840,11 @@ class RegexEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_models_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_models_py3.py index 3a78500b5f8e..82a4d42e05fe 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_models_py3.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/models/_models_py3.py @@ -336,6 +336,20 @@ class ChildEntity(Model): :type id: str :param name: The name of a child entity. :type name: str + :param instance_of: Instance of Model. + :type instance_of: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Possible values include: 'Entity Extractor', 'Child + Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child + Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', + 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param children: List of children + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] """ _validation = { @@ -345,12 +359,45 @@ class ChildEntity(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, } - def __init__(self, *, id: str, name: str=None, **kwargs) -> None: + def __init__(self, *, id: str, name: str=None, instance_of: str=None, type_id: int=None, readable_type=None, children=None, **kwargs) -> None: super(ChildEntity, self).__init__(**kwargs) self.id = id self.name = name + self.instance_of = instance_of + self.type_id = type_id + self.readable_type = readable_type + self.children = children + + +class ChildEntityModelCreateObject(Model): + """A child entity extractor create object. + + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + } + + def __init__(self, *, children=None, name: str=None, instance_of: str=None, **kwargs) -> None: + super(ChildEntityModelCreateObject, self).__init__(**kwargs) + self.children = children + self.name = name + self.instance_of = instance_of class ClosedList(Model): @@ -390,10 +437,11 @@ class ClosedListEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -531,10 +579,11 @@ class CompositeEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -601,10 +650,11 @@ class CustomPrebuiltModel(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param custom_prebuilt_domain_name: The domain name. @@ -752,10 +802,11 @@ class EntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -807,9 +858,9 @@ class EntityLabel(Model): :param end_token_index: Required. The index within the utterance where the extracted entity ends. :type end_token_index: int - :param role: The role of the entity within the utterance. + :param role: The role of the predicted entity. :type role: str - :param role_id: The role Id. + :param role_id: The role id for the predicted entity. :type role_id: str """ @@ -850,7 +901,7 @@ class EntityLabelObject(Model): :param end_char_index: Required. The index within the utterance where the extracted entity ends. :type end_char_index: int - :param role: The role of the entity within the utterance. + :param role: The role the entity plays in the utterance. :type role: str """ @@ -875,6 +926,27 @@ def __init__(self, *, entity_name: str, start_char_index: int, end_char_index: i self.role = role +class EntityModelCreateObject(Model): + """An entity extractor create object. + + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :param name: Entity name. + :type name: str + """ + + _attribute_map = { + 'children': {'key': 'children', 'type': '[ChildEntityModelCreateObject]'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, children=None, name: str=None, **kwargs) -> None: + super(EntityModelCreateObject, self).__init__(**kwargs) + self.children = children + self.name = name + + class ModelInfo(Model): """Base type used in entity types. @@ -887,10 +959,11 @@ class ModelInfo(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum """ @@ -927,10 +1000,11 @@ class EntityModelInfo(ModelInfo): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -956,6 +1030,26 @@ def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, self.roles = roles +class EntityModelUpdateObject(Model): + """An entity extractor update object. + + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, instance_of: str=None, **kwargs) -> None: + super(EntityModelUpdateObject, self).__init__(**kwargs) + self.name = name + self.instance_of = instance_of + + class EntityPrediction(Model): """A suggested entity. @@ -1214,15 +1308,20 @@ class HierarchicalChildEntity(ChildEntity): :type id: str :param name: The name of a child entity. :type name: str + :param instance_of: Instance of Model. + :type instance_of: str :param type_id: The type ID of the Entity Model. :type type_id: int - :param readable_type: Possible values include: 'Entity Extractor', - 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - 'Composite Entity Extractor', 'List Entity Extractor', 'Prebuilt Entity - Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Closed - List Entity Extractor', 'Regex Entity Extractor' + :param readable_type: Possible values include: 'Entity Extractor', 'Child + Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child + Entity Extractor', 'Composite Entity Extractor', 'List Entity Extractor', + 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum + :param children: List of children + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] """ _validation = { @@ -1232,30 +1331,14 @@ class HierarchicalChildEntity(ChildEntity): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'instance_of': {'key': 'instanceOf', 'type': 'str'}, 'type_id': {'key': 'typeId', 'type': 'int'}, 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, } - def __init__(self, *, id: str, name: str=None, type_id: int=None, readable_type=None, **kwargs) -> None: - super(HierarchicalChildEntity, self).__init__(id=id, name=name, **kwargs) - self.type_id = type_id - self.readable_type = readable_type - - -class HierarchicalChildModelCreateObject(Model): - """HierarchicalChildModelCreateObject. - - :param name: - :type name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, **kwargs) -> None: - super(HierarchicalChildModelCreateObject, self).__init__(**kwargs) - self.name = name + def __init__(self, *, id: str, name: str=None, instance_of: str=None, type_id: int=None, readable_type=None, children=None, **kwargs) -> None: + super(HierarchicalChildEntity, self).__init__(id=id, name=name, instance_of=instance_of, type_id=type_id, readable_type=readable_type, children=children, **kwargs) class HierarchicalChildModelUpdateObject(Model): @@ -1286,10 +1369,11 @@ class HierarchicalEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -1324,26 +1408,6 @@ def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, self.children = children -class HierarchicalEntityModel(Model): - """A hierarchical entity extractor. - - :param children: Child entities. - :type children: list[str] - :param name: Entity name. - :type name: str - """ - - _attribute_map = { - 'children': {'key': 'children', 'type': '[str]'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, children=None, name: str=None, **kwargs) -> None: - super(HierarchicalEntityModel, self).__init__(**kwargs) - self.children = children - self.name = name - - class HierarchicalModel(Model): """HierarchicalModel. @@ -1385,10 +1449,11 @@ class IntentClassifier(ModelInfo): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param custom_prebuilt_domain_name: The domain name. @@ -1481,7 +1546,7 @@ class JSONEntity(Model): :type end_pos: int :param entity: Required. The entity name. :type entity: str - :param role: The role of the entity within the utterance. + :param role: The role the entity plays in the utterance. :type role: str """ @@ -1791,10 +1856,11 @@ class ModelInfoResponse(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -1922,6 +1988,65 @@ def __init__(self, *, name: str=None, **kwargs) -> None: self.name = name +class NDepthEntityExtractor(Model): + """N-Depth Entity Extractor. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the Entity Model. + :type id: str + :param name: Name of the Entity Model. + :type name: str + :param type_id: The type ID of the Entity Model. + :type type_id: int + :param readable_type: Required. Possible values include: 'Entity + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' + :type readable_type: str or + ~azure.cognitiveservices.language.luis.authoring.models.enum + :param roles: + :type roles: + list[~azure.cognitiveservices.language.luis.authoring.models.EntityRole] + :param custom_prebuilt_domain_name: The domain name. + :type custom_prebuilt_domain_name: str + :param custom_prebuilt_model_name: The intent name or entity name. + :type custom_prebuilt_model_name: str + :param children: + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntity] + """ + + _validation = { + 'id': {'required': True}, + 'readable_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type_id': {'key': 'typeId', 'type': 'int'}, + 'readable_type': {'key': 'readableType', 'type': 'str'}, + 'roles': {'key': 'roles', 'type': '[EntityRole]'}, + 'custom_prebuilt_domain_name': {'key': 'customPrebuiltDomainName', 'type': 'str'}, + 'custom_prebuilt_model_name': {'key': 'customPrebuiltModelName', 'type': 'str'}, + 'children': {'key': 'children', 'type': '[ChildEntity]'}, + } + + def __init__(self, *, id: str, readable_type, name: str=None, type_id: int=None, roles=None, custom_prebuilt_domain_name: str=None, custom_prebuilt_model_name: str=None, children=None, **kwargs) -> None: + super(NDepthEntityExtractor, self).__init__(**kwargs) + self.id = id + self.name = name + self.type_id = type_id + self.readable_type = readable_type + self.roles = roles + self.custom_prebuilt_domain_name = custom_prebuilt_domain_name + self.custom_prebuilt_model_name = custom_prebuilt_model_name + self.children = children + + class OperationError(Model): """Operation error details when invoking an operation on the API. @@ -2000,10 +2125,11 @@ class PatternAnyEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -2541,10 +2667,11 @@ class PrebuiltEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: @@ -2713,10 +2840,11 @@ class RegexEntityExtractor(Model): :param type_id: The type ID of the Entity Model. :type type_id: int :param readable_type: Required. Possible values include: 'Entity - Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity - Extractor', 'Composite Entity Extractor', 'List Entity Extractor', - 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity - Extractor', 'Closed List Entity Extractor', 'Regex Entity Extractor' + Extractor', 'Child Entity Extractor', 'Hierarchical Entity Extractor', + 'Hierarchical Child Entity Extractor', 'Composite Entity Extractor', 'List + Entity Extractor', 'Prebuilt Entity Extractor', 'Intent Classifier', + 'Pattern.Any Entity Extractor', 'Closed List Entity Extractor', 'Regex + Entity Extractor' :type readable_type: str or ~azure.cognitiveservices.language.luis.authoring.models.enum :param roles: diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_features_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_features_operations.py index edf56aad0006..ad1ba935d61c 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_features_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_features_operations.py @@ -35,6 +35,71 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def create_pattern_feature( + self, app_id, version_id, pattern=None, name=None, custom_headers=None, raw=False, **operation_config): + """[DEPRECATED NOTICE: This operation will soon be removed] Creates a new + pattern feature in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param pattern: The Regular Expression to match. + :type pattern: str + :param name: Name of the 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`. + :return: int or ClientRawResponse if raw=true + :rtype: int or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + pattern_create_object = models.PatternCreateObject(pattern=pattern, name=name) + + # Construct URL + url = self.create_pattern_feature.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(pattern_create_object, 'PatternCreateObject') + + # 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 + create_pattern_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/patterns'} + def list_application_version_pattern_features( self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): """[DEPRECATED NOTICE: This operation will soon be removed] Gets all the @@ -295,6 +360,197 @@ def list( return deserialized list.metadata = {'url': '/apps/{appId}/versions/{versionId}/features'} + def get_pattern_feature_info( + self, app_id, version_id, pattern_id, custom_headers=None, raw=False, **operation_config): + """[DEPRECATED NOTICE: This operation will soon be removed] Gets the + specified pattern feature's info in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param pattern_id: The pattern feature ID. + :type pattern_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`. + :return: PatternFeatureInfo or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.PatternFeatureInfo + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_pattern_feature_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'), + 'patternId': self._serialize.url("pattern_id", pattern_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.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('PatternFeatureInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_pattern_feature_info.metadata = {'url': '/apps/{appId}/versions/{versionId}/patterns/{patternId}'} + + def update_pattern_feature( + self, app_id, version_id, pattern_id, pattern_update_object, custom_headers=None, raw=False, **operation_config): + """[DEPRECATED NOTICE: This operation will soon be removed] Updates the + pattern, the name and the state of the pattern feature in a version of + the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param pattern_id: The pattern feature ID. + :type pattern_id: int + :param pattern_update_object: The new values for: - Just a boolean + called IsActive, in which case the status of the feature will be + changed. - Name, Pattern and a boolean called IsActive to update the + feature. + :type pattern_update_object: + ~azure.cognitiveservices.language.luis.authoring.models.PatternUpdateObject + :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`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.update_pattern_feature.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'), + 'patternId': self._serialize.url("pattern_id", pattern_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(pattern_update_object, 'PatternUpdateObject') + + # 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_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/patterns/{patternId}'} + + def delete_pattern_feature( + self, app_id, version_id, pattern_id, custom_headers=None, raw=False, **operation_config): + """[DEPRECATED NOTICE: This operation will soon be removed] Deletes a + pattern feature in a version of the application. + + :param app_id: The application ID. + :type app_id: str + :param version_id: The version ID. + :type version_id: str + :param pattern_id: The pattern feature ID. + :type pattern_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`. + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_pattern_feature.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'), + 'patternId': self._serialize.url("pattern_id", pattern_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_pattern_feature.metadata = {'url': '/apps/{appId}/versions/{versionId}/patterns/{patternId}'} + def get_phrase_list( self, app_id, version_id, phraselist_id, custom_headers=None, raw=False, **operation_config): """Gets phraselist feature info in a version of the application. diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_model_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_model_operations.py index 1cebef17b8a1..fed9d240ca88 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_model_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_model_operations.py @@ -164,14 +164,17 @@ def list_intents( list_intents.metadata = {'url': '/apps/{appId}/versions/{versionId}/intents'} def add_entity( - self, app_id, version_id, name=None, custom_headers=None, raw=False, **operation_config): - """Adds a simple entity extractor to a version of the application. + self, app_id, version_id, children=None, name=None, custom_headers=None, raw=False, **operation_config): + """Adds an entity extractor to a version of 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. + :param children: Child entities. + :type children: + list[~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject] + :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 @@ -183,7 +186,7 @@ def add_entity( :raises: :class:`ErrorResponseException` """ - model_create_object = models.ModelCreateObject(name=name) + entity_model_create_object = models.EntityModelCreateObject(children=children, name=name) # Construct URL url = self.add_entity.metadata['url'] @@ -205,7 +208,7 @@ def add_entity( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(model_create_object, 'ModelCreateObject') + body_content = self._serialize.body(entity_model_create_object, 'EntityModelCreateObject') # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -246,7 +249,7 @@ def list_entities( overrides`. :return: list or ClientRawResponse if raw=true :rtype: - list[~azure.cognitiveservices.language.luis.authoring.models.EntityExtractor] + list[~azure.cognitiveservices.language.luis.authoring.models.NDepthEntityExtractor] or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -282,7 +285,7 @@ def list_entities( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('[EntityExtractor]', response) + deserialized = self._deserialize('[NDepthEntityExtractor]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -291,70 +294,6 @@ def list_entities( return deserialized list_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities'} - 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 a version of 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`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`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'} - def list_hierarchical_entities( self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): """Gets information about all the hierarchical entity models in a version @@ -421,70 +360,6 @@ def list_hierarchical_entities( return deserialized list_hierarchical_entities.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities'} - 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 a version of 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`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`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'} - def list_composite_entities( self, app_id, version_id, skip=0, take=100, custom_headers=None, raw=False, **operation_config): """Gets information about all the composite entity models in a version of @@ -1210,9 +1085,9 @@ def get_entity( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: EntityExtractor or ClientRawResponse if raw=true + :return: NDepthEntityExtractor or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.EntityExtractor + ~azure.cognitiveservices.language.luis.authoring.models.NDepthEntityExtractor or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -1245,7 +1120,7 @@ def get_entity( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('EntityExtractor', response) + deserialized = self._deserialize('NDepthEntityExtractor', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -1254,18 +1129,17 @@ def get_entity( return deserialized get_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} - 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 in a version of the application. + def delete_entity( + self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): + """Deletes an entity or a child from a version of 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. + :param entity_id: The entity extractor or the child 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 @@ -1278,10 +1152,8 @@ def update_entity( :raises: :class:`ErrorResponseException` """ - model_update_object = models.ModelUpdateObject(name=name) - # Construct URL - url = self.update_entity.metadata['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'), @@ -1296,15 +1168,11 @@ def update_entity( # 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) + 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]: @@ -1319,18 +1187,24 @@ def update_entity( return client_raw_response return deserialized - update_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} + delete_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} - def delete_entity( - self, app_id, version_id, entity_id, custom_headers=None, raw=False, **operation_config): - """Deletes an entity from a version of the application. + def update_entity_child( + self, app_id, version_id, entity_id, name=None, instance_of=None, custom_headers=None, raw=False, **operation_config): + """Updates the name of an entity extractor or the name and instanceOf + model of a child 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. + :param entity_id: The entity extractor or the child entity extractor + ID. :type entity_id: str + :param name: Entity name. + :type name: str + :param instance_of: The instance of model name + :type instance_of: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -1343,8 +1217,10 @@ def delete_entity( :raises: :class:`ErrorResponseException` """ + entity_model_update_object = models.EntityModelUpdateObject(name=name, instance_of=instance_of) + # Construct URL - url = self.delete_entity.metadata['url'] + url = self.update_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'), @@ -1359,11 +1235,15 @@ def delete_entity( # 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_model_update_object, 'EntityModelUpdateObject') + # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + 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]: @@ -1378,7 +1258,7 @@ def delete_entity( return client_raw_response return deserialized - delete_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} + update_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}'} def get_hierarchical_entity( self, app_id, version_id, h_entity_id, custom_headers=None, raw=False, **operation_config): @@ -1441,9 +1321,9 @@ def get_hierarchical_entity( get_hierarchical_entity.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}'} 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 in a - version of the application. + self, app_id, version_id, h_entity_id, name=None, custom_headers=None, raw=False, **operation_config): + """Updates the name of a hierarchical entity model in a version of the + application. :param app_id: The application ID. :type app_id: str @@ -1451,9 +1331,7 @@ def update_hierarchical_entity( :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. + :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 @@ -1467,7 +1345,7 @@ def update_hierarchical_entity( :raises: :class:`ErrorResponseException` """ - hierarchical_model_update_object = models.HierarchicalEntityModel(children=children, name=name) + model_update_object = models.ModelUpdateObject(name=name) # Construct URL url = self.update_hierarchical_entity.metadata['url'] @@ -1490,10 +1368,10 @@ def update_hierarchical_entity( header_parameters.update(custom_headers) # Construct body - body_content = self._serialize.body(hierarchical_model_update_object, 'HierarchicalEntityModel') + body_content = self._serialize.body(model_update_object, 'ModelUpdateObject') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + 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]: @@ -2888,39 +2766,38 @@ def delete_custom_prebuilt_domain( return deserialized delete_custom_prebuilt_domain.metadata = {'url': '/apps/{appId}/versions/{versionId}/customprebuiltdomains/{domainName}'} - 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 child's model contained in an hierarchical - entity child model in a version of the application. + def add_entity_child( + self, app_id, version_id, entity_id, child_entity_model_create_object, custom_headers=None, raw=False, **operation_config): + """Creates a single child in an existing entity model hierarchy in a + version of 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 entity_id: The entity extractor ID. + :type entity_id: str + :param child_entity_model_create_object: A model object containing the + name of the new child model and its children. + :type child_entity_model_create_object: + ~azure.cognitiveservices.language.luis.authoring.models.ChildEntityModelCreateObject :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`. - :return: HierarchicalChildEntity or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.HierarchicalChildEntity - or ~msrest.pipeline.ClientRawResponse + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ # Construct URL - url = self.get_hierarchical_entity_child.metadata['url'] + url = self.add_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') + 'entityId': self._serialize.url("entity_id", entity_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2930,31 +2807,35 @@ def get_hierarchical_entity_child( # 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(child_entity_model_create_object, 'ChildEntityModelCreateObject') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + 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 [200]: + if response.status_code not in [201]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('HierarchicalChildEntity', response) + if response.status_code == 201: + deserialized = self._deserialize('str', 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}'} + add_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/entities/{entityId}/children'} - 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 in a - version of the application. + 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 child's model contained in an hierarchical + entity child model in a version of the application. :param app_id: The application ID. :type app_id: str @@ -2964,24 +2845,20 @@ def update_hierarchical_entity_child( :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`. - :return: OperationStatus or ClientRawResponse if raw=true + :return: HierarchicalChildEntity or ClientRawResponse if raw=true :rtype: - ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + ~azure.cognitiveservices.language.luis.authoring.models.HierarchicalChildEntity or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - hierarchical_child_model_update_object = models.HierarchicalChildModelUpdateObject(name=name) - # Construct URL - url = self.update_hierarchical_entity_child.metadata['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'), @@ -2997,15 +2874,11 @@ def update_hierarchical_entity_child( # 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) + 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]: @@ -3013,19 +2886,19 @@ def update_hierarchical_entity_child( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('OperationStatus', response) + deserialized = self._deserialize('HierarchicalChildEntity', 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}'} + get_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} - 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 in a version of the - application. + 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 in a + version of the application. :param app_id: The application ID. :type app_id: str @@ -3035,6 +2908,8 @@ def delete_hierarchical_entity_child( :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 @@ -3047,8 +2922,10 @@ def delete_hierarchical_entity_child( :raises: :class:`ErrorResponseException` """ + hierarchical_child_model_update_object = models.HierarchicalChildModelUpdateObject(name=name) + # Construct URL - url = self.delete_hierarchical_entity_child.metadata['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'), @@ -3064,11 +2941,15 @@ def delete_hierarchical_entity_child( # 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.delete(url, query_parameters, header_parameters) + 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]: @@ -3083,12 +2964,12 @@ def delete_hierarchical_entity_child( return client_raw_response return deserialized - delete_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} + update_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} - 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 in a - version of the application. + 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 in a version of the + application. :param app_id: The application ID. :type app_id: str @@ -3096,27 +2977,28 @@ def add_hierarchical_entity_child( :type version_id: str :param h_entity_id: The hierarchical entity extractor ID. :type h_entity_id: str - :param name: - :type name: 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`. - :return: str or ClientRawResponse if raw=true - :rtype: str or ~msrest.pipeline.ClientRawResponse + :return: OperationStatus or ClientRawResponse if raw=true + :rtype: + ~azure.cognitiveservices.language.luis.authoring.models.OperationStatus + or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - hierarchical_child_model_create_object = models.HierarchicalChildModelCreateObject(name=name) - # Construct URL - url = self.add_hierarchical_entity_child.metadata['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') + '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) @@ -3126,30 +3008,26 @@ def add_hierarchical_entity_child( # 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) + request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 201: - deserialized = self._deserialize('str', response) + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', 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'} + delete_hierarchical_entity_child.metadata = {'url': '/apps/{appId}/versions/{versionId}/hierarchicalentities/{hEntityId}/children/{hChildId}'} def add_composite_entity_child( self, app_id, version_id, c_entity_id, name=None, custom_headers=None, raw=False, **operation_config):