Skip to content

Commit 7080e2a

Browse files
[AutoRelease] t2-security-2022-11-10-60439(can only be merged by SDK owner) (Azure#27420)
* code and test * Update CHANGELOG.md Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: zhenbiao wei <[email protected]>
1 parent ba4aedd commit 7080e2a

File tree

330 files changed

+11651
-3798
lines changed

Some content is hidden

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

330 files changed

+11651
-3798
lines changed

sdk/security/azure-mgmt-security/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Release History
22

3+
## 3.0.0 (2022-11-17)
4+
5+
### Features Added
6+
7+
- Model DefenderFoDatabasesAwsOffering has a new parameter rds
8+
9+
### Breaking Changes
10+
11+
- Model DefenderFoDatabasesAwsOfferingArcAutoProvisioning no longer has parameter service_principal_secret_metadata
12+
- Model DefenderForDatabasesGcpOfferingArcAutoProvisioning no longer has parameter configuration
13+
- Model DefenderForServersAwsOfferingArcAutoProvisioning no longer has parameter service_principal_secret_metadata
14+
- Model DefenderForServersGcpOfferingArcAutoProvisioning no longer has parameter configuration
15+
316
## 2.0.0 (2022-09-28)
417

518
### Features Added
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.8.4",
2+
"commit": "8a20cee044fafde7ae0364edab45a577aa80d20f",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@6.1.5",
5-
"@autorest/modelerfour@4.23.5"
6+
"@autorest/python@6.2.1",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "e21f2da8dacad060a3612dc8ae0fe6de48b15986",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/security/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.8.4 --version-tolerant=False",
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/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/security/resource-manager/readme.md"
1111
}

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

Lines changed: 67 additions & 0 deletions
Large diffs are not rendered by default.

sdk/security/azure-mgmt-security/azure/mgmt/security/_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 = "2.0.0"
9+
VERSION = "3.0.0"

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

Lines changed: 67 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
2020

21-
__all__ = ["SecurityCenter"]
21+
__all__ = [
22+
"SecurityCenter",
23+
]
2224
__all__.extend([p for p in _patch_all if p not in __all__])
2325

2426
_patch_sdk()

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

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

9+
import sys
910
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
@@ -14,6 +15,11 @@
1415

1516
from ._version import VERSION
1617

18+
if sys.version_info >= (3, 8):
19+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20+
else:
21+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22+
1723
if TYPE_CHECKING:
1824
# pylint: disable=unused-import,ungrouped-imports
1925
from azure.core.credentials import TokenCredential
@@ -36,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in
3642

3743
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
3844
super(SecurityCenterConfiguration, self).__init__(**kwargs)
39-
api_version = kwargs.pop("api_version", "2015-06-01-preview") # type: str
45+
api_version = kwargs.pop("api_version", "2015-06-01-preview") # type: Literal["2015-06-01-preview"]
4046

4147
if credential is None:
4248
raise ValueError("Parameter 'credential' must not be None.")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@
101101
"operations": "Operations",
102102
"tasks": "TasksOperations"
103103
}
104-
}
104+
}

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 = "2.0.0"
9+
VERSION = "3.0.0"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
_patch_all = []
1616
from ._patch import patch_sdk as _patch_sdk
1717

18-
__all__ = ["SecurityCenter"]
18+
__all__ = [
19+
"SecurityCenter",
20+
]
1921
__all__.extend([p for p in _patch_all if p not in __all__])
2022

2123
_patch_sdk()

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

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

9+
import sys
910
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
@@ -14,6 +15,11 @@
1415

1516
from .._version import VERSION
1617

18+
if sys.version_info >= (3, 8):
19+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20+
else:
21+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22+
1723
if TYPE_CHECKING:
1824
# pylint: disable=unused-import,ungrouped-imports
1925
from azure.core.credentials_async import AsyncTokenCredential
@@ -36,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in
3642

3743
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
3844
super(SecurityCenterConfiguration, self).__init__(**kwargs)
39-
api_version = kwargs.pop("api_version", "2015-06-01-preview") # type: str
45+
api_version = kwargs.pop("api_version", "2015-06-01-preview") # type: Literal["2015-06-01-preview"]
4046

4147
if credential is None:
4248
raise ValueError("Parameter 'credential' must not be None.")

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
# Code generated by Microsoft (R) AutoRest Code Generator.
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
9+
import sys
910
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
10-
from urllib.parse import parse_qs, urljoin, urlparse
11+
import urllib.parse
1112

1213
from azure.core.async_paging import AsyncItemPaged, AsyncList
1314
from azure.core.exceptions import (
@@ -30,6 +31,10 @@
3031
from ..._vendor import _convert_request
3132
from ...operations._locations_operations import build_get_request, build_list_request
3233

34+
if sys.version_info >= (3, 8):
35+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
36+
else:
37+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
3338
T = TypeVar("T")
3439
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
3540

@@ -68,7 +73,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.AscLocation"]:
6873
_headers = kwargs.pop("headers", {}) or {}
6974
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
7075

71-
api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-01-preview")) # type: str
76+
api_version = kwargs.pop(
77+
"api_version", _params.pop("api-version", "2015-06-01-preview")
78+
) # type: Literal["2015-06-01-preview"]
7279
cls = kwargs.pop("cls", None) # type: ClsType[_models.AscLocationList]
7380

7481
error_map = {
@@ -94,10 +101,17 @@ def prepare_request(next_link=None):
94101

95102
else:
96103
# make call to next link with the client's api-version
97-
_parsed_next_link = urlparse(next_link)
98-
_next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query))
104+
_parsed_next_link = urllib.parse.urlparse(next_link)
105+
_next_request_params = case_insensitive_dict(
106+
{
107+
key: [urllib.parse.quote(v) for v in value]
108+
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
109+
}
110+
)
99111
_next_request_params["api-version"] = self._config.api_version
100-
request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params)
112+
request = HttpRequest(
113+
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
114+
)
101115
request = _convert_request(request)
102116
request.url = self._client.format_url(request.url) # type: ignore
103117
request.method = "GET"
@@ -151,7 +165,9 @@ async def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation:
151165
_headers = kwargs.pop("headers", {}) or {}
152166
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
153167

154-
api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-01-preview")) # type: str
168+
api_version = kwargs.pop(
169+
"api_version", _params.pop("api-version", "2015-06-01-preview")
170+
) # type: Literal["2015-06-01-preview"]
155171
cls = kwargs.pop("cls", None) # type: ClsType[_models.AscLocation]
156172

157173
request = build_get_request(

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

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
# Code generated by Microsoft (R) AutoRest Code Generator.
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
9+
import sys
910
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
10-
from urllib.parse import parse_qs, urljoin, urlparse
11+
import urllib.parse
1112

1213
from azure.core.async_paging import AsyncItemPaged, AsyncList
1314
from azure.core.exceptions import (
@@ -29,6 +30,10 @@
2930
from ..._vendor import _convert_request
3031
from ...operations._operations import build_list_request
3132

33+
if sys.version_info >= (3, 8):
34+
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
35+
else:
36+
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
3237
T = TypeVar("T")
3338
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
3439

@@ -65,7 +70,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
6570
_headers = kwargs.pop("headers", {}) or {}
6671
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
6772

68-
api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-01-preview")) # type: str
73+
api_version = kwargs.pop(
74+
"api_version", _params.pop("api-version", "2015-06-01-preview")
75+
) # type: Literal["2015-06-01-preview"]
6976
cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList]
7077

7178
error_map = {
@@ -90,10 +97,17 @@ def prepare_request(next_link=None):
9097

9198
else:
9299
# make call to next link with the client's api-version
93-
_parsed_next_link = urlparse(next_link)
94-
_next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query))
100+
_parsed_next_link = urllib.parse.urlparse(next_link)
101+
_next_request_params = case_insensitive_dict(
102+
{
103+
key: [urllib.parse.quote(v) for v in value]
104+
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
105+
}
106+
)
95107
_next_request_params["api-version"] = self._config.api_version
96-
request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params)
108+
request = HttpRequest(
109+
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
110+
)
97111
request = _convert_request(request)
98112
request.url = self._client.format_url(request.url) # type: ignore
99113
request.method = "GET"

0 commit comments

Comments
 (0)