azure-ai-textanalytics 5.3.0b2__py3-none-any.whl → 6.0.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of azure-ai-textanalytics might be problematic. Click here for more details.
- azure/ai/textanalytics/__init__.py +26 -193
- azure/ai/textanalytics/_client.py +111 -0
- azure/ai/textanalytics/_configuration.py +73 -0
- azure/ai/textanalytics/{_generated/v2022_05_01/operations → _operations}/__init__.py +13 -8
- azure/ai/textanalytics/_operations/_operations.py +716 -0
- azure/ai/textanalytics/{_generated/v2022_05_01/models → _operations}/_patch.py +8 -6
- azure/ai/textanalytics/_patch.py +350 -0
- azure/ai/textanalytics/{_generated/aio → _utils}/__init__.py +1 -5
- azure/ai/textanalytics/_utils/model_base.py +1237 -0
- azure/ai/textanalytics/{_generated/_serialization.py → _utils/serialization.py} +640 -616
- azure/ai/textanalytics/{_generated/v2022_05_01/aio/_vendor.py → _utils/utils.py} +10 -12
- azure/ai/textanalytics/_version.py +8 -7
- azure/ai/textanalytics/aio/__init__.py +25 -14
- azure/ai/textanalytics/aio/_client.py +115 -0
- azure/ai/textanalytics/aio/_configuration.py +75 -0
- azure/ai/textanalytics/{_generated/v2022_10_01_preview/aio/operations → aio/_operations}/__init__.py +13 -8
- azure/ai/textanalytics/aio/_operations/_operations.py +623 -0
- azure/ai/textanalytics/{_generated/v2022_05_01 → aio/_operations}/_patch.py +8 -6
- azure/ai/textanalytics/aio/_patch.py +344 -0
- azure/ai/textanalytics/models/__init__.py +402 -0
- azure/ai/textanalytics/models/_enums.py +1979 -0
- azure/ai/textanalytics/models/_models.py +6641 -0
- azure/ai/textanalytics/{_generated/v2022_05_01/aio → models}/_patch.py +8 -6
- azure/ai/textanalytics/py.typed +1 -0
- {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/METADATA +668 -403
- azure_ai_textanalytics-6.0.0b1.dist-info/RECORD +29 -0
- {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/WHEEL +1 -1
- azure/ai/textanalytics/_base_client.py +0 -113
- azure/ai/textanalytics/_check.py +0 -22
- azure/ai/textanalytics/_dict_mixin.py +0 -57
- azure/ai/textanalytics/_generated/__init__.py +0 -16
- azure/ai/textanalytics/_generated/_configuration.py +0 -70
- azure/ai/textanalytics/_generated/_operations_mixin.py +0 -795
- azure/ai/textanalytics/_generated/_text_analytics_client.py +0 -126
- azure/ai/textanalytics/_generated/_version.py +0 -8
- azure/ai/textanalytics/_generated/aio/_configuration.py +0 -66
- azure/ai/textanalytics/_generated/aio/_operations_mixin.py +0 -776
- azure/ai/textanalytics/_generated/aio/_text_analytics_client.py +0 -124
- azure/ai/textanalytics/_generated/models.py +0 -8
- azure/ai/textanalytics/_generated/v2022_05_01/__init__.py +0 -20
- azure/ai/textanalytics/_generated/v2022_05_01/_configuration.py +0 -72
- azure/ai/textanalytics/_generated/v2022_05_01/_text_analytics_client.py +0 -100
- azure/ai/textanalytics/_generated/v2022_05_01/_vendor.py +0 -45
- azure/ai/textanalytics/_generated/v2022_05_01/aio/__init__.py +0 -20
- azure/ai/textanalytics/_generated/v2022_05_01/aio/_configuration.py +0 -71
- azure/ai/textanalytics/_generated/v2022_05_01/aio/_text_analytics_client.py +0 -97
- azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/__init__.py +0 -18
- azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/_patch.py +0 -121
- azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/_text_analytics_client_operations.py +0 -603
- azure/ai/textanalytics/_generated/v2022_05_01/models/__init__.py +0 -281
- azure/ai/textanalytics/_generated/v2022_05_01/models/_models_py3.py +0 -5722
- azure/ai/textanalytics/_generated/v2022_05_01/models/_text_analytics_client_enums.py +0 -439
- azure/ai/textanalytics/_generated/v2022_05_01/operations/_patch.py +0 -120
- azure/ai/textanalytics/_generated/v2022_05_01/operations/_text_analytics_client_operations.py +0 -744
- azure/ai/textanalytics/_generated/v2022_10_01_preview/__init__.py +0 -20
- azure/ai/textanalytics/_generated/v2022_10_01_preview/_configuration.py +0 -72
- azure/ai/textanalytics/_generated/v2022_10_01_preview/_patch.py +0 -19
- azure/ai/textanalytics/_generated/v2022_10_01_preview/_text_analytics_client.py +0 -100
- azure/ai/textanalytics/_generated/v2022_10_01_preview/_vendor.py +0 -45
- azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/__init__.py +0 -20
- azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_configuration.py +0 -71
- azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_patch.py +0 -19
- azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_text_analytics_client.py +0 -97
- azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_vendor.py +0 -27
- azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/operations/_patch.py +0 -121
- azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/operations/_text_analytics_client_operations.py +0 -603
- azure/ai/textanalytics/_generated/v2022_10_01_preview/models/__init__.py +0 -405
- azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_models_py3.py +0 -8420
- azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_patch.py +0 -486
- azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_text_analytics_client_enums.py +0 -729
- azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/__init__.py +0 -18
- azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/_patch.py +0 -120
- azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/_text_analytics_client_operations.py +0 -744
- azure/ai/textanalytics/_generated/v3_0/__init__.py +0 -20
- azure/ai/textanalytics/_generated/v3_0/_configuration.py +0 -66
- azure/ai/textanalytics/_generated/v3_0/_patch.py +0 -31
- azure/ai/textanalytics/_generated/v3_0/_text_analytics_client.py +0 -96
- azure/ai/textanalytics/_generated/v3_0/_vendor.py +0 -33
- azure/ai/textanalytics/_generated/v3_0/aio/__init__.py +0 -20
- azure/ai/textanalytics/_generated/v3_0/aio/_configuration.py +0 -65
- azure/ai/textanalytics/_generated/v3_0/aio/_patch.py +0 -31
- azure/ai/textanalytics/_generated/v3_0/aio/_text_analytics_client.py +0 -93
- azure/ai/textanalytics/_generated/v3_0/aio/_vendor.py +0 -27
- azure/ai/textanalytics/_generated/v3_0/aio/operations/__init__.py +0 -18
- azure/ai/textanalytics/_generated/v3_0/aio/operations/_patch.py +0 -19
- azure/ai/textanalytics/_generated/v3_0/aio/operations/_text_analytics_client_operations.py +0 -428
- azure/ai/textanalytics/_generated/v3_0/models/__init__.py +0 -81
- azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py +0 -1467
- azure/ai/textanalytics/_generated/v3_0/models/_patch.py +0 -19
- azure/ai/textanalytics/_generated/v3_0/models/_text_analytics_client_enums.py +0 -58
- azure/ai/textanalytics/_generated/v3_0/operations/__init__.py +0 -18
- azure/ai/textanalytics/_generated/v3_0/operations/_patch.py +0 -19
- azure/ai/textanalytics/_generated/v3_0/operations/_text_analytics_client_operations.py +0 -604
- azure/ai/textanalytics/_generated/v3_1/__init__.py +0 -20
- azure/ai/textanalytics/_generated/v3_1/_configuration.py +0 -66
- azure/ai/textanalytics/_generated/v3_1/_patch.py +0 -31
- azure/ai/textanalytics/_generated/v3_1/_text_analytics_client.py +0 -98
- azure/ai/textanalytics/_generated/v3_1/_vendor.py +0 -45
- azure/ai/textanalytics/_generated/v3_1/aio/__init__.py +0 -20
- azure/ai/textanalytics/_generated/v3_1/aio/_configuration.py +0 -65
- azure/ai/textanalytics/_generated/v3_1/aio/_patch.py +0 -31
- azure/ai/textanalytics/_generated/v3_1/aio/_text_analytics_client.py +0 -95
- azure/ai/textanalytics/_generated/v3_1/aio/_vendor.py +0 -27
- azure/ai/textanalytics/_generated/v3_1/aio/operations/__init__.py +0 -18
- azure/ai/textanalytics/_generated/v3_1/aio/operations/_patch.py +0 -19
- azure/ai/textanalytics/_generated/v3_1/aio/operations/_text_analytics_client_operations.py +0 -1291
- azure/ai/textanalytics/_generated/v3_1/models/__init__.py +0 -205
- azure/ai/textanalytics/_generated/v3_1/models/_models_py3.py +0 -3976
- azure/ai/textanalytics/_generated/v3_1/models/_patch.py +0 -19
- azure/ai/textanalytics/_generated/v3_1/models/_text_analytics_client_enums.py +0 -367
- azure/ai/textanalytics/_generated/v3_1/operations/__init__.py +0 -18
- azure/ai/textanalytics/_generated/v3_1/operations/_patch.py +0 -19
- azure/ai/textanalytics/_generated/v3_1/operations/_text_analytics_client_operations.py +0 -1709
- azure/ai/textanalytics/_lro.py +0 -553
- azure/ai/textanalytics/_models.py +0 -3158
- azure/ai/textanalytics/_policies.py +0 -66
- azure/ai/textanalytics/_request_handlers.py +0 -104
- azure/ai/textanalytics/_response_handlers.py +0 -583
- azure/ai/textanalytics/_text_analytics_client.py +0 -2081
- azure/ai/textanalytics/_user_agent.py +0 -8
- azure/ai/textanalytics/_validate.py +0 -113
- azure/ai/textanalytics/aio/_base_client_async.py +0 -98
- azure/ai/textanalytics/aio/_lro_async.py +0 -503
- azure/ai/textanalytics/aio/_response_handlers_async.py +0 -94
- azure/ai/textanalytics/aio/_text_analytics_client_async.py +0 -2077
- azure_ai_textanalytics-5.3.0b2.dist-info/RECORD +0 -115
- {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info/licenses}/LICENSE +0 -0
- {azure_ai_textanalytics-5.3.0b2.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
azure/ai/textanalytics/__init__.py,sha256=-EYifutDqTj877Shh5AFS6MTT7L0z-4o7o9i-p5MDjQ,1032
|
|
2
|
+
azure/ai/textanalytics/_client.py,sha256=qu40gcmtvLG5RL7e0HLpx4BCC_H_pXzCLkJZG4iWvDM,5532
|
|
3
|
+
azure/ai/textanalytics/_configuration.py,sha256=ibnghM9FLmJVyYwaPCmWv3Gy0SjCthOLWkhITdCpC-I,3905
|
|
4
|
+
azure/ai/textanalytics/_patch.py,sha256=hQlEaSsus_-JGXJ5b0eg7wk3Tp6-b81w0Da63hxRE0M,16168
|
|
5
|
+
azure/ai/textanalytics/_version.py,sha256=-z4bM84LaW5VMIrPY-XawHtvYmFMANoLxb-_JOMq0dg,486
|
|
6
|
+
azure/ai/textanalytics/py.typed,sha256=dcrsqJrcYfTX-ckLFJMTaj6mD8aDe2u0tkQG-ZYxnEg,26
|
|
7
|
+
azure/ai/textanalytics/_operations/__init__.py,sha256=tFwbWgY4BJbe_nYmUrLESfUao-Ez4iYKwil4MfYOoBY,950
|
|
8
|
+
azure/ai/textanalytics/_operations/_operations.py,sha256=l4-2ClbswxyxD5M4iqbvbufmcTVpnLDfV58U6riZqJg,30485
|
|
9
|
+
azure/ai/textanalytics/_operations/_patch.py,sha256=bRmors9r9iYkR1NFjnMBYkj7OVhnGo-_rhjh67IMApE,824
|
|
10
|
+
azure/ai/textanalytics/_utils/__init__.py,sha256=nh5swTUwCBe3xsb9n60QMcuJ33d89Itwx7q9V-oDOUE,450
|
|
11
|
+
azure/ai/textanalytics/_utils/model_base.py,sha256=TbMoBw8EE3C1AFC5Ngvt_3ANcBOxQhn-bVTFTux2P1s,45625
|
|
12
|
+
azure/ai/textanalytics/_utils/serialization.py,sha256=cjn0Axja9oEYTsh2_tqF0Vj8Rye4UurRE2EFNeu91Y8,81934
|
|
13
|
+
azure/ai/textanalytics/_utils/utils.py,sha256=9djHCcire_il2pjobiMntTpM4p0Q6t-xn8I_mcR4EOk,887
|
|
14
|
+
azure/ai/textanalytics/aio/__init__.py,sha256=lri8eApHFUVQK1AykcuJU9j_webhFiX7dMBPfSqQJuk,979
|
|
15
|
+
azure/ai/textanalytics/aio/_client.py,sha256=RPTsxhzov-0FOBmPBP3jzkMkxGxtLimAZZVYY0ZI_Os,5691
|
|
16
|
+
azure/ai/textanalytics/aio/_configuration.py,sha256=PjQCGbg_-GW2AGBtNhtvnaXdoDECAvynN0uXHoZE_Qg,3962
|
|
17
|
+
azure/ai/textanalytics/aio/_patch.py,sha256=5Dhm4PoTriQXtv-Ic7JsZzUjPdoIgb6JI8zdV7VMFGg,16037
|
|
18
|
+
azure/ai/textanalytics/aio/_operations/__init__.py,sha256=tFwbWgY4BJbe_nYmUrLESfUao-Ez4iYKwil4MfYOoBY,950
|
|
19
|
+
azure/ai/textanalytics/aio/_operations/_operations.py,sha256=VxfCGNa6hk8CY4YK9Z_5L36rV_y1fsTdLW0Lj1FVb84,27189
|
|
20
|
+
azure/ai/textanalytics/aio/_operations/_patch.py,sha256=bRmors9r9iYkR1NFjnMBYkj7OVhnGo-_rhjh67IMApE,824
|
|
21
|
+
azure/ai/textanalytics/models/__init__.py,sha256=qYlcw-j3dfhng34ANohAnPDZPybOqOj1LCfpK5A_Hd4,11331
|
|
22
|
+
azure/ai/textanalytics/models/_enums.py,sha256=n6YwCTIoUyogUCgJ5hGJMu0GcvXS6iR3v-oY1or69QU,74503
|
|
23
|
+
azure/ai/textanalytics/models/_models.py,sha256=sfjntzsWKVn9_Um24c79kGaYH_45PT7z7NQXYxh-atA,295157
|
|
24
|
+
azure/ai/textanalytics/models/_patch.py,sha256=bRmors9r9iYkR1NFjnMBYkj7OVhnGo-_rhjh67IMApE,824
|
|
25
|
+
azure_ai_textanalytics-6.0.0b1.dist-info/licenses/LICENSE,sha256=_VMkgdgo4ToLE8y1mOAjOKNhd0BnWoYu5r3BVBto6T0,1073
|
|
26
|
+
azure_ai_textanalytics-6.0.0b1.dist-info/METADATA,sha256=ZOCJKT5Gw5oonPgTjgA-wfWMpUCFxUuP4lMIF5Dtz0M,91349
|
|
27
|
+
azure_ai_textanalytics-6.0.0b1.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
28
|
+
azure_ai_textanalytics-6.0.0b1.dist-info/top_level.txt,sha256=S7DhWV9m80TBzAhOFjxDUiNbKszzoThbnrSz5MpbHSQ,6
|
|
29
|
+
azure_ai_textanalytics-6.0.0b1.dist-info/RECORD,,
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# ------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation.
|
|
3
|
-
# Licensed under the MIT License.
|
|
4
|
-
# ------------------------------------
|
|
5
|
-
|
|
6
|
-
from typing import Union, Any, Optional
|
|
7
|
-
from enum import Enum
|
|
8
|
-
from azure.core import CaseInsensitiveEnumMeta
|
|
9
|
-
from azure.core.pipeline.policies import AzureKeyCredentialPolicy, HttpLoggingPolicy
|
|
10
|
-
from azure.core.credentials import AzureKeyCredential, TokenCredential
|
|
11
|
-
from ._generated import TextAnalyticsClient as _TextAnalyticsClient
|
|
12
|
-
from ._policies import TextAnalyticsResponseHookPolicy, QuotaExceededPolicy
|
|
13
|
-
from ._user_agent import USER_AGENT
|
|
14
|
-
from ._version import DEFAULT_API_VERSION
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class TextAnalyticsApiVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
|
18
|
-
"""Cognitive Service for Language or Text Analytics API versions supported by this package"""
|
|
19
|
-
|
|
20
|
-
#: This is the default version and corresponds to the Cognitive Service for Language API.
|
|
21
|
-
V2022_10_01_PREVIEW = "2022-10-01-preview"
|
|
22
|
-
#: This version corresponds to the Cognitive Service for Language API.
|
|
23
|
-
V2022_05_01 = "2022-05-01"
|
|
24
|
-
#: This version corresponds to Text Analytics API.
|
|
25
|
-
V3_1 = "v3.1"
|
|
26
|
-
#: This version corresponds to Text Analytics API.
|
|
27
|
-
V3_0 = "v3.0"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def _authentication_policy(credential):
|
|
31
|
-
authentication_policy = None
|
|
32
|
-
if credential is None:
|
|
33
|
-
raise ValueError("Parameter 'credential' must not be None.")
|
|
34
|
-
if isinstance(credential, AzureKeyCredential):
|
|
35
|
-
authentication_policy = AzureKeyCredentialPolicy(
|
|
36
|
-
name="Ocp-Apim-Subscription-Key", credential=credential
|
|
37
|
-
)
|
|
38
|
-
elif credential is not None and not hasattr(credential, "get_token"):
|
|
39
|
-
raise TypeError(
|
|
40
|
-
"Unsupported credential: {}. Use an instance of AzureKeyCredential "
|
|
41
|
-
"or a token credential from azure.identity".format(type(credential))
|
|
42
|
-
)
|
|
43
|
-
return authentication_policy
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class TextAnalyticsClientBase:
|
|
47
|
-
def __init__(
|
|
48
|
-
self,
|
|
49
|
-
endpoint: str,
|
|
50
|
-
credential: Union[AzureKeyCredential, TokenCredential],
|
|
51
|
-
*,
|
|
52
|
-
api_version: Optional[Union[str, TextAnalyticsApiVersion]] = None,
|
|
53
|
-
**kwargs: Any
|
|
54
|
-
) -> None:
|
|
55
|
-
http_logging_policy = HttpLoggingPolicy(**kwargs)
|
|
56
|
-
http_logging_policy.allowed_header_names.update(
|
|
57
|
-
{
|
|
58
|
-
"Operation-Location",
|
|
59
|
-
"apim-request-id",
|
|
60
|
-
"x-envoy-upstream-service-time",
|
|
61
|
-
"Strict-Transport-Security",
|
|
62
|
-
"x-content-type-options",
|
|
63
|
-
"warn-code",
|
|
64
|
-
"warn-agent",
|
|
65
|
-
"warn-text",
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
http_logging_policy.allowed_query_params.update(
|
|
69
|
-
{
|
|
70
|
-
"model-version",
|
|
71
|
-
"showStats",
|
|
72
|
-
"loggingOptOut",
|
|
73
|
-
"domain",
|
|
74
|
-
"stringIndexType",
|
|
75
|
-
"piiCategories",
|
|
76
|
-
"$top",
|
|
77
|
-
"$skip",
|
|
78
|
-
"opinionMining",
|
|
79
|
-
"api-version"
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
try:
|
|
83
|
-
endpoint = endpoint.rstrip("/")
|
|
84
|
-
except AttributeError:
|
|
85
|
-
raise ValueError("Parameter 'endpoint' must be a string.")
|
|
86
|
-
|
|
87
|
-
self._api_version = api_version if api_version is not None else DEFAULT_API_VERSION
|
|
88
|
-
if hasattr(self._api_version, "value"):
|
|
89
|
-
self._api_version = self._api_version.value # type: ignore
|
|
90
|
-
self._client = _TextAnalyticsClient(
|
|
91
|
-
endpoint=endpoint,
|
|
92
|
-
credential=credential, # type: ignore
|
|
93
|
-
api_version=self._api_version,
|
|
94
|
-
sdk_moniker=USER_AGENT,
|
|
95
|
-
authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)),
|
|
96
|
-
custom_hook_policy=kwargs.pop("custom_hook_policy", TextAnalyticsResponseHookPolicy(**kwargs)),
|
|
97
|
-
http_logging_policy=kwargs.pop("http_logging_policy", http_logging_policy),
|
|
98
|
-
per_retry_policies=kwargs.get("per_retry_policies", QuotaExceededPolicy()),
|
|
99
|
-
**kwargs
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
def __enter__(self):
|
|
103
|
-
self._client.__enter__() # pylint:disable=no-member
|
|
104
|
-
return self
|
|
105
|
-
|
|
106
|
-
def __exit__(self, *args):
|
|
107
|
-
self._client.__exit__(*args) # pylint:disable=no-member
|
|
108
|
-
|
|
109
|
-
def close(self) -> None:
|
|
110
|
-
"""Close sockets opened by the client.
|
|
111
|
-
Calling this method is unnecessary when using the client as a context manager.
|
|
112
|
-
"""
|
|
113
|
-
self._client.close()
|
azure/ai/textanalytics/_check.py
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# pylint: disable=too-many-lines
|
|
2
|
-
# ------------------------------------
|
|
3
|
-
# Copyright (c) Microsoft Corporation.
|
|
4
|
-
# Licensed under the MIT License.
|
|
5
|
-
# ------------------------------------
|
|
6
|
-
|
|
7
|
-
import re
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def is_language_api(api_version):
|
|
11
|
-
"""Language API is date-based
|
|
12
|
-
"""
|
|
13
|
-
return re.search(r'\d{4}-\d{2}-\d{2}', api_version)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def string_index_type_compatibility(string_index_type):
|
|
17
|
-
"""Language API changed this string_index_type option to plural.
|
|
18
|
-
Convert singular to plural for language API
|
|
19
|
-
"""
|
|
20
|
-
if string_index_type == "TextElement_v8":
|
|
21
|
-
return "TextElements_v8"
|
|
22
|
-
return string_index_type
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# ------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation.
|
|
3
|
-
# Licensed under the MIT License.
|
|
4
|
-
# ------------------------------------
|
|
5
|
-
|
|
6
|
-
from typing import Any, Tuple, Optional, Iterable
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class DictMixin:
|
|
10
|
-
def __setitem__(self, key: str, item: Any) -> None:
|
|
11
|
-
self.__dict__[key] = item
|
|
12
|
-
|
|
13
|
-
def __getitem__(self, key: str) -> Any:
|
|
14
|
-
return self.__dict__[key]
|
|
15
|
-
|
|
16
|
-
def __repr__(self) -> str:
|
|
17
|
-
return str(self)
|
|
18
|
-
|
|
19
|
-
def __len__(self) -> int:
|
|
20
|
-
return len(self.keys()) # type: ignore
|
|
21
|
-
|
|
22
|
-
def __delitem__(self, key: str) -> None:
|
|
23
|
-
self.__dict__[key] = None
|
|
24
|
-
|
|
25
|
-
def __eq__(self, other: Any) -> bool:
|
|
26
|
-
if isinstance(other, self.__class__):
|
|
27
|
-
return self.__dict__ == other.__dict__
|
|
28
|
-
return False
|
|
29
|
-
|
|
30
|
-
def __ne__(self, other: Any) -> bool:
|
|
31
|
-
return not self.__eq__(other)
|
|
32
|
-
|
|
33
|
-
def __contains__(self, key: str) -> bool:
|
|
34
|
-
return key in self.__dict__
|
|
35
|
-
|
|
36
|
-
def __str__(self) -> str:
|
|
37
|
-
return str({k: v for k, v in self.__dict__.items() if not k.startswith("_")})
|
|
38
|
-
|
|
39
|
-
def has_key(self, k: str) -> bool:
|
|
40
|
-
return k in self.__dict__
|
|
41
|
-
|
|
42
|
-
def update(self, *args: Any, **kwargs: Any) -> None:
|
|
43
|
-
self.__dict__.update(*args, **kwargs)
|
|
44
|
-
|
|
45
|
-
def keys(self) -> Iterable[str]:
|
|
46
|
-
return [k for k in self.__dict__ if not k.startswith("_")]
|
|
47
|
-
|
|
48
|
-
def values(self) -> Iterable[Any]:
|
|
49
|
-
return [v for k, v in self.__dict__.items() if not k.startswith("_")]
|
|
50
|
-
|
|
51
|
-
def items(self) -> Iterable[Tuple[str, Any]]:
|
|
52
|
-
return [(k, v) for k, v in self.__dict__.items() if not k.startswith("_")]
|
|
53
|
-
|
|
54
|
-
def get(self, key: str, default: Optional[Any] = None) -> Any:
|
|
55
|
-
if key in self.__dict__:
|
|
56
|
-
return self.__dict__[key]
|
|
57
|
-
return default
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# coding=utf-8
|
|
2
|
-
# --------------------------------------------------------------------------
|
|
3
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
# Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
# Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
-
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
-
# --------------------------------------------------------------------------
|
|
8
|
-
|
|
9
|
-
from ._text_analytics_client import TextAnalyticsClient
|
|
10
|
-
__all__ = ['TextAnalyticsClient']
|
|
11
|
-
|
|
12
|
-
try:
|
|
13
|
-
from ._patch import patch_sdk # type: ignore
|
|
14
|
-
patch_sdk()
|
|
15
|
-
except ImportError:
|
|
16
|
-
pass
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# coding=utf-8
|
|
2
|
-
# --------------------------------------------------------------------------
|
|
3
|
-
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
# Licensed under the MIT License. See License.txt in the project root for
|
|
5
|
-
# license information.
|
|
6
|
-
#
|
|
7
|
-
# Code generated by Microsoft (R) AutoRest Code Generator.
|
|
8
|
-
# Changes may cause incorrect behavior and will be lost if the code is
|
|
9
|
-
# regenerated.
|
|
10
|
-
# --------------------------------------------------------------------------
|
|
11
|
-
from typing import TYPE_CHECKING
|
|
12
|
-
|
|
13
|
-
from azure.core.configuration import Configuration
|
|
14
|
-
from azure.core.pipeline import policies
|
|
15
|
-
|
|
16
|
-
from ._version import VERSION
|
|
17
|
-
|
|
18
|
-
if TYPE_CHECKING:
|
|
19
|
-
# pylint: disable=unused-import,ungrouped-imports
|
|
20
|
-
from typing import Any
|
|
21
|
-
|
|
22
|
-
from azure.core.credentials import TokenCredential
|
|
23
|
-
|
|
24
|
-
class TextAnalyticsClientConfiguration(Configuration):
|
|
25
|
-
"""Configuration for TextAnalyticsClient.
|
|
26
|
-
|
|
27
|
-
Note that all parameters used to create this instance are saved as instance
|
|
28
|
-
attributes.
|
|
29
|
-
|
|
30
|
-
:param credential: Credential needed for the client to connect to Azure. Required.
|
|
31
|
-
:type credential: ~azure.core.credentials.TokenCredential
|
|
32
|
-
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). Required.
|
|
33
|
-
:type endpoint: str
|
|
34
|
-
"""
|
|
35
|
-
|
|
36
|
-
def __init__(
|
|
37
|
-
self,
|
|
38
|
-
credential, # type: "TokenCredential"
|
|
39
|
-
endpoint, # type: str
|
|
40
|
-
**kwargs # type: Any
|
|
41
|
-
):
|
|
42
|
-
# type: (...) -> None
|
|
43
|
-
if credential is None:
|
|
44
|
-
raise ValueError("Parameter 'credential' must not be None.")
|
|
45
|
-
if endpoint is None:
|
|
46
|
-
raise ValueError("Parameter 'endpoint' must not be None.")
|
|
47
|
-
super(TextAnalyticsClientConfiguration, self).__init__(**kwargs)
|
|
48
|
-
|
|
49
|
-
self.credential = credential
|
|
50
|
-
self.endpoint = endpoint
|
|
51
|
-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://cognitiveservices.azure.com/.default'])
|
|
52
|
-
kwargs.setdefault('sdk_moniker', 'azure-ai-textanalytics/{}'.format(VERSION))
|
|
53
|
-
self._configure(**kwargs)
|
|
54
|
-
|
|
55
|
-
def _configure(
|
|
56
|
-
self,
|
|
57
|
-
**kwargs # type: Any
|
|
58
|
-
):
|
|
59
|
-
# type: (...) -> None
|
|
60
|
-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
|
|
61
|
-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
|
|
62
|
-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
|
|
63
|
-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
|
|
64
|
-
self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs)
|
|
65
|
-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
|
|
66
|
-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
|
|
67
|
-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
|
|
68
|
-
self.authentication_policy = kwargs.get('authentication_policy')
|
|
69
|
-
if self.credential and not self.authentication_policy:
|
|
70
|
-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
|