Skip to content

Commit 864fc0a

Browse files
author
SDKAuto
committed
CodeGen from PR 30414 in Azure/azure-rest-api-specs
Merge 6e51f569fb0df4c2a3f61fd075fb3ec8c545988a into f5321f9b29083f9ea4c028e7484504875e04a758
1 parent 197df58 commit 864fc0a

File tree

434 files changed

+3309
-6167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

434 files changed

+3309
-6167
lines changed

sdk/security/azure-mgmt-security/_meta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"commit": "5485fc4eb11debd9cc8d92ec156b573998aae977",
2+
"commit": "4660907d10e2004c30ce7c8d06c954901527600b",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.13.16",
6+
"@autorest/python@6.19.0",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/security/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.16 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/security/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/security/resource-manager/readme.md",
1111
"package-2023-11-15": "2023-09-12 12:04:57 -0700 32c178f2467f792a322f56174be244135d2c907f Microsoft.Security/stable/2023-11-15/apiCollections.json",
1212
"package-preview-2023-03-only": "2023-03-23 11:34:42 +0200 2db2beee2fed67b08d273fdac7a51aba02ac2f80 Microsoft.Security/preview/2023-03-01-preview/securityConnectors.json",
1313
"package-preview-2023-02-only": "2023-03-10 09:31:28 +0200 a2e2617050e68ae1c445db565076c5a7f42ebad4 Microsoft.Security/preview/2023-02-01-preview/healthReports.json",
1414
"package-preview-2023-01-only": "2023-03-28 11:35:29 +0300 0e2c3d175e126284c5db1d3099b61e46e462fb74 Microsoft.Security/preview/2023-01-01-preview/securityOperators.json",
1515
"package-2023-01": "2023-03-27 17:16:35 +0300 efd2b52bcf2b06e174f7008b2728f70ee7f972bd Microsoft.Security/stable/2023-01-01/pricings.json",
16-
"package-preview-2022-12": "2023-09-12 22:01:54 +0300 b09b155f738b4178bcfe820f54f8702a94eb9d90 Microsoft.Security/preview/2022-12-01-preview/defenderForStorageSettings.json",
16+
"package-preview-2022-12": "2024-07-01 22:47:55 +0300 be978e57137bfd799e350575c0fdd53511f0e4a8 Microsoft.Security/preview/2022-12-01-preview/defenderForStorageSettings.json",
1717
"package-preview-2022-08": "2022-09-20 03:45:43 +0300 9000eea3aa90071c2814f663dd763d7fc1668bed Microsoft.Security/preview/2022-08-01-preview/securityConnectors.json",
1818
"package-preview-2022-07": "2022-11-01 04:47:16 +0200 312544c27464f61bf9639924099d4238bdfa1d71 Microsoft.Security/preview/2022-07-01-preview/applications.json",
1919
"package-2022-05": "2022-06-09 12:47:24 +0300 d006e1d15d8fe19a6c558861dd5bba6b7baa8dd8 Microsoft.Security/stable/2022-05-01/settings.json",

sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# --------------------------------------------------------------------------
1111

1212
from typing import Any, Optional, TYPE_CHECKING
13+
from typing_extensions import Self
1314

1415
from azure.core.pipeline import policies
1516
from azure.mgmt.core import ARMPipelineClient
@@ -60,8 +61,6 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):
6061
LATEST_PROFILE = ProfileDefinition({
6162
_PROFILE_TAG: {
6263
None: DEFAULT_API_VERSION,
63-
'adaptive_application_controls': '2020-01-01',
64-
'adaptive_network_hardenings': '2020-01-01',
6564
'advanced_threat_protection': '2019-01-01',
6665
'alerts': '2022-01-01',
6766
'alerts_suppression_rules': '2019-01-01-preview',
@@ -323,34 +322,6 @@ def models(cls, api_version=DEFAULT_API_VERSION):
323322
return models
324323
raise ValueError("API version {} is not available".format(api_version))
325324

326-
@property
327-
def adaptive_application_controls(self):
328-
"""Instance depends on the API version:
329-
330-
* 2020-01-01: :class:`AdaptiveApplicationControlsOperations<azure.mgmt.security.v2020_01_01.operations.AdaptiveApplicationControlsOperations>`
331-
"""
332-
api_version = self._get_api_version('adaptive_application_controls')
333-
if api_version == '2020-01-01':
334-
from .v2020_01_01.operations import AdaptiveApplicationControlsOperations as OperationClass
335-
else:
336-
raise ValueError("API version {} does not have operation group 'adaptive_application_controls'".format(api_version))
337-
self._config.api_version = api_version
338-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
339-
340-
@property
341-
def adaptive_network_hardenings(self):
342-
"""Instance depends on the API version:
343-
344-
* 2020-01-01: :class:`AdaptiveNetworkHardeningsOperations<azure.mgmt.security.v2020_01_01.operations.AdaptiveNetworkHardeningsOperations>`
345-
"""
346-
api_version = self._get_api_version('adaptive_network_hardenings')
347-
if api_version == '2020-01-01':
348-
from .v2020_01_01.operations import AdaptiveNetworkHardeningsOperations as OperationClass
349-
else:
350-
raise ValueError("API version {} does not have operation group 'adaptive_network_hardenings'".format(api_version))
351-
self._config.api_version = api_version
352-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
353-
354325
@property
355326
def advanced_threat_protection(self):
356327
"""Instance depends on the API version:

sdk/security/azure-mgmt-security/azure/mgmt/security/_serialization.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def _json_attemp(data):
144144
# context otherwise.
145145
_LOGGER.critical("Wasn't XML not JSON, failing")
146146
raise DeserializationError("XML is invalid") from err
147+
elif content_type.startswith("text/"):
148+
return data_as_str
147149
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))
148150

149151
@classmethod
@@ -1447,7 +1449,7 @@ def _deserialize(self, target_obj, data):
14471449
elif isinstance(response, type) and issubclass(response, Enum):
14481450
return self.deserialize_enum(data, response)
14491451

1450-
if data is None:
1452+
if data is None or data is CoreNull:
14511453
return data
14521454
try:
14531455
attributes = response._attribute_map # type: ignore

sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# --------------------------------------------------------------------------
1111

1212
from typing import Any, Optional, TYPE_CHECKING
13+
from typing_extensions import Self
1314

1415
from azure.core.pipeline import policies
1516
from azure.mgmt.core import AsyncARMPipelineClient
@@ -60,8 +61,6 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient):
6061
LATEST_PROFILE = ProfileDefinition({
6162
_PROFILE_TAG: {
6263
None: DEFAULT_API_VERSION,
63-
'adaptive_application_controls': '2020-01-01',
64-
'adaptive_network_hardenings': '2020-01-01',
6564
'advanced_threat_protection': '2019-01-01',
6665
'alerts': '2022-01-01',
6766
'alerts_suppression_rules': '2019-01-01-preview',
@@ -323,34 +322,6 @@ def models(cls, api_version=DEFAULT_API_VERSION):
323322
return models
324323
raise ValueError("API version {} is not available".format(api_version))
325324

326-
@property
327-
def adaptive_application_controls(self):
328-
"""Instance depends on the API version:
329-
330-
* 2020-01-01: :class:`AdaptiveApplicationControlsOperations<azure.mgmt.security.v2020_01_01.aio.operations.AdaptiveApplicationControlsOperations>`
331-
"""
332-
api_version = self._get_api_version('adaptive_application_controls')
333-
if api_version == '2020-01-01':
334-
from ..v2020_01_01.aio.operations import AdaptiveApplicationControlsOperations as OperationClass
335-
else:
336-
raise ValueError("API version {} does not have operation group 'adaptive_application_controls'".format(api_version))
337-
self._config.api_version = api_version
338-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
339-
340-
@property
341-
def adaptive_network_hardenings(self):
342-
"""Instance depends on the API version:
343-
344-
* 2020-01-01: :class:`AdaptiveNetworkHardeningsOperations<azure.mgmt.security.v2020_01_01.aio.operations.AdaptiveNetworkHardeningsOperations>`
345-
"""
346-
api_version = self._get_api_version('adaptive_network_hardenings')
347-
if api_version == '2020-01-01':
348-
from ..v2020_01_01.aio.operations import AdaptiveNetworkHardeningsOperations as OperationClass
349-
else:
350-
raise ValueError("API version {} does not have operation group 'adaptive_network_hardenings'".format(api_version))
351-
self._config.api_version = api_version
352-
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version)
353-
354325
@property
355326
def advanced_threat_protection(self):
356327
"""Instance depends on the API version:

sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"azure_arm": true,
1111
"has_public_lro_operations": false,
1212
"client_side_validation": false,
13-
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
14-
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
13+
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
14+
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
1515
},
1616
"global_parameters": {
1717
"sync": {

sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_security_center.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import HttpRequest, HttpResponse
@@ -111,7 +112,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
111112
def close(self) -> None:
112113
self._client.close()
113114

114-
def __enter__(self) -> "SecurityCenter":
115+
def __enter__(self) -> Self:
115116
self._client.__enter__()
116117
return self
117118

sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_vendor.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "7.0.0"
9+
VERSION = "1.0.0b1"

sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/_security_center.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any, Awaitable, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import AsyncHttpResponse, HttpRequest
@@ -113,7 +114,7 @@ def _send_request(
113114
async def close(self) -> None:
114115
await self._client.close()
115116

116-
async def __aenter__(self) -> "SecurityCenter":
117+
async def __aenter__(self) -> Self:
117118
await self._client.__aenter__()
118119
return self
119120

sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_locations_operations.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@
2020
map_error,
2121
)
2222
from azure.core.pipeline import PipelineResponse
23-
from azure.core.pipeline.transport import AsyncHttpResponse
24-
from azure.core.rest import HttpRequest
23+
from azure.core.rest import AsyncHttpResponse, HttpRequest
2524
from azure.core.tracing.decorator import distributed_trace
2625
from azure.core.tracing.decorator_async import distributed_trace_async
2726
from azure.core.utils import case_insensitive_dict
2827
from azure.mgmt.core.exceptions import ARMErrorFormat
2928

3029
from ... import models as _models
31-
from ..._vendor import _convert_request
3230
from ...operations._locations_operations import build_get_request, build_list_request
3331

3432
if sys.version_info >= (3, 9):
@@ -95,7 +93,6 @@ def prepare_request(next_link=None):
9593
headers=_headers,
9694
params=_params,
9795
)
98-
_request = _convert_request(_request)
9996
_request.url = self._client.format_url(_request.url)
10097

10198
else:
@@ -111,7 +108,6 @@ def prepare_request(next_link=None):
111108
_request = HttpRequest(
112109
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
113110
)
114-
_request = _convert_request(_request)
115111
_request.url = self._client.format_url(_request.url)
116112
_request.method = "GET"
117113
return _request
@@ -174,7 +170,6 @@ async def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation:
174170
headers=_headers,
175171
params=_params,
176172
)
177-
_request = _convert_request(_request)
178173
_request.url = self._client.format_url(_request.url)
179174

180175
_stream = False
@@ -188,7 +183,7 @@ async def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation:
188183
map_error(status_code=response.status_code, response=response, error_map=error_map)
189184
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
190185

191-
deserialized = self._deserialize("AscLocation", pipeline_response)
186+
deserialized = self._deserialize("AscLocation", pipeline_response.http_response)
192187

193188
if cls:
194189
return cls(pipeline_response, deserialized, {}) # type: ignore

0 commit comments

Comments
 (0)