Skip to content

Commit aec54ca

Browse files
author
SDKAuto
committed
CodeGen from PR 19112 in Azure/azure-rest-api-specs
Merge c6725bc17563244e3aa352aa278497453a9cbc8f into 61001b68a8aa743f0dd890224c6b5cb130ef006e
1 parent 0db0c16 commit aec54ca

File tree

116 files changed

+28735
-23634
lines changed

Some content is hidden

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

116 files changed

+28735
-23634
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/modelerfour@4.19.2"
4+
"@autorest/python@5.13.0",
5+
"@autorest/modelerfour@4.19.3"
66
],
7-
"commit": "a8719243647b7c6d06ed287483d788808de7ecab",
7+
"commit": "c30890a6a6e85f10b3c6dbfc16bdb619b61122a1",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/security/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5",
9+
"autorest_command": "autorest specification/security/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
1010
"readme": "specification/security/resource-manager/readme.md"
1111
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
__version__ = VERSION
1313
__all__ = ['SecurityCenter']
1414

15-
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
18-
except ImportError:
19-
pass
15+
# `._patch.py` is used for handwritten extensions to the generated code
16+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17+
from ._patch import patch_sdk
18+
patch_sdk()

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

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,20 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING
9+
from typing import Any, TYPE_CHECKING
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

1717
if TYPE_CHECKING:
1818
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2119
from azure.core.credentials import TokenCredential
2220

2321

24-
class SecurityCenterConfiguration(Configuration):
22+
class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2523
"""Configuration for SecurityCenter.
2624
2725
Note that all parameters used to create this instance are saved as instance
@@ -31,29 +29,22 @@ class SecurityCenterConfiguration(Configuration):
3129
:type credential: ~azure.core.credentials.TokenCredential
3230
:param subscription_id: Azure subscription ID.
3331
:type subscription_id: str
34-
:param asc_location: The location where ASC stores the data of the subscription. can be retrieved from Get locations.
35-
:type asc_location: str
3632
"""
3733

3834
def __init__(
3935
self,
40-
credential, # type: "TokenCredential"
41-
subscription_id, # type: str
42-
asc_location, # type: str
43-
**kwargs # type: Any
44-
):
45-
# type: (...) -> None
36+
credential: "TokenCredential",
37+
subscription_id: str,
38+
**kwargs: Any
39+
) -> None:
40+
super(SecurityCenterConfiguration, self).__init__(**kwargs)
4641
if credential is None:
4742
raise ValueError("Parameter 'credential' must not be None.")
4843
if subscription_id is None:
4944
raise ValueError("Parameter 'subscription_id' must not be None.")
50-
if asc_location is None:
51-
raise ValueError("Parameter 'asc_location' must not be None.")
52-
super(SecurityCenterConfiguration, self).__init__(**kwargs)
5345

5446
self.credential = credential
5547
self.subscription_id = subscription_id
56-
self.asc_location = asc_location
5748
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5849
kwargs.setdefault('sdk_moniker', 'mgmt-security/{}'.format(VERSION))
5950
self._configure(**kwargs)
@@ -73,4 +64,4 @@ def _configure(
7364
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
7465
self.authentication_policy = kwargs.get('authentication_policy')
7566
if self.credential and not self.authentication_policy:
76-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
67+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

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

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"chosen_version": "",
3-
"total_api_version_list": ["2015-06-01-preview", "2017-08-01", "2017-08-01-preview", "2018-06-01", "2019-01-01", "2019-01-01-preview", "2019-08-01", "2020-01-01", "2020-01-01-preview", "2020-07-01-preview", "2021-01-01", "2021-01-15-preview", "2021-05-01-preview", "2021-07-01"],
3+
"total_api_version_list": ["2015-06-01-preview", "2017-08-01", "2017-08-01-preview", "2019-01-01", "2019-01-01-preview", "2019-08-01", "2020-01-01", "2020-01-01-preview", "2020-07-01-preview", "2021-01-15-preview", "2021-05-01-preview", "2021-06-01", "2021-07-01-preview", "2021-10-01-preview", "2021-11-01", "2022-03-01", "2022-05-01"],
44
"client": {
55
"name": "SecurityCenter",
66
"filename": "_security_center",
77
"description": "API spec for Microsoft.Security (Azure Security Center) resource provider.",
8-
"base_url": "\u0027https://management.azure.com\u0027",
9-
"custom_base_url": null,
8+
"host_value": "\"https://management.azure.com\"",
9+
"parameterized_host_template": null,
1010
"azure_arm": true,
1111
"has_lro_operations": true,
1212
"client_side_validation": false,
13-
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14-
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
1515
},
1616
"global_parameters": {
1717
"sync": {
@@ -26,12 +26,6 @@
2626
"description": "Azure subscription ID.",
2727
"docstring_type": "str",
2828
"required": true
29-
},
30-
"asc_location": {
31-
"signature": "asc_location, # type: str",
32-
"description": "The location where ASC stores the data of the subscription. can be retrieved from Get locations.",
33-
"docstring_type": "str",
34-
"required": true
3529
}
3630
},
3731
"async": {
@@ -46,17 +40,11 @@
4640
"description": "Azure subscription ID.",
4741
"docstring_type": "str",
4842
"required": true
49-
},
50-
"asc_location": {
51-
"signature": "asc_location: str,",
52-
"description": "The location where ASC stores the data of the subscription. can be retrieved from Get locations.",
53-
"docstring_type": "str",
54-
"required": true
5543
}
5644
},
5745
"constant": {
5846
},
59-
"call": "credential, subscription_id, asc_location",
47+
"call": "credential, subscription_id",
6048
"service_client_specific": {
6149
"sync": {
6250
"api_version": {
@@ -66,7 +54,7 @@
6654
"required": false
6755
},
6856
"base_url": {
69-
"signature": "base_url=None, # type: Optional[str]",
57+
"signature": "base_url=\"https://management.azure.com\", # type: str",
7058
"description": "Service URL",
7159
"docstring_type": "str",
7260
"required": false
@@ -86,7 +74,7 @@
8674
"required": false
8775
},
8876
"base_url": {
89-
"signature": "base_url: Optional[str] = None,",
77+
"signature": "base_url: str = \"https://management.azure.com\",",
9078
"description": "Service URL",
9179
"docstring_type": "str",
9280
"required": false
@@ -103,13 +91,15 @@
10391
"config": {
10492
"credential": true,
10593
"credential_scopes": ["https://management.azure.com/.default"],
106-
"credential_default_policy_type": "BearerTokenCredentialPolicy",
107-
"credential_default_policy_type_has_async_version": true,
108-
"credential_key_header_name": null,
109-
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
110-
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
94+
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
95+
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
96+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
97+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
11198
},
11299
"operation_groups": {
100+
"mde_onboardings": "MdeOnboardingsOperations",
101+
"custom_assessment_automations": "CustomAssessmentAutomationsOperations",
102+
"custom_entity_store_assignments": "CustomEntityStoreAssignmentsOperations",
113103
"compliance_results": "ComplianceResultsOperations",
114104
"pricings": "PricingsOperations",
115105
"advanced_threat_protection": "AdvancedThreatProtectionOperations",
@@ -154,6 +144,7 @@
154144
"alerts": "AlertsOperations",
155145
"settings": "SettingsOperations",
156146
"ingestion_settings": "IngestionSettingsOperations",
157-
"software_inventories": "SoftwareInventoriesOperations"
147+
"software_inventories": "SoftwareInventoriesOperations",
148+
"security_connectors": "SecurityConnectorsOperations"
158149
}
159150
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
#
4+
# Copyright (c) Microsoft Corporation. All rights reserved.
5+
#
6+
# The MIT License (MIT)
7+
#
8+
# Permission is hereby granted, free of charge, to any person obtaining a copy
9+
# of this software and associated documentation files (the ""Software""), to
10+
# deal in the Software without restriction, including without limitation the
11+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12+
# sell copies of the Software, and to permit persons to whom the Software is
13+
# furnished to do so, subject to the following conditions:
14+
#
15+
# The above copyright notice and this permission notice shall be included in
16+
# all copies or substantial portions of the Software.
17+
#
18+
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24+
# IN THE SOFTWARE.
25+
#
26+
# --------------------------------------------------------------------------
27+
28+
# This file is used for handwritten extensions to the generated code. Example:
29+
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
30+
def patch_sdk():
31+
pass

0 commit comments

Comments
 (0)