azure-ai-textanalytics 5.3.0b1__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.

Files changed (128) hide show
  1. azure/ai/textanalytics/__init__.py +26 -197
  2. azure/ai/textanalytics/_client.py +111 -0
  3. azure/ai/textanalytics/_configuration.py +73 -0
  4. azure/ai/textanalytics/{_generated/v2022_05_01/operations → _operations}/__init__.py +13 -8
  5. azure/ai/textanalytics/_operations/_operations.py +716 -0
  6. azure/ai/textanalytics/{_generated/v2022_05_01/models → _operations}/_patch.py +8 -6
  7. azure/ai/textanalytics/_patch.py +350 -0
  8. azure/ai/textanalytics/{_generated/aio → _utils}/__init__.py +1 -5
  9. azure/ai/textanalytics/_utils/model_base.py +1237 -0
  10. azure/ai/textanalytics/{_generated/_serialization.py → _utils/serialization.py} +640 -616
  11. azure/ai/textanalytics/{_generated/v2022_05_01/aio/_vendor.py → _utils/utils.py} +10 -12
  12. azure/ai/textanalytics/_version.py +8 -7
  13. azure/ai/textanalytics/aio/__init__.py +25 -14
  14. azure/ai/textanalytics/aio/_client.py +115 -0
  15. azure/ai/textanalytics/aio/_configuration.py +75 -0
  16. azure/ai/textanalytics/{_generated/v2022_10_01_preview/aio/operations → aio/_operations}/__init__.py +13 -8
  17. azure/ai/textanalytics/aio/_operations/_operations.py +623 -0
  18. azure/ai/textanalytics/{_generated/v2022_05_01 → aio/_operations}/_patch.py +8 -6
  19. azure/ai/textanalytics/aio/_patch.py +344 -0
  20. azure/ai/textanalytics/models/__init__.py +402 -0
  21. azure/ai/textanalytics/models/_enums.py +1979 -0
  22. azure/ai/textanalytics/models/_models.py +6641 -0
  23. azure/ai/textanalytics/{_generated/v2022_05_01/aio → models}/_patch.py +8 -6
  24. azure/ai/textanalytics/py.typed +1 -0
  25. {azure_ai_textanalytics-5.3.0b1.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/METADATA +755 -319
  26. azure_ai_textanalytics-6.0.0b1.dist-info/RECORD +29 -0
  27. {azure_ai_textanalytics-5.3.0b1.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info}/WHEEL +1 -1
  28. azure/ai/textanalytics/_base_client.py +0 -111
  29. azure/ai/textanalytics/_check.py +0 -22
  30. azure/ai/textanalytics/_dict_mixin.py +0 -54
  31. azure/ai/textanalytics/_generated/__init__.py +0 -16
  32. azure/ai/textanalytics/_generated/_configuration.py +0 -70
  33. azure/ai/textanalytics/_generated/_operations_mixin.py +0 -795
  34. azure/ai/textanalytics/_generated/_text_analytics_client.py +0 -126
  35. azure/ai/textanalytics/_generated/_version.py +0 -8
  36. azure/ai/textanalytics/_generated/aio/_configuration.py +0 -66
  37. azure/ai/textanalytics/_generated/aio/_operations_mixin.py +0 -776
  38. azure/ai/textanalytics/_generated/aio/_text_analytics_client.py +0 -124
  39. azure/ai/textanalytics/_generated/models.py +0 -8
  40. azure/ai/textanalytics/_generated/v2022_05_01/__init__.py +0 -20
  41. azure/ai/textanalytics/_generated/v2022_05_01/_configuration.py +0 -72
  42. azure/ai/textanalytics/_generated/v2022_05_01/_text_analytics_client.py +0 -100
  43. azure/ai/textanalytics/_generated/v2022_05_01/_vendor.py +0 -45
  44. azure/ai/textanalytics/_generated/v2022_05_01/aio/__init__.py +0 -20
  45. azure/ai/textanalytics/_generated/v2022_05_01/aio/_configuration.py +0 -71
  46. azure/ai/textanalytics/_generated/v2022_05_01/aio/_text_analytics_client.py +0 -97
  47. azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/__init__.py +0 -18
  48. azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/_patch.py +0 -121
  49. azure/ai/textanalytics/_generated/v2022_05_01/aio/operations/_text_analytics_client_operations.py +0 -603
  50. azure/ai/textanalytics/_generated/v2022_05_01/models/__init__.py +0 -281
  51. azure/ai/textanalytics/_generated/v2022_05_01/models/_models_py3.py +0 -5722
  52. azure/ai/textanalytics/_generated/v2022_05_01/models/_text_analytics_client_enums.py +0 -439
  53. azure/ai/textanalytics/_generated/v2022_05_01/operations/_patch.py +0 -120
  54. azure/ai/textanalytics/_generated/v2022_05_01/operations/_text_analytics_client_operations.py +0 -744
  55. azure/ai/textanalytics/_generated/v2022_10_01_preview/__init__.py +0 -20
  56. azure/ai/textanalytics/_generated/v2022_10_01_preview/_configuration.py +0 -72
  57. azure/ai/textanalytics/_generated/v2022_10_01_preview/_patch.py +0 -19
  58. azure/ai/textanalytics/_generated/v2022_10_01_preview/_text_analytics_client.py +0 -100
  59. azure/ai/textanalytics/_generated/v2022_10_01_preview/_vendor.py +0 -45
  60. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/__init__.py +0 -20
  61. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_configuration.py +0 -71
  62. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_patch.py +0 -19
  63. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_text_analytics_client.py +0 -97
  64. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/_vendor.py +0 -27
  65. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/operations/_patch.py +0 -121
  66. azure/ai/textanalytics/_generated/v2022_10_01_preview/aio/operations/_text_analytics_client_operations.py +0 -603
  67. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/__init__.py +0 -407
  68. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_models_py3.py +0 -8462
  69. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_patch.py +0 -72
  70. azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_text_analytics_client_enums.py +0 -730
  71. azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/__init__.py +0 -18
  72. azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/_patch.py +0 -120
  73. azure/ai/textanalytics/_generated/v2022_10_01_preview/operations/_text_analytics_client_operations.py +0 -744
  74. azure/ai/textanalytics/_generated/v3_0/__init__.py +0 -20
  75. azure/ai/textanalytics/_generated/v3_0/_configuration.py +0 -66
  76. azure/ai/textanalytics/_generated/v3_0/_patch.py +0 -31
  77. azure/ai/textanalytics/_generated/v3_0/_text_analytics_client.py +0 -96
  78. azure/ai/textanalytics/_generated/v3_0/_vendor.py +0 -33
  79. azure/ai/textanalytics/_generated/v3_0/aio/__init__.py +0 -20
  80. azure/ai/textanalytics/_generated/v3_0/aio/_configuration.py +0 -65
  81. azure/ai/textanalytics/_generated/v3_0/aio/_patch.py +0 -31
  82. azure/ai/textanalytics/_generated/v3_0/aio/_text_analytics_client.py +0 -93
  83. azure/ai/textanalytics/_generated/v3_0/aio/_vendor.py +0 -27
  84. azure/ai/textanalytics/_generated/v3_0/aio/operations/__init__.py +0 -18
  85. azure/ai/textanalytics/_generated/v3_0/aio/operations/_patch.py +0 -19
  86. azure/ai/textanalytics/_generated/v3_0/aio/operations/_text_analytics_client_operations.py +0 -428
  87. azure/ai/textanalytics/_generated/v3_0/models/__init__.py +0 -81
  88. azure/ai/textanalytics/_generated/v3_0/models/_models_py3.py +0 -1467
  89. azure/ai/textanalytics/_generated/v3_0/models/_patch.py +0 -19
  90. azure/ai/textanalytics/_generated/v3_0/models/_text_analytics_client_enums.py +0 -58
  91. azure/ai/textanalytics/_generated/v3_0/operations/__init__.py +0 -18
  92. azure/ai/textanalytics/_generated/v3_0/operations/_patch.py +0 -19
  93. azure/ai/textanalytics/_generated/v3_0/operations/_text_analytics_client_operations.py +0 -604
  94. azure/ai/textanalytics/_generated/v3_1/__init__.py +0 -20
  95. azure/ai/textanalytics/_generated/v3_1/_configuration.py +0 -66
  96. azure/ai/textanalytics/_generated/v3_1/_patch.py +0 -31
  97. azure/ai/textanalytics/_generated/v3_1/_text_analytics_client.py +0 -98
  98. azure/ai/textanalytics/_generated/v3_1/_vendor.py +0 -45
  99. azure/ai/textanalytics/_generated/v3_1/aio/__init__.py +0 -20
  100. azure/ai/textanalytics/_generated/v3_1/aio/_configuration.py +0 -65
  101. azure/ai/textanalytics/_generated/v3_1/aio/_patch.py +0 -31
  102. azure/ai/textanalytics/_generated/v3_1/aio/_text_analytics_client.py +0 -95
  103. azure/ai/textanalytics/_generated/v3_1/aio/_vendor.py +0 -27
  104. azure/ai/textanalytics/_generated/v3_1/aio/operations/__init__.py +0 -18
  105. azure/ai/textanalytics/_generated/v3_1/aio/operations/_patch.py +0 -19
  106. azure/ai/textanalytics/_generated/v3_1/aio/operations/_text_analytics_client_operations.py +0 -1291
  107. azure/ai/textanalytics/_generated/v3_1/models/__init__.py +0 -205
  108. azure/ai/textanalytics/_generated/v3_1/models/_models_py3.py +0 -3976
  109. azure/ai/textanalytics/_generated/v3_1/models/_patch.py +0 -19
  110. azure/ai/textanalytics/_generated/v3_1/models/_text_analytics_client_enums.py +0 -367
  111. azure/ai/textanalytics/_generated/v3_1/operations/__init__.py +0 -18
  112. azure/ai/textanalytics/_generated/v3_1/operations/_patch.py +0 -19
  113. azure/ai/textanalytics/_generated/v3_1/operations/_text_analytics_client_operations.py +0 -1709
  114. azure/ai/textanalytics/_lro.py +0 -552
  115. azure/ai/textanalytics/_models.py +0 -3142
  116. azure/ai/textanalytics/_policies.py +0 -66
  117. azure/ai/textanalytics/_request_handlers.py +0 -104
  118. azure/ai/textanalytics/_response_handlers.py +0 -580
  119. azure/ai/textanalytics/_text_analytics_client.py +0 -1802
  120. azure/ai/textanalytics/_user_agent.py +0 -8
  121. azure/ai/textanalytics/_validate.py +0 -113
  122. azure/ai/textanalytics/aio/_base_client_async.py +0 -95
  123. azure/ai/textanalytics/aio/_lro_async.py +0 -501
  124. azure/ai/textanalytics/aio/_response_handlers_async.py +0 -94
  125. azure/ai/textanalytics/aio/_text_analytics_client_async.py +0 -1800
  126. azure_ai_textanalytics-5.3.0b1.dist-info/RECORD +0 -115
  127. {azure_ai_textanalytics-5.3.0b1.dist-info → azure_ai_textanalytics-6.0.0b1.dist-info/licenses}/LICENSE +0 -0
  128. {azure_ai_textanalytics-5.3.0b1.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,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: setuptools (77.0.3)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,111 +0,0 @@
1
- # ------------------------------------
2
- # Copyright (c) Microsoft Corporation.
3
- # Licensed under the MIT License.
4
- # ------------------------------------
5
-
6
- from typing import Union, Any
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
- **kwargs: Any
52
- ) -> None:
53
- http_logging_policy = HttpLoggingPolicy(**kwargs)
54
- http_logging_policy.allowed_header_names.update(
55
- {
56
- "Operation-Location",
57
- "apim-request-id",
58
- "x-envoy-upstream-service-time",
59
- "Strict-Transport-Security",
60
- "x-content-type-options",
61
- "warn-code",
62
- "warn-agent",
63
- "warn-text",
64
- }
65
- )
66
- http_logging_policy.allowed_query_params.update(
67
- {
68
- "model-version",
69
- "showStats",
70
- "loggingOptOut",
71
- "domain",
72
- "stringIndexType",
73
- "piiCategories",
74
- "$top",
75
- "$skip",
76
- "opinionMining",
77
- "api-version"
78
- }
79
- )
80
- try:
81
- endpoint = endpoint.rstrip("/")
82
- except AttributeError:
83
- raise ValueError("Parameter 'endpoint' must be a string.")
84
-
85
- self._api_version = kwargs.pop("api_version", DEFAULT_API_VERSION)
86
- if hasattr(self._api_version, "value"):
87
- self._api_version = self._api_version.value
88
- self._client = _TextAnalyticsClient(
89
- endpoint=endpoint,
90
- credential=credential, # type: ignore
91
- api_version=self._api_version,
92
- sdk_moniker=USER_AGENT,
93
- authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)),
94
- custom_hook_policy=kwargs.pop("custom_hook_policy", TextAnalyticsResponseHookPolicy(**kwargs)),
95
- http_logging_policy=kwargs.pop("http_logging_policy", http_logging_policy),
96
- per_retry_policies=kwargs.get("per_retry_policies", QuotaExceededPolicy()),
97
- **kwargs
98
- )
99
-
100
- def __enter__(self):
101
- self._client.__enter__() # pylint:disable=no-member
102
- return self
103
-
104
- def __exit__(self, *args):
105
- self._client.__exit__(*args) # pylint:disable=no-member
106
-
107
- def close(self) -> None:
108
- """Close sockets opened by the client.
109
- Calling this method is unnecessary when using the client as a context manager.
110
- """
111
- self._client.close()
@@ -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,54 +0,0 @@
1
- # ------------------------------------
2
- # Copyright (c) Microsoft Corporation.
3
- # Licensed under the MIT License.
4
- # ------------------------------------
5
-
6
- class DictMixin:
7
- def __setitem__(self, key, item):
8
- self.__dict__[key] = item
9
-
10
- def __getitem__(self, key):
11
- return self.__dict__[key]
12
-
13
- def __repr__(self):
14
- return str(self)
15
-
16
- def __len__(self):
17
- return len(self.keys())
18
-
19
- def __delitem__(self, key):
20
- self.__dict__[key] = None
21
-
22
- def __eq__(self, other):
23
- if isinstance(other, self.__class__):
24
- return self.__dict__ == other.__dict__
25
- return False
26
-
27
- def __ne__(self, other):
28
- return not self.__eq__(other)
29
-
30
- def __contains__(self, key):
31
- return key in self.__dict__
32
-
33
- def __str__(self):
34
- return str({k: v for k, v in self.__dict__.items() if not k.startswith("_")})
35
-
36
- def has_key(self, k):
37
- return k in self.__dict__
38
-
39
- def update(self, *args, **kwargs):
40
- return self.__dict__.update(*args, **kwargs)
41
-
42
- def keys(self):
43
- return [k for k in self.__dict__ if not k.startswith("_")]
44
-
45
- def values(self):
46
- return [v for k, v in self.__dict__.items() if not k.startswith("_")]
47
-
48
- def items(self):
49
- return [(k, v) for k, v in self.__dict__.items() if not k.startswith("_")]
50
-
51
- def get(self, key, default=None):
52
- if key in self.__dict__:
53
- return self.__dict__[key]
54
- 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)