From cc0931bc08a2348b122dd037f53dfbcc7b62c961 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 25 Oct 2019 23:15:47 +0000 Subject: [PATCH] Generated from 875b9efa876672fdbdf19e3644e024af9f420f76 update pii description to use personal information --- .../language/textanalytics/__init__.py | 7 +- .../language/textanalytics/_configuration.py | 47 ++ .../textanalytics/_text_analytics_client.py | 45 ++ .../language/textanalytics/models/__init__.py | 104 +-- .../language/textanalytics/models/_models.py | 624 ++++++++++++++++++ .../textanalytics/models/_models_py3.py | 624 ++++++++++++++++++ .../textanalytics/models/detected_language.py | 38 -- .../models/detected_language_py3.py | 38 -- .../models/document_statistics.py | 33 - .../models/document_statistics_py3.py | 33 - .../models/entities_batch_result.py | 49 -- .../models/entities_batch_result_item.py | 46 -- .../models/entities_batch_result_item_py3.py | 46 -- .../models/entities_batch_result_py3.py | 49 -- .../textanalytics/models/entity_record.py | 67 -- .../textanalytics/models/entity_record_py3.py | 67 -- .../textanalytics/models/error_record.py | 32 - .../textanalytics/models/error_record_py3.py | 32 - .../textanalytics/models/error_response.py | 54 -- .../models/error_response_py3.py | 54 -- .../textanalytics/models/internal_error.py | 37 -- .../models/internal_error_py3.py | 37 -- .../models/key_phrase_batch_result.py | 49 -- .../models/key_phrase_batch_result_item.py | 47 -- .../key_phrase_batch_result_item_py3.py | 47 -- .../models/key_phrase_batch_result_py3.py | 49 -- .../models/language_batch_input.py | 29 - .../models/language_batch_input_py3.py | 29 - .../models/language_batch_result.py | 49 -- .../models/language_batch_result_item.py | 39 -- .../models/language_batch_result_item_py3.py | 39 -- .../models/language_batch_result_py3.py | 49 -- .../textanalytics/models/language_input.py | 36 - .../models/language_input_py3.py | 36 - .../textanalytics/models/match_record.py | 49 -- .../textanalytics/models/match_record_py3.py | 49 -- .../models/multi_language_batch_input.py | 29 - .../models/multi_language_batch_input_py3.py | 29 - .../models/multi_language_input.py | 37 -- .../models/multi_language_input_py3.py | 37 -- .../models/request_statistics.py | 42 -- .../models/request_statistics_py3.py | 42 -- .../models/sentiment_batch_result.py | 49 -- .../models/sentiment_batch_result_item.py | 41 -- .../models/sentiment_batch_result_item_py3.py | 41 -- .../models/sentiment_batch_result_py3.py | 49 -- .../textanalytics/operations/__init__.py | 16 + .../_text_analytics_client_operations.py} | 65 +- 48 files changed, 1414 insertions(+), 1822 deletions(-) create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_configuration.py create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_text_analytics_client.py create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models.py create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py delete mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py create mode 100644 sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/__init__.py rename sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/{text_analytics_client.py => operations/_text_analytics_client_operations.py} (83%) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/__init__.py index 9a75fc1a0e69..48d59a14cb3c 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .text_analytics_client import TextAnalyticsClient -from .version import VERSION +from ._configuration import TextAnalyticsClientConfiguration +from ._text_analytics_client import TextAnalyticsClient +__all__ = ['TextAnalyticsClient', 'TextAnalyticsClientConfiguration'] -__all__ = ['TextAnalyticsClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_configuration.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_configuration.py new file mode 100644 index 000000000000..16425e6ca7d2 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_configuration.py @@ -0,0 +1,47 @@ +# 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 import Configuration + +from .version import VERSION + + +class TextAnalyticsClientConfiguration(Configuration): + """Configuration for TextAnalyticsClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Supported Cognitive Services endpoints (protocol and + hostname, for example: https://westus.api.cognitive.microsoft.com). + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + base_url = '{Endpoint}/text/analytics/v2.1' + + super(TextAnalyticsClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-cognitiveservices-language-textanalytics/{}'.format(VERSION)) + + self.endpoint = endpoint + self.credentials = credentials diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_text_analytics_client.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_text_analytics_client.py new file mode 100644 index 000000000000..7a73bb743a94 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/_text_analytics_client.py @@ -0,0 +1,45 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import TextAnalyticsClientConfiguration +from .operations import TextAnalyticsClientOperationsMixin +from msrest.exceptions import HttpOperationError +from . import models + + +class TextAnalyticsClient(TextAnalyticsClientOperationsMixin, SDKClient): + """The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview + + :ivar config: Configuration for client. + :vartype config: TextAnalyticsClientConfiguration + + :param endpoint: Supported Cognitive Services endpoints (protocol and + hostname, for example: https://westus.api.cognitive.microsoft.com). + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + self.config = TextAnalyticsClientConfiguration(endpoint, credentials) + super(TextAnalyticsClient, 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 = 'v2.1' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py index be4003cc1ae8..b18493ebd46c 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/__init__.py @@ -10,67 +10,67 @@ # -------------------------------------------------------------------------- try: - from .multi_language_input_py3 import MultiLanguageInput - from .multi_language_batch_input_py3 import MultiLanguageBatchInput - from .match_record_py3 import MatchRecord - from .entity_record_py3 import EntityRecord - from .document_statistics_py3 import DocumentStatistics - from .entities_batch_result_item_py3 import EntitiesBatchResultItem - from .error_record_py3 import ErrorRecord - from .request_statistics_py3 import RequestStatistics - from .entities_batch_result_py3 import EntitiesBatchResult - from .internal_error_py3 import InternalError - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .key_phrase_batch_result_item_py3 import KeyPhraseBatchResultItem - from .key_phrase_batch_result_py3 import KeyPhraseBatchResult - from .language_input_py3 import LanguageInput - from .language_batch_input_py3 import LanguageBatchInput - from .detected_language_py3 import DetectedLanguage - from .language_batch_result_item_py3 import LanguageBatchResultItem - from .language_batch_result_py3 import LanguageBatchResult - from .sentiment_batch_result_item_py3 import SentimentBatchResultItem - from .sentiment_batch_result_py3 import SentimentBatchResult + from ._models_py3 import DetectedLanguage + from ._models_py3 import DocumentStatistics + from ._models_py3 import EntitiesBatchResult + from ._models_py3 import EntitiesBatchResultItem + from ._models_py3 import EntityRecord + from ._models_py3 import ErrorRecord + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import InternalError + from ._models_py3 import KeyPhraseBatchResult + from ._models_py3 import KeyPhraseBatchResultItem + from ._models_py3 import LanguageBatchInput + from ._models_py3 import LanguageBatchResult + from ._models_py3 import LanguageBatchResultItem + from ._models_py3 import LanguageInput + from ._models_py3 import MatchRecord + from ._models_py3 import MultiLanguageBatchInput + from ._models_py3 import MultiLanguageInput + from ._models_py3 import RequestStatistics + from ._models_py3 import SentimentBatchResult + from ._models_py3 import SentimentBatchResultItem except (SyntaxError, ImportError): - from .multi_language_input import MultiLanguageInput - from .multi_language_batch_input import MultiLanguageBatchInput - from .match_record import MatchRecord - from .entity_record import EntityRecord - from .document_statistics import DocumentStatistics - from .entities_batch_result_item import EntitiesBatchResultItem - from .error_record import ErrorRecord - from .request_statistics import RequestStatistics - from .entities_batch_result import EntitiesBatchResult - from .internal_error import InternalError - from .error_response import ErrorResponse, ErrorResponseException - from .key_phrase_batch_result_item import KeyPhraseBatchResultItem - from .key_phrase_batch_result import KeyPhraseBatchResult - from .language_input import LanguageInput - from .language_batch_input import LanguageBatchInput - from .detected_language import DetectedLanguage - from .language_batch_result_item import LanguageBatchResultItem - from .language_batch_result import LanguageBatchResult - from .sentiment_batch_result_item import SentimentBatchResultItem - from .sentiment_batch_result import SentimentBatchResult + from ._models import DetectedLanguage + from ._models import DocumentStatistics + from ._models import EntitiesBatchResult + from ._models import EntitiesBatchResultItem + from ._models import EntityRecord + from ._models import ErrorRecord + from ._models import ErrorResponse, ErrorResponseException + from ._models import InternalError + from ._models import KeyPhraseBatchResult + from ._models import KeyPhraseBatchResultItem + from ._models import LanguageBatchInput + from ._models import LanguageBatchResult + from ._models import LanguageBatchResultItem + from ._models import LanguageInput + from ._models import MatchRecord + from ._models import MultiLanguageBatchInput + from ._models import MultiLanguageInput + from ._models import RequestStatistics + from ._models import SentimentBatchResult + from ._models import SentimentBatchResultItem __all__ = [ - 'MultiLanguageInput', - 'MultiLanguageBatchInput', - 'MatchRecord', - 'EntityRecord', + 'DetectedLanguage', 'DocumentStatistics', + 'EntitiesBatchResult', 'EntitiesBatchResultItem', + 'EntityRecord', 'ErrorRecord', - 'RequestStatistics', - 'EntitiesBatchResult', - 'InternalError', 'ErrorResponse', 'ErrorResponseException', - 'KeyPhraseBatchResultItem', + 'InternalError', 'KeyPhraseBatchResult', - 'LanguageInput', + 'KeyPhraseBatchResultItem', 'LanguageBatchInput', - 'DetectedLanguage', - 'LanguageBatchResultItem', 'LanguageBatchResult', - 'SentimentBatchResultItem', + 'LanguageBatchResultItem', + 'LanguageInput', + 'MatchRecord', + 'MultiLanguageBatchInput', + 'MultiLanguageInput', + 'RequestStatistics', 'SentimentBatchResult', + 'SentimentBatchResultItem', ] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models.py new file mode 100644 index 000000000000..97fedd5172d0 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models.py @@ -0,0 +1,624 @@ +# 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.serialization import Model +from msrest.exceptions import HttpOperationError + + +class DetectedLanguage(Model): + """DetectedLanguage. + + :param name: Long name of a detected language (e.g. English, French). + :type name: str + :param iso6391_name: A two letter representation of the detected language + according to the ISO 639-1 standard (e.g. en, fr). + :type iso6391_name: str + :param score: A confidence score between 0 and 1. Scores close to 1 + indicate 100% certainty that the identified language is true. + :type score: float + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DetectedLanguage, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.iso6391_name = kwargs.get('iso6391_name', None) + self.score = kwargs.get('score', None) + + +class DocumentStatistics(Model): + """DocumentStatistics. + + :param characters_count: Number of text elements recognized in the + document. + :type characters_count: int + :param transactions_count: Number of transactions for the document. + :type transactions_count: int + """ + + _attribute_map = { + 'characters_count': {'key': 'charactersCount', 'type': 'int'}, + 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DocumentStatistics, self).__init__(**kwargs) + self.characters_count = kwargs.get('characters_count', None) + self.transactions_count = kwargs.get('transactions_count', None) + + +class EntitiesBatchResult(Model): + """EntitiesBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: Response by document + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItem] + :ivar errors: Errors and Warnings by document + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + :ivar statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the request payload. + :vartype statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + 'statistics': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + } + + def __init__(self, **kwargs): + super(EntitiesBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None + self.statistics = None + + +class EntitiesBatchResultItem(Model): + """EntitiesBatchResultItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Unique, non-empty document identifier. + :type id: str + :ivar entities: Recognized entities in the document. + :vartype entities: + list[~azure.cognitiveservices.language.textanalytics.models.EntityRecord] + :param statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'entities': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[EntityRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(EntitiesBatchResultItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.entities = None + self.statistics = kwargs.get('statistics', None) + + +class EntityRecord(Model): + """EntityRecord. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Entity formal name. + :type name: str + :param matches: List of instances this entity appears in the text. + :type matches: + list[~azure.cognitiveservices.language.textanalytics.models.MatchRecord] + :param wikipedia_language: Wikipedia language for which the WikipediaId + and WikipediaUrl refers to. + :type wikipedia_language: str + :param wikipedia_id: Wikipedia unique identifier of the recognized entity. + :type wikipedia_id: str + :ivar wikipedia_url: URL for the entity's Wikipedia page. + :vartype wikipedia_url: str + :param bing_id: Bing unique identifier of the recognized entity. Use in + conjunction with the Bing Entity Search API to fetch additional relevant + information. + :type bing_id: str + :param type: Entity type from Named Entity Recognition model + :type type: str + :param sub_type: Entity sub type from Named Entity Recognition model + :type sub_type: str + """ + + _validation = { + 'wikipedia_url': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'matches': {'key': 'matches', 'type': '[MatchRecord]'}, + 'wikipedia_language': {'key': 'wikipediaLanguage', 'type': 'str'}, + 'wikipedia_id': {'key': 'wikipediaId', 'type': 'str'}, + 'wikipedia_url': {'key': 'wikipediaUrl', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sub_type': {'key': 'subType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EntityRecord, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.matches = kwargs.get('matches', None) + self.wikipedia_language = kwargs.get('wikipedia_language', None) + self.wikipedia_id = kwargs.get('wikipedia_id', None) + self.wikipedia_url = None + self.bing_id = kwargs.get('bing_id', None) + self.type = kwargs.get('type', None) + self.sub_type = kwargs.get('sub_type', None) + + +class ErrorRecord(Model): + """ErrorRecord. + + :param id: Input document unique identifier the error refers to. + :type id: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorRecord, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.message = kwargs.get('message', None) + + +class ErrorResponse(Model): + """ErrorResponse. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param inner_error: + :type inner_error: + ~azure.cognitiveservices.language.textanalytics.models.InternalError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.inner_error = kwargs.get('inner_error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class InternalError(Model): + """InternalError. + + :param code: + :type code: str + :param message: + :type message: str + :param inner_error: + :type inner_error: + ~azure.cognitiveservices.language.textanalytics.models.InternalError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, + } + + def __init__(self, **kwargs): + super(InternalError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.inner_error = kwargs.get('inner_error', None) + + +class KeyPhraseBatchResult(Model): + """KeyPhraseBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: Response by document + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResultItem] + :ivar errors: Errors and Warnings by document + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + :ivar statistics: =(Optional) if showStats=true was specified in the + request this field will contain information about the request payload. + :vartype statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + 'statistics': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[KeyPhraseBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + } + + def __init__(self, **kwargs): + super(KeyPhraseBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None + self.statistics = None + + +class KeyPhraseBatchResultItem(Model): + """KeyPhraseBatchResultItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Unique, non-empty document identifier. + :type id: str + :ivar key_phrases: A list of representative words or phrases. The number + of key phrases returned is proportional to the number of words in the + input document. + :vartype key_phrases: list[str] + :param statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'key_phrases': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(KeyPhraseBatchResultItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.key_phrases = None + self.statistics = kwargs.get('statistics', None) + + +class LanguageBatchInput(Model): + """LanguageBatchInput. + + :param documents: + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] + """ + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, + } + + def __init__(self, **kwargs): + super(LanguageBatchInput, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + + +class LanguageBatchResult(Model): + """LanguageBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: Response by document + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.LanguageBatchResultItem] + :ivar errors: Errors and Warnings by document + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + :ivar statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the request payload. + :vartype statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + 'statistics': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[LanguageBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + } + + def __init__(self, **kwargs): + super(LanguageBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None + self.statistics = None + + +class LanguageBatchResultItem(Model): + """LanguageBatchResultItem. + + :param id: Unique, non-empty document identifier. + :type id: str + :param detected_languages: A list of extracted languages. + :type detected_languages: + list[~azure.cognitiveservices.language.textanalytics.models.DetectedLanguage] + :param statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(LanguageBatchResultItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.detected_languages = kwargs.get('detected_languages', None) + self.statistics = kwargs.get('statistics', None) + + +class LanguageInput(Model): + """LanguageInput. + + :param country_hint: + :type country_hint: str + :param id: Unique, non-empty document identifier. + :type id: str + :param text: + :type text: str + """ + + _attribute_map = { + 'country_hint': {'key': 'countryHint', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LanguageInput, self).__init__(**kwargs) + self.country_hint = kwargs.get('country_hint', None) + self.id = kwargs.get('id', None) + self.text = kwargs.get('text', None) + + +class MatchRecord(Model): + """MatchRecord. + + :param wikipedia_score: (optional) If a well-known item with Wikipedia + link is recognized, a decimal number denoting the confidence level of the + Wikipedia info will be returned. + :type wikipedia_score: float + :param entity_type_score: (optional) If an entity type is recognized, a + decimal number denoting the confidence level of the entity type will be + returned. + :type entity_type_score: float + :param text: Entity text as appears in the request. + :type text: str + :param offset: Start position (in Unicode characters) for the entity match + text. + :type offset: int + :param length: Length (in Unicode characters) for the entity match text. + :type length: int + """ + + _attribute_map = { + 'wikipedia_score': {'key': 'wikipediaScore', 'type': 'float'}, + 'entity_type_score': {'key': 'entityTypeScore', 'type': 'float'}, + 'text': {'key': 'text', 'type': 'str'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(MatchRecord, self).__init__(**kwargs) + self.wikipedia_score = kwargs.get('wikipedia_score', None) + self.entity_type_score = kwargs.get('entity_type_score', None) + self.text = kwargs.get('text', None) + self.offset = kwargs.get('offset', None) + self.length = kwargs.get('length', None) + + +class MultiLanguageBatchInput(Model): + """MultiLanguageBatchInput. + + :param documents: + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + """ + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, + } + + def __init__(self, **kwargs): + super(MultiLanguageBatchInput, self).__init__(**kwargs) + self.documents = kwargs.get('documents', None) + + +class MultiLanguageInput(Model): + """MultiLanguageInput. + + :param language: This is the 2 letter ISO 639-1 representation of a + language. For example, use "en" for English; "es" for Spanish etc., + :type language: str + :param id: Unique, non-empty document identifier. + :type id: str + :param text: + :type text: str + """ + + _attribute_map = { + 'language': {'key': 'language', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MultiLanguageInput, self).__init__(**kwargs) + self.language = kwargs.get('language', None) + self.id = kwargs.get('id', None) + self.text = kwargs.get('text', None) + + +class RequestStatistics(Model): + """RequestStatistics. + + :param documents_count: Number of documents submitted in the request. + :type documents_count: int + :param valid_documents_count: Number of valid documents. This excludes + empty, over-size limit or non-supported languages documents. + :type valid_documents_count: int + :param erroneous_documents_count: Number of invalid documents. This + includes empty, over-size limit or non-supported languages documents. + :type erroneous_documents_count: int + :param transactions_count: Number of transactions for the request. + :type transactions_count: long + """ + + _attribute_map = { + 'documents_count': {'key': 'documentsCount', 'type': 'int'}, + 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, + 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, + 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(RequestStatistics, self).__init__(**kwargs) + self.documents_count = kwargs.get('documents_count', None) + self.valid_documents_count = kwargs.get('valid_documents_count', None) + self.erroneous_documents_count = kwargs.get('erroneous_documents_count', None) + self.transactions_count = kwargs.get('transactions_count', None) + + +class SentimentBatchResult(Model): + """SentimentBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: Response by document + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.SentimentBatchResultItem] + :ivar errors: Errors and Warnings by document + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + :ivar statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the request payload. + :vartype statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + 'statistics': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[SentimentBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + } + + def __init__(self, **kwargs): + super(SentimentBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None + self.statistics = None + + +class SentimentBatchResultItem(Model): + """SentimentBatchResultItem. + + :param id: Unique, non-empty document identifier. + :type id: str + :param score: A decimal number between 0 and 1 denoting the sentiment of + the document. A score above 0.7 usually refers to a positive document + while a score below 0.3 normally has a negative connotation. Mid values + refer to neutral text. + :type score: float + :param statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, **kwargs): + super(SentimentBatchResultItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.score = kwargs.get('score', None) + self.statistics = kwargs.get('statistics', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models_py3.py new file mode 100644 index 000000000000..275a992ee563 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/_models_py3.py @@ -0,0 +1,624 @@ +# 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.serialization import Model +from msrest.exceptions import HttpOperationError + + +class DetectedLanguage(Model): + """DetectedLanguage. + + :param name: Long name of a detected language (e.g. English, French). + :type name: str + :param iso6391_name: A two letter representation of the detected language + according to the ISO 639-1 standard (e.g. en, fr). + :type iso6391_name: str + :param score: A confidence score between 0 and 1. Scores close to 1 + indicate 100% certainty that the identified language is true. + :type score: float + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + } + + def __init__(self, *, name: str=None, iso6391_name: str=None, score: float=None, **kwargs) -> None: + super(DetectedLanguage, self).__init__(**kwargs) + self.name = name + self.iso6391_name = iso6391_name + self.score = score + + +class DocumentStatistics(Model): + """DocumentStatistics. + + :param characters_count: Number of text elements recognized in the + document. + :type characters_count: int + :param transactions_count: Number of transactions for the document. + :type transactions_count: int + """ + + _attribute_map = { + 'characters_count': {'key': 'charactersCount', 'type': 'int'}, + 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, + } + + def __init__(self, *, characters_count: int=None, transactions_count: int=None, **kwargs) -> None: + super(DocumentStatistics, self).__init__(**kwargs) + self.characters_count = characters_count + self.transactions_count = transactions_count + + +class EntitiesBatchResult(Model): + """EntitiesBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: Response by document + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItem] + :ivar errors: Errors and Warnings by document + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + :ivar statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the request payload. + :vartype statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + 'statistics': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + } + + def __init__(self, **kwargs) -> None: + super(EntitiesBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None + self.statistics = None + + +class EntitiesBatchResultItem(Model): + """EntitiesBatchResultItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Unique, non-empty document identifier. + :type id: str + :ivar entities: Recognized entities in the document. + :vartype entities: + list[~azure.cognitiveservices.language.textanalytics.models.EntityRecord] + :param statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'entities': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'entities': {'key': 'entities', 'type': '[EntityRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str=None, statistics=None, **kwargs) -> None: + super(EntitiesBatchResultItem, self).__init__(**kwargs) + self.id = id + self.entities = None + self.statistics = statistics + + +class EntityRecord(Model): + """EntityRecord. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: Entity formal name. + :type name: str + :param matches: List of instances this entity appears in the text. + :type matches: + list[~azure.cognitiveservices.language.textanalytics.models.MatchRecord] + :param wikipedia_language: Wikipedia language for which the WikipediaId + and WikipediaUrl refers to. + :type wikipedia_language: str + :param wikipedia_id: Wikipedia unique identifier of the recognized entity. + :type wikipedia_id: str + :ivar wikipedia_url: URL for the entity's Wikipedia page. + :vartype wikipedia_url: str + :param bing_id: Bing unique identifier of the recognized entity. Use in + conjunction with the Bing Entity Search API to fetch additional relevant + information. + :type bing_id: str + :param type: Entity type from Named Entity Recognition model + :type type: str + :param sub_type: Entity sub type from Named Entity Recognition model + :type sub_type: str + """ + + _validation = { + 'wikipedia_url': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'matches': {'key': 'matches', 'type': '[MatchRecord]'}, + 'wikipedia_language': {'key': 'wikipediaLanguage', 'type': 'str'}, + 'wikipedia_id': {'key': 'wikipediaId', 'type': 'str'}, + 'wikipedia_url': {'key': 'wikipediaUrl', 'type': 'str'}, + 'bing_id': {'key': 'bingId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sub_type': {'key': 'subType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, matches=None, wikipedia_language: str=None, wikipedia_id: str=None, bing_id: str=None, type: str=None, sub_type: str=None, **kwargs) -> None: + super(EntityRecord, self).__init__(**kwargs) + self.name = name + self.matches = matches + self.wikipedia_language = wikipedia_language + self.wikipedia_id = wikipedia_id + self.wikipedia_url = None + self.bing_id = bing_id + self.type = type + self.sub_type = sub_type + + +class ErrorRecord(Model): + """ErrorRecord. + + :param id: Input document unique identifier the error refers to. + :type id: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, message: str=None, **kwargs) -> None: + super(ErrorRecord, self).__init__(**kwargs) + self.id = id + self.message = message + + +class ErrorResponse(Model): + """ErrorResponse. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param inner_error: + :type inner_error: + ~azure.cognitiveservices.language.textanalytics.models.InternalError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, inner_error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.inner_error = inner_error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class InternalError(Model): + """InternalError. + + :param code: + :type code: str + :param message: + :type message: str + :param inner_error: + :type inner_error: + ~azure.cognitiveservices.language.textanalytics.models.InternalError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, + } + + def __init__(self, *, code: str=None, message: str=None, inner_error=None, **kwargs) -> None: + super(InternalError, self).__init__(**kwargs) + self.code = code + self.message = message + self.inner_error = inner_error + + +class KeyPhraseBatchResult(Model): + """KeyPhraseBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: Response by document + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResultItem] + :ivar errors: Errors and Warnings by document + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + :ivar statistics: =(Optional) if showStats=true was specified in the + request this field will contain information about the request payload. + :vartype statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + 'statistics': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[KeyPhraseBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyPhraseBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None + self.statistics = None + + +class KeyPhraseBatchResultItem(Model): + """KeyPhraseBatchResultItem. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Unique, non-empty document identifier. + :type id: str + :ivar key_phrases: A list of representative words or phrases. The number + of key phrases returned is proportional to the number of words in the + input document. + :vartype key_phrases: list[str] + :param statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _validation = { + 'key_phrases': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str=None, statistics=None, **kwargs) -> None: + super(KeyPhraseBatchResultItem, self).__init__(**kwargs) + self.id = id + self.key_phrases = None + self.statistics = statistics + + +class LanguageBatchInput(Model): + """LanguageBatchInput. + + :param documents: + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] + """ + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, + } + + def __init__(self, *, documents=None, **kwargs) -> None: + super(LanguageBatchInput, self).__init__(**kwargs) + self.documents = documents + + +class LanguageBatchResult(Model): + """LanguageBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: Response by document + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.LanguageBatchResultItem] + :ivar errors: Errors and Warnings by document + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + :ivar statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the request payload. + :vartype statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + 'statistics': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[LanguageBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + } + + def __init__(self, **kwargs) -> None: + super(LanguageBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None + self.statistics = None + + +class LanguageBatchResultItem(Model): + """LanguageBatchResultItem. + + :param id: Unique, non-empty document identifier. + :type id: str + :param detected_languages: A list of extracted languages. + :type detected_languages: + list[~azure.cognitiveservices.language.textanalytics.models.DetectedLanguage] + :param statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str=None, detected_languages=None, statistics=None, **kwargs) -> None: + super(LanguageBatchResultItem, self).__init__(**kwargs) + self.id = id + self.detected_languages = detected_languages + self.statistics = statistics + + +class LanguageInput(Model): + """LanguageInput. + + :param country_hint: + :type country_hint: str + :param id: Unique, non-empty document identifier. + :type id: str + :param text: + :type text: str + """ + + _attribute_map = { + 'country_hint': {'key': 'countryHint', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, *, country_hint: str=None, id: str=None, text: str=None, **kwargs) -> None: + super(LanguageInput, self).__init__(**kwargs) + self.country_hint = country_hint + self.id = id + self.text = text + + +class MatchRecord(Model): + """MatchRecord. + + :param wikipedia_score: (optional) If a well-known item with Wikipedia + link is recognized, a decimal number denoting the confidence level of the + Wikipedia info will be returned. + :type wikipedia_score: float + :param entity_type_score: (optional) If an entity type is recognized, a + decimal number denoting the confidence level of the entity type will be + returned. + :type entity_type_score: float + :param text: Entity text as appears in the request. + :type text: str + :param offset: Start position (in Unicode characters) for the entity match + text. + :type offset: int + :param length: Length (in Unicode characters) for the entity match text. + :type length: int + """ + + _attribute_map = { + 'wikipedia_score': {'key': 'wikipediaScore', 'type': 'float'}, + 'entity_type_score': {'key': 'entityTypeScore', 'type': 'float'}, + 'text': {'key': 'text', 'type': 'str'}, + 'offset': {'key': 'offset', 'type': 'int'}, + 'length': {'key': 'length', 'type': 'int'}, + } + + def __init__(self, *, wikipedia_score: float=None, entity_type_score: float=None, text: str=None, offset: int=None, length: int=None, **kwargs) -> None: + super(MatchRecord, self).__init__(**kwargs) + self.wikipedia_score = wikipedia_score + self.entity_type_score = entity_type_score + self.text = text + self.offset = offset + self.length = length + + +class MultiLanguageBatchInput(Model): + """MultiLanguageBatchInput. + + :param documents: + :type documents: + list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] + """ + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, + } + + def __init__(self, *, documents=None, **kwargs) -> None: + super(MultiLanguageBatchInput, self).__init__(**kwargs) + self.documents = documents + + +class MultiLanguageInput(Model): + """MultiLanguageInput. + + :param language: This is the 2 letter ISO 639-1 representation of a + language. For example, use "en" for English; "es" for Spanish etc., + :type language: str + :param id: Unique, non-empty document identifier. + :type id: str + :param text: + :type text: str + """ + + _attribute_map = { + 'language': {'key': 'language', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'text': {'key': 'text', 'type': 'str'}, + } + + def __init__(self, *, language: str=None, id: str=None, text: str=None, **kwargs) -> None: + super(MultiLanguageInput, self).__init__(**kwargs) + self.language = language + self.id = id + self.text = text + + +class RequestStatistics(Model): + """RequestStatistics. + + :param documents_count: Number of documents submitted in the request. + :type documents_count: int + :param valid_documents_count: Number of valid documents. This excludes + empty, over-size limit or non-supported languages documents. + :type valid_documents_count: int + :param erroneous_documents_count: Number of invalid documents. This + includes empty, over-size limit or non-supported languages documents. + :type erroneous_documents_count: int + :param transactions_count: Number of transactions for the request. + :type transactions_count: long + """ + + _attribute_map = { + 'documents_count': {'key': 'documentsCount', 'type': 'int'}, + 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, + 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, + 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, + } + + def __init__(self, *, documents_count: int=None, valid_documents_count: int=None, erroneous_documents_count: int=None, transactions_count: int=None, **kwargs) -> None: + super(RequestStatistics, self).__init__(**kwargs) + self.documents_count = documents_count + self.valid_documents_count = valid_documents_count + self.erroneous_documents_count = erroneous_documents_count + self.transactions_count = transactions_count + + +class SentimentBatchResult(Model): + """SentimentBatchResult. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar documents: Response by document + :vartype documents: + list[~azure.cognitiveservices.language.textanalytics.models.SentimentBatchResultItem] + :ivar errors: Errors and Warnings by document + :vartype errors: + list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] + :ivar statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the request payload. + :vartype statistics: + ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics + """ + + _validation = { + 'documents': {'readonly': True}, + 'errors': {'readonly': True}, + 'statistics': {'readonly': True}, + } + + _attribute_map = { + 'documents': {'key': 'documents', 'type': '[SentimentBatchResultItem]'}, + 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, + 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, + } + + def __init__(self, **kwargs) -> None: + super(SentimentBatchResult, self).__init__(**kwargs) + self.documents = None + self.errors = None + self.statistics = None + + +class SentimentBatchResultItem(Model): + """SentimentBatchResultItem. + + :param id: Unique, non-empty document identifier. + :type id: str + :param score: A decimal number between 0 and 1 denoting the sentiment of + the document. A score above 0.7 usually refers to a positive document + while a score below 0.3 normally has a negative connotation. Mid values + refer to neutral text. + :type score: float + :param statistics: (Optional) if showStats=true was specified in the + request this field will contain information about the document payload. + :type statistics: + ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, + } + + def __init__(self, *, id: str=None, score: float=None, statistics=None, **kwargs) -> None: + super(SentimentBatchResultItem, self).__init__(**kwargs) + self.id = id + self.score = score + self.statistics = statistics diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py deleted file mode 100644 index 4741f83e264f..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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.serialization import Model - - -class DetectedLanguage(Model): - """DetectedLanguage. - - :param name: Long name of a detected language (e.g. English, French). - :type name: str - :param iso6391_name: A two letter representation of the detected language - according to the ISO 639-1 standard (e.g. en, fr). - :type iso6391_name: str - :param score: A confidence score between 0 and 1. Scores close to 1 - indicate 100% certainty that the identified language is true. - :type score: float - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(DetectedLanguage, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.iso6391_name = kwargs.get('iso6391_name', None) - self.score = kwargs.get('score', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py deleted file mode 100644 index 87824c274b58..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/detected_language_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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.serialization import Model - - -class DetectedLanguage(Model): - """DetectedLanguage. - - :param name: Long name of a detected language (e.g. English, French). - :type name: str - :param iso6391_name: A two letter representation of the detected language - according to the ISO 639-1 standard (e.g. en, fr). - :type iso6391_name: str - :param score: A confidence score between 0 and 1. Scores close to 1 - indicate 100% certainty that the identified language is true. - :type score: float - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'iso6391_name': {'key': 'iso6391Name', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - } - - def __init__(self, *, name: str=None, iso6391_name: str=None, score: float=None, **kwargs) -> None: - super(DetectedLanguage, self).__init__(**kwargs) - self.name = name - self.iso6391_name = iso6391_name - self.score = score diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics.py deleted file mode 100644 index d1eb5f21f89d..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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.serialization import Model - - -class DocumentStatistics(Model): - """DocumentStatistics. - - :param characters_count: Number of text elements recognized in the - document. - :type characters_count: int - :param transactions_count: Number of transactions for the document. - :type transactions_count: int - """ - - _attribute_map = { - 'characters_count': {'key': 'charactersCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(DocumentStatistics, self).__init__(**kwargs) - self.characters_count = kwargs.get('characters_count', None) - self.transactions_count = kwargs.get('transactions_count', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics_py3.py deleted file mode 100644 index 1b54590697d2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/document_statistics_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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.serialization import Model - - -class DocumentStatistics(Model): - """DocumentStatistics. - - :param characters_count: Number of text elements recognized in the - document. - :type characters_count: int - :param transactions_count: Number of transactions for the document. - :type transactions_count: int - """ - - _attribute_map = { - 'characters_count': {'key': 'charactersCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'int'}, - } - - def __init__(self, *, characters_count: int=None, transactions_count: int=None, **kwargs) -> None: - super(DocumentStatistics, self).__init__(**kwargs) - self.characters_count = characters_count - self.transactions_count = transactions_count diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py deleted file mode 100644 index b507c8eb712b..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class EntitiesBatchResult(Model): - """EntitiesBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs): - super(EntitiesBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py deleted file mode 100644 index e79c98b04f33..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.serialization import Model - - -class EntitiesBatchResultItem(Model): - """EntitiesBatchResultItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: Unique, non-empty document identifier. - :type id: str - :ivar entities: Recognized entities in the document. - :vartype entities: - list[~azure.cognitiveservices.language.textanalytics.models.EntityRecord] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _validation = { - 'entities': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[EntityRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, **kwargs): - super(EntitiesBatchResultItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.entities = None - self.statistics = kwargs.get('statistics', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py deleted file mode 100644 index 57c68b4f7b23..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_item_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.serialization import Model - - -class EntitiesBatchResultItem(Model): - """EntitiesBatchResultItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: Unique, non-empty document identifier. - :type id: str - :ivar entities: Recognized entities in the document. - :vartype entities: - list[~azure.cognitiveservices.language.textanalytics.models.EntityRecord] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _validation = { - 'entities': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'entities': {'key': 'entities', 'type': '[EntityRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, *, id: str=None, statistics=None, **kwargs) -> None: - super(EntitiesBatchResultItem, self).__init__(**kwargs) - self.id = id - self.entities = None - self.statistics = statistics diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py deleted file mode 100644 index 2f739f07316e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entities_batch_result_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class EntitiesBatchResult(Model): - """EntitiesBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.EntitiesBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[EntitiesBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs) -> None: - super(EntitiesBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py deleted file mode 100644 index ba9796142272..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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.serialization import Model - - -class EntityRecord(Model): - """EntityRecord. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param name: Entity formal name. - :type name: str - :param matches: List of instances this entity appears in the text. - :type matches: - list[~azure.cognitiveservices.language.textanalytics.models.MatchRecord] - :param wikipedia_language: Wikipedia language for which the WikipediaId - and WikipediaUrl refers to. - :type wikipedia_language: str - :param wikipedia_id: Wikipedia unique identifier of the recognized entity. - :type wikipedia_id: str - :ivar wikipedia_url: URL for the entity's Wikipedia page. - :vartype wikipedia_url: str - :param bing_id: Bing unique identifier of the recognized entity. Use in - conjunction with the Bing Entity Search API to fetch additional relevant - information. - :type bing_id: str - :param type: Entity type from Named Entity Recognition model - :type type: str - :param sub_type: Entity sub type from Named Entity Recognition model - :type sub_type: str - """ - - _validation = { - 'wikipedia_url': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'matches': {'key': 'matches', 'type': '[MatchRecord]'}, - 'wikipedia_language': {'key': 'wikipediaLanguage', 'type': 'str'}, - 'wikipedia_id': {'key': 'wikipediaId', 'type': 'str'}, - 'wikipedia_url': {'key': 'wikipediaUrl', 'type': 'str'}, - 'bing_id': {'key': 'bingId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sub_type': {'key': 'subType', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(EntityRecord, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.matches = kwargs.get('matches', None) - self.wikipedia_language = kwargs.get('wikipedia_language', None) - self.wikipedia_id = kwargs.get('wikipedia_id', None) - self.wikipedia_url = None - self.bing_id = kwargs.get('bing_id', None) - self.type = kwargs.get('type', None) - self.sub_type = kwargs.get('sub_type', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py deleted file mode 100644 index a857d52fa3cc..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/entity_record_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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.serialization import Model - - -class EntityRecord(Model): - """EntityRecord. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param name: Entity formal name. - :type name: str - :param matches: List of instances this entity appears in the text. - :type matches: - list[~azure.cognitiveservices.language.textanalytics.models.MatchRecord] - :param wikipedia_language: Wikipedia language for which the WikipediaId - and WikipediaUrl refers to. - :type wikipedia_language: str - :param wikipedia_id: Wikipedia unique identifier of the recognized entity. - :type wikipedia_id: str - :ivar wikipedia_url: URL for the entity's Wikipedia page. - :vartype wikipedia_url: str - :param bing_id: Bing unique identifier of the recognized entity. Use in - conjunction with the Bing Entity Search API to fetch additional relevant - information. - :type bing_id: str - :param type: Entity type from Named Entity Recognition model - :type type: str - :param sub_type: Entity sub type from Named Entity Recognition model - :type sub_type: str - """ - - _validation = { - 'wikipedia_url': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'matches': {'key': 'matches', 'type': '[MatchRecord]'}, - 'wikipedia_language': {'key': 'wikipediaLanguage', 'type': 'str'}, - 'wikipedia_id': {'key': 'wikipediaId', 'type': 'str'}, - 'wikipedia_url': {'key': 'wikipediaUrl', 'type': 'str'}, - 'bing_id': {'key': 'bingId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sub_type': {'key': 'subType', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, matches=None, wikipedia_language: str=None, wikipedia_id: str=None, bing_id: str=None, type: str=None, sub_type: str=None, **kwargs) -> None: - super(EntityRecord, self).__init__(**kwargs) - self.name = name - self.matches = matches - self.wikipedia_language = wikipedia_language - self.wikipedia_id = wikipedia_id - self.wikipedia_url = None - self.bing_id = bing_id - self.type = type - self.sub_type = sub_type diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py deleted file mode 100644 index 22283996cab7..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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.serialization import Model - - -class ErrorRecord(Model): - """ErrorRecord. - - :param id: Input document unique identifier the error refers to. - :type id: str - :param message: Error message. - :type message: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorRecord, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.message = kwargs.get('message', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py deleted file mode 100644 index 3ddcbca03f2c..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_record_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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.serialization import Model - - -class ErrorRecord(Model): - """ErrorRecord. - - :param id: Input document unique identifier the error refers to. - :type id: str - :param message: Error message. - :type message: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, id: str=None, message: str=None, **kwargs) -> None: - super(ErrorRecord, self).__init__(**kwargs) - self.id = id - self.message = message diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py deleted file mode 100644 index 3a0197f190f3..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """ErrorResponse. - - :param code: - :type code: str - :param message: - :type message: str - :param target: - :type target: str - :param inner_error: - :type inner_error: - ~azure.cognitiveservices.language.textanalytics.models.InternalError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.inner_error = kwargs.get('inner_error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py deleted file mode 100644 index 92d272000249..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/error_response_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """ErrorResponse. - - :param code: - :type code: str - :param message: - :type message: str - :param target: - :type target: str - :param inner_error: - :type inner_error: - ~azure.cognitiveservices.language.textanalytics.models.InternalError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, - } - - def __init__(self, *, code: str=None, message: str=None, target: str=None, inner_error=None, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.inner_error = inner_error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py deleted file mode 100644 index 1b40432d6d22..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.serialization import Model - - -class InternalError(Model): - """InternalError. - - :param code: - :type code: str - :param message: - :type message: str - :param inner_error: - :type inner_error: - ~azure.cognitiveservices.language.textanalytics.models.InternalError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, - } - - def __init__(self, **kwargs): - super(InternalError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.inner_error = kwargs.get('inner_error', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py deleted file mode 100644 index db1299ef21de..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/internal_error_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.serialization import Model - - -class InternalError(Model): - """InternalError. - - :param code: - :type code: str - :param message: - :type message: str - :param inner_error: - :type inner_error: - ~azure.cognitiveservices.language.textanalytics.models.InternalError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'inner_error': {'key': 'innerError', 'type': 'InternalError'}, - } - - def __init__(self, *, code: str=None, message: str=None, inner_error=None, **kwargs) -> None: - super(InternalError, self).__init__(**kwargs) - self.code = code - self.message = message - self.inner_error = inner_error diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py deleted file mode 100644 index c266bdc98a88..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class KeyPhraseBatchResult(Model): - """KeyPhraseBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: =(Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[KeyPhraseBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs): - super(KeyPhraseBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py deleted file mode 100644 index 622b6a4e9968..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.serialization import Model - - -class KeyPhraseBatchResultItem(Model): - """KeyPhraseBatchResultItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: Unique, non-empty document identifier. - :type id: str - :ivar key_phrases: A list of representative words or phrases. The number - of key phrases returned is proportional to the number of words in the - input document. - :vartype key_phrases: list[str] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _validation = { - 'key_phrases': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, **kwargs): - super(KeyPhraseBatchResultItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.key_phrases = None - self.statistics = kwargs.get('statistics', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py deleted file mode 100644 index 0571d6547394..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_item_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.serialization import Model - - -class KeyPhraseBatchResultItem(Model): - """KeyPhraseBatchResultItem. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param id: Unique, non-empty document identifier. - :type id: str - :ivar key_phrases: A list of representative words or phrases. The number - of key phrases returned is proportional to the number of words in the - input document. - :vartype key_phrases: list[str] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _validation = { - 'key_phrases': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'key_phrases': {'key': 'keyPhrases', 'type': '[str]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, *, id: str=None, statistics=None, **kwargs) -> None: - super(KeyPhraseBatchResultItem, self).__init__(**kwargs) - self.id = id - self.key_phrases = None - self.statistics = statistics diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py deleted file mode 100644 index c8f5219dc6a3..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/key_phrase_batch_result_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class KeyPhraseBatchResult(Model): - """KeyPhraseBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.KeyPhraseBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: =(Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[KeyPhraseBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs) -> None: - super(KeyPhraseBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input.py deleted file mode 100644 index d9471a2aa72a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.serialization import Model - - -class LanguageBatchInput(Model): - """LanguageBatchInput. - - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] - """ - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, - } - - def __init__(self, **kwargs): - super(LanguageBatchInput, self).__init__(**kwargs) - self.documents = kwargs.get('documents', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input_py3.py deleted file mode 100644 index 6e6a757b96ae..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_input_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.serialization import Model - - -class LanguageBatchInput(Model): - """LanguageBatchInput. - - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.LanguageInput] - """ - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageInput]'}, - } - - def __init__(self, *, documents=None, **kwargs) -> None: - super(LanguageBatchInput, self).__init__(**kwargs) - self.documents = documents diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py deleted file mode 100644 index 23204992ed61..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class LanguageBatchResult(Model): - """LanguageBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.LanguageBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs): - super(LanguageBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py deleted file mode 100644 index ef5a17f0132d..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.serialization import Model - - -class LanguageBatchResultItem(Model): - """LanguageBatchResultItem. - - :param id: Unique, non-empty document identifier. - :type id: str - :param detected_languages: A list of extracted languages. - :type detected_languages: - list[~azure.cognitiveservices.language.textanalytics.models.DetectedLanguage] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, **kwargs): - super(LanguageBatchResultItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.detected_languages = kwargs.get('detected_languages', None) - self.statistics = kwargs.get('statistics', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py deleted file mode 100644 index 3d3c499aeea1..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_item_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.serialization import Model - - -class LanguageBatchResultItem(Model): - """LanguageBatchResultItem. - - :param id: Unique, non-empty document identifier. - :type id: str - :param detected_languages: A list of extracted languages. - :type detected_languages: - list[~azure.cognitiveservices.language.textanalytics.models.DetectedLanguage] - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'detected_languages': {'key': 'detectedLanguages', 'type': '[DetectedLanguage]'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, *, id: str=None, detected_languages=None, statistics=None, **kwargs) -> None: - super(LanguageBatchResultItem, self).__init__(**kwargs) - self.id = id - self.detected_languages = detected_languages - self.statistics = statistics diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py deleted file mode 100644 index 7abe7d1b7bbd..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_batch_result_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class LanguageBatchResult(Model): - """LanguageBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.LanguageBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[LanguageBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs) -> None: - super(LanguageBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input.py deleted file mode 100644 index d79347938d74..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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.serialization import Model - - -class LanguageInput(Model): - """LanguageInput. - - :param country_hint: - :type country_hint: str - :param id: Unique, non-empty document identifier. - :type id: str - :param text: - :type text: str - """ - - _attribute_map = { - 'country_hint': {'key': 'countryHint', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LanguageInput, self).__init__(**kwargs) - self.country_hint = kwargs.get('country_hint', None) - self.id = kwargs.get('id', None) - self.text = kwargs.get('text', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input_py3.py deleted file mode 100644 index 2cc72da091b2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/language_input_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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.serialization import Model - - -class LanguageInput(Model): - """LanguageInput. - - :param country_hint: - :type country_hint: str - :param id: Unique, non-empty document identifier. - :type id: str - :param text: - :type text: str - """ - - _attribute_map = { - 'country_hint': {'key': 'countryHint', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, *, country_hint: str=None, id: str=None, text: str=None, **kwargs) -> None: - super(LanguageInput, self).__init__(**kwargs) - self.country_hint = country_hint - self.id = id - self.text = text diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py deleted file mode 100644 index 8ca1d6e5d7f6..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class MatchRecord(Model): - """MatchRecord. - - :param wikipedia_score: (optional) If a well-known item with Wikipedia - link is recognized, a decimal number denoting the confidence level of the - Wikipedia info will be returned. - :type wikipedia_score: float - :param entity_type_score: (optional) If an entity type is recognized, a - decimal number denoting the confidence level of the entity type will be - returned. - :type entity_type_score: float - :param text: Entity text as appears in the request. - :type text: str - :param offset: Start position (in Unicode characters) for the entity match - text. - :type offset: int - :param length: Length (in Unicode characters) for the entity match text. - :type length: int - """ - - _attribute_map = { - 'wikipedia_score': {'key': 'wikipediaScore', 'type': 'float'}, - 'entity_type_score': {'key': 'entityTypeScore', 'type': 'float'}, - 'text': {'key': 'text', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(MatchRecord, self).__init__(**kwargs) - self.wikipedia_score = kwargs.get('wikipedia_score', None) - self.entity_type_score = kwargs.get('entity_type_score', None) - self.text = kwargs.get('text', None) - self.offset = kwargs.get('offset', None) - self.length = kwargs.get('length', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py deleted file mode 100644 index 49995a79c23a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class MatchRecord(Model): - """MatchRecord. - - :param wikipedia_score: (optional) If a well-known item with Wikipedia - link is recognized, a decimal number denoting the confidence level of the - Wikipedia info will be returned. - :type wikipedia_score: float - :param entity_type_score: (optional) If an entity type is recognized, a - decimal number denoting the confidence level of the entity type will be - returned. - :type entity_type_score: float - :param text: Entity text as appears in the request. - :type text: str - :param offset: Start position (in Unicode characters) for the entity match - text. - :type offset: int - :param length: Length (in Unicode characters) for the entity match text. - :type length: int - """ - - _attribute_map = { - 'wikipedia_score': {'key': 'wikipediaScore', 'type': 'float'}, - 'entity_type_score': {'key': 'entityTypeScore', 'type': 'float'}, - 'text': {'key': 'text', 'type': 'str'}, - 'offset': {'key': 'offset', 'type': 'int'}, - 'length': {'key': 'length', 'type': 'int'}, - } - - def __init__(self, *, wikipedia_score: float=None, entity_type_score: float=None, text: str=None, offset: int=None, length: int=None, **kwargs) -> None: - super(MatchRecord, self).__init__(**kwargs) - self.wikipedia_score = wikipedia_score - self.entity_type_score = entity_type_score - self.text = text - self.offset = offset - self.length = length diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py deleted file mode 100644 index 8c9c5d313a61..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.serialization import Model - - -class MultiLanguageBatchInput(Model): - """MultiLanguageBatchInput. - - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] - """ - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, - } - - def __init__(self, **kwargs): - super(MultiLanguageBatchInput, self).__init__(**kwargs) - self.documents = kwargs.get('documents', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py deleted file mode 100644 index cbacf2d992f2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_batch_input_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.serialization import Model - - -class MultiLanguageBatchInput(Model): - """MultiLanguageBatchInput. - - :param documents: - :type documents: - list[~azure.cognitiveservices.language.textanalytics.models.MultiLanguageInput] - """ - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[MultiLanguageInput]'}, - } - - def __init__(self, *, documents=None, **kwargs) -> None: - super(MultiLanguageBatchInput, self).__init__(**kwargs) - self.documents = documents diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py deleted file mode 100644 index da37a13ce080..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.serialization import Model - - -class MultiLanguageInput(Model): - """MultiLanguageInput. - - :param language: This is the 2 letter ISO 639-1 representation of a - language. For example, use "en" for English; "es" for Spanish etc., - :type language: str - :param id: Unique, non-empty document identifier. - :type id: str - :param text: - :type text: str - """ - - _attribute_map = { - 'language': {'key': 'language', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MultiLanguageInput, self).__init__(**kwargs) - self.language = kwargs.get('language', None) - self.id = kwargs.get('id', None) - self.text = kwargs.get('text', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py deleted file mode 100644 index bd81650513d5..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/multi_language_input_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.serialization import Model - - -class MultiLanguageInput(Model): - """MultiLanguageInput. - - :param language: This is the 2 letter ISO 639-1 representation of a - language. For example, use "en" for English; "es" for Spanish etc., - :type language: str - :param id: Unique, non-empty document identifier. - :type id: str - :param text: - :type text: str - """ - - _attribute_map = { - 'language': {'key': 'language', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'text': {'key': 'text', 'type': 'str'}, - } - - def __init__(self, *, language: str=None, id: str=None, text: str=None, **kwargs) -> None: - super(MultiLanguageInput, self).__init__(**kwargs) - self.language = language - self.id = id - self.text = text diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics.py deleted file mode 100644 index b8cc26575238..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.serialization import Model - - -class RequestStatistics(Model): - """RequestStatistics. - - :param documents_count: Number of documents submitted in the request. - :type documents_count: int - :param valid_documents_count: Number of valid documents. This excludes - empty, over-size limit or non-supported languages documents. - :type valid_documents_count: int - :param erroneous_documents_count: Number of invalid documents. This - includes empty, over-size limit or non-supported languages documents. - :type erroneous_documents_count: int - :param transactions_count: Number of transactions for the request. - :type transactions_count: long - """ - - _attribute_map = { - 'documents_count': {'key': 'documentsCount', 'type': 'int'}, - 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, - 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, - } - - def __init__(self, **kwargs): - super(RequestStatistics, self).__init__(**kwargs) - self.documents_count = kwargs.get('documents_count', None) - self.valid_documents_count = kwargs.get('valid_documents_count', None) - self.erroneous_documents_count = kwargs.get('erroneous_documents_count', None) - self.transactions_count = kwargs.get('transactions_count', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics_py3.py deleted file mode 100644 index c93b32bba4c9..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/request_statistics_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.serialization import Model - - -class RequestStatistics(Model): - """RequestStatistics. - - :param documents_count: Number of documents submitted in the request. - :type documents_count: int - :param valid_documents_count: Number of valid documents. This excludes - empty, over-size limit or non-supported languages documents. - :type valid_documents_count: int - :param erroneous_documents_count: Number of invalid documents. This - includes empty, over-size limit or non-supported languages documents. - :type erroneous_documents_count: int - :param transactions_count: Number of transactions for the request. - :type transactions_count: long - """ - - _attribute_map = { - 'documents_count': {'key': 'documentsCount', 'type': 'int'}, - 'valid_documents_count': {'key': 'validDocumentsCount', 'type': 'int'}, - 'erroneous_documents_count': {'key': 'erroneousDocumentsCount', 'type': 'int'}, - 'transactions_count': {'key': 'transactionsCount', 'type': 'long'}, - } - - def __init__(self, *, documents_count: int=None, valid_documents_count: int=None, erroneous_documents_count: int=None, transactions_count: int=None, **kwargs) -> None: - super(RequestStatistics, self).__init__(**kwargs) - self.documents_count = documents_count - self.valid_documents_count = valid_documents_count - self.erroneous_documents_count = erroneous_documents_count - self.transactions_count = transactions_count diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py deleted file mode 100644 index 7fb12b8178b2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class SentimentBatchResult(Model): - """SentimentBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.SentimentBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[SentimentBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs): - super(SentimentBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py deleted file mode 100644 index 731682c63328..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.serialization import Model - - -class SentimentBatchResultItem(Model): - """SentimentBatchResultItem. - - :param id: Unique, non-empty document identifier. - :type id: str - :param score: A decimal number between 0 and 1 denoting the sentiment of - the document. A score above 0.7 usually refers to a positive document - while a score below 0.3 normally has a negative connotation. Mid values - refer to neutral text. - :type score: float - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, **kwargs): - super(SentimentBatchResultItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.score = kwargs.get('score', None) - self.statistics = kwargs.get('statistics', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py deleted file mode 100644 index c8acccf078cf..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_item_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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.serialization import Model - - -class SentimentBatchResultItem(Model): - """SentimentBatchResultItem. - - :param id: Unique, non-empty document identifier. - :type id: str - :param score: A decimal number between 0 and 1 denoting the sentiment of - the document. A score above 0.7 usually refers to a positive document - while a score below 0.3 normally has a negative connotation. Mid values - refer to neutral text. - :type score: float - :param statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the document payload. - :type statistics: - ~azure.cognitiveservices.language.textanalytics.models.DocumentStatistics - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'score': {'key': 'score', 'type': 'float'}, - 'statistics': {'key': 'statistics', 'type': 'DocumentStatistics'}, - } - - def __init__(self, *, id: str=None, score: float=None, statistics=None, **kwargs) -> None: - super(SentimentBatchResultItem, self).__init__(**kwargs) - self.id = id - self.score = score - self.statistics = statistics diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py deleted file mode 100644 index 33acf655a979..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/sentiment_batch_result_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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.serialization import Model - - -class SentimentBatchResult(Model): - """SentimentBatchResult. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar documents: Response by document - :vartype documents: - list[~azure.cognitiveservices.language.textanalytics.models.SentimentBatchResultItem] - :ivar errors: Errors and Warnings by document - :vartype errors: - list[~azure.cognitiveservices.language.textanalytics.models.ErrorRecord] - :ivar statistics: (Optional) if showStats=true was specified in the - request this field will contain information about the request payload. - :vartype statistics: - ~azure.cognitiveservices.language.textanalytics.models.RequestStatistics - """ - - _validation = { - 'documents': {'readonly': True}, - 'errors': {'readonly': True}, - 'statistics': {'readonly': True}, - } - - _attribute_map = { - 'documents': {'key': 'documents', 'type': '[SentimentBatchResultItem]'}, - 'errors': {'key': 'errors', 'type': '[ErrorRecord]'}, - 'statistics': {'key': 'statistics', 'type': 'RequestStatistics'}, - } - - def __init__(self, **kwargs) -> None: - super(SentimentBatchResult, self).__init__(**kwargs) - self.documents = None - self.errors = None - self.statistics = None diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/__init__.py new file mode 100644 index 000000000000..e87e22b49362 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/__init__.py @@ -0,0 +1,16 @@ +# 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 ._text_analytics_client_operations import TextAnalyticsClientOperationsMixin + +__all__ = [ + 'TextAnalyticsClientOperationsMixin', +] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/_text_analytics_client_operations.py similarity index 83% rename from sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py rename to sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/_text_analytics_client_operations.py index 76dacf5ef417..9ef973c5fa2d 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/text_analytics_client.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/operations/_text_analytics_client_operations.py @@ -9,69 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import SDKClient -from msrest import Configuration, Serializer, Deserializer -from .version import VERSION from msrest.pipeline import ClientRawResponse from msrest.exceptions import HttpOperationError -from . import models +from .. import models -class TextAnalyticsClientConfiguration(Configuration): - """Configuration for TextAnalyticsClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Supported Cognitive Services endpoints (protocol and - hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - :param credentials: Subscription credentials which uniquely identify - client subscription. - :type credentials: None - """ - - def __init__( - self, endpoint, credentials): - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - base_url = '{Endpoint}/text/analytics/v2.1' - - super(TextAnalyticsClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-cognitiveservices-language-textanalytics/{}'.format(VERSION)) - - self.endpoint = endpoint - self.credentials = credentials - - -class TextAnalyticsClient(SDKClient): - """The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview - - :ivar config: Configuration for client. - :vartype config: TextAnalyticsClientConfiguration - - :param endpoint: Supported Cognitive Services endpoints (protocol and - hostname, for example: https://westus.api.cognitive.microsoft.com). - :type endpoint: str - :param credentials: Subscription credentials which uniquely identify - client subscription. - :type credentials: None - """ - - def __init__( - self, endpoint, credentials): - - self.config = TextAnalyticsClientConfiguration(endpoint, credentials) - super(TextAnalyticsClient, 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 = 'v2.1' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - +class TextAnalyticsClientOperationsMixin(object): def detect_language( self, show_stats=None, documents=None, custom_headers=None, raw=False, **operation_config): @@ -136,7 +79,6 @@ def detect_language( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('LanguageBatchResult', response) @@ -212,7 +154,6 @@ def entities( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('EntitiesBatchResult', response) @@ -288,7 +229,6 @@ def key_phrases( raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('KeyPhraseBatchResult', response) @@ -363,7 +303,6 @@ def sentiment( raise HttpOperationError(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('SentimentBatchResult', response) if response.status_code == 500: