Skip to content

Commit 619b331

Browse files
azure-sdkChenxiJiang333
authored andcommitted
[AutoRelease] t2-appconfiguration-2024-10-30-38914(can only be merged by SDK owner) (Azure#38177)
* code and test * update-testcase --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent a8ded4f commit 619b331

File tree

140 files changed

+629
-31543
lines changed

Some content is hidden

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

140 files changed

+629
-31543
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 4.0.0 (2024-10-29)
4+
5+
### Breaking Changes
6+
7+
- This package now only targets the latest Api-Version available on Azure and removes APIs of other Api-Version. After this change, the package can have much smaller size. If your application requires a specific and non-latest Api-Version, it's recommended to pin this package to the previous released version; If your application always only use latest Api-Version, please ingore this change.
8+
39
## 3.1.0 (2024-10-21)
410

511
### Features Added
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
{
2-
"commit": "63c41aa20e38fe6d2ddd1a367b4fe57e8b601c34",
2+
"commit": "2776cb32cd6ca9ea953a13ae26c954b989e83367",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
66
"@autorest/[email protected]",
77
"@autorest/[email protected]"
88
],
99
"autorest_command": "autorest specification/appconfiguration/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/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/appconfiguration/resource-manager/readme.md",
11-
"package-2024-05-01": "2024-09-09 14:41:31 -0400 2b700e5e84d4a95880d373e6a4bce5d16882e4b5 Microsoft.AppConfiguration/stable/2024-05-01/appconfiguration.json",
12-
"package-2023-03-01": "2023-05-03 21:13:49 -0700 32e5ec18ee2125c2638de8d48d63053fa5e4af93 Microsoft.AppConfiguration/stable/2023-03-01/appconfiguration.json",
13-
"package-2022-05-01": "2023-02-02 21:00:54 -0500 2c4244e5bcb8939167b79f633cdc17a1f0eae9be Microsoft.AppConfiguration/stable/2022-05-01/appconfiguration.json",
14-
"package-2022-03-01-preview": "2022-07-19 19:54:15 -0700 0e1a9820941badc06e99bda9d1efa59de777efbf Microsoft.AppConfiguration/preview/2022-03-01-preview/appconfiguration.json"
10+
"readme": "specification/appconfiguration/resource-manager/readme.md"
1511
}

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

+12-6
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@
77
# --------------------------------------------------------------------------
88

99
from ._app_configuration_management_client import AppConfigurationManagementClient
10-
__all__ = ['AppConfigurationManagementClient']
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
1113

1214
try:
13-
from ._patch import patch_sdk # type: ignore
14-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # pylint: disable=unused-wildcard-import
1517
except ImportError:
16-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
1720

18-
from ._version import VERSION
21+
__all__ = [
22+
"AppConfigurationManagementClient",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
1925

20-
__version__ = VERSION
26+
_patch_sdk()

sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py

+86-225
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# 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-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
75
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
8+
119
from typing import Any, TYPE_CHECKING
1210

1311
from azure.core.pipeline import policies
@@ -19,7 +17,8 @@
1917
# pylint: disable=unused-import,ungrouped-imports
2018
from azure.core.credentials import TokenCredential
2119

22-
class AppConfigurationManagementClientConfiguration:
20+
21+
class AppConfigurationManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for AppConfigurationManagementClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -29,38 +28,38 @@ class AppConfigurationManagementClientConfiguration:
2928
:type credential: ~azure.core.credentials.TokenCredential
3029
:param subscription_id: The Microsoft Azure subscription ID. Required.
3130
:type subscription_id: str
31+
:keyword api_version: Api Version. Default value is "2024-05-01". Note that overriding this
32+
default value may result in unsupported behavior.
33+
:paramtype api_version: str
3234
"""
3335

34-
def __init__(
35-
self,
36-
credential: "TokenCredential",
37-
subscription_id: str,
38-
**kwargs: Any
39-
):
36+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37+
api_version: str = kwargs.pop("api_version", "2024-05-01")
38+
4039
if credential is None:
4140
raise ValueError("Parameter 'credential' must not be None.")
4241
if subscription_id is None:
4342
raise ValueError("Parameter 'subscription_id' must not be None.")
4443

4544
self.credential = credential
4645
self.subscription_id = subscription_id
47-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
48-
kwargs.setdefault('sdk_moniker', 'azure-mgmt-appconfiguration/{}'.format(VERSION))
46+
self.api_version = api_version
47+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
48+
kwargs.setdefault("sdk_moniker", "mgmt-appconfiguration/{}".format(VERSION))
4949
self.polling_interval = kwargs.get("polling_interval", 30)
5050
self._configure(**kwargs)
5151

52-
def _configure(
53-
self,
54-
**kwargs: Any
55-
):
56-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
57-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
58-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
59-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
60-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
61-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
62-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
63-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
64-
self.authentication_policy = kwargs.get('authentication_policy')
52+
def _configure(self, **kwargs: Any) -> None:
53+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
54+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
55+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
56+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
57+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
58+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
59+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
61+
self.authentication_policy = kwargs.get("authentication_policy")
6562
if self.credential and not self.authentication_policy:
66-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
63+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
64+
self.credential, *self.credential_scopes, **kwargs
65+
)

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

+6-12
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
351351
def as_dict(
352352
self,
353353
keep_readonly: bool = True,
354-
key_transformer: Callable[
355-
[str, Dict[str, Any], Any], Any
356-
] = attribute_transformer,
354+
key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
357355
**kwargs: Any
358356
) -> JSON:
359357
"""Return a dict that can be serialized using json.dump.
@@ -542,7 +540,7 @@ class Serializer(object):
542540
"multiple": lambda x, y: x % y != 0,
543541
}
544542

545-
def __init__(self, classes: Optional[Mapping[str, type]]=None):
543+
def __init__(self, classes: Optional[Mapping[str, type]] = None):
546544
self.serialize_type = {
547545
"iso-8601": Serializer.serialize_iso,
548546
"rfc-1123": Serializer.serialize_rfc,
@@ -750,7 +748,7 @@ def query(self, name, data, data_type, **kwargs):
750748
# Treat the list aside, since we don't want to encode the div separator
751749
if data_type.startswith("["):
752750
internal_data_type = data_type[1:-1]
753-
do_quote = not kwargs.get('skip_quote', False)
751+
do_quote = not kwargs.get("skip_quote", False)
754752
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
755753

756754
# Not a list, regular serialization
@@ -909,12 +907,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
909907
raise
910908
serialized.append(None)
911909

912-
if kwargs.get('do_quote', False):
913-
serialized = [
914-
'' if s is None else quote(str(s), safe='')
915-
for s
916-
in serialized
917-
]
910+
if kwargs.get("do_quote", False):
911+
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
918912

919913
if div:
920914
serialized = ["" if s is None else str(s) for s in serialized]
@@ -1371,7 +1365,7 @@ class Deserializer(object):
13711365

13721366
valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
13731367

1374-
def __init__(self, classes: Optional[Mapping[str, type]]=None):
1368+
def __init__(self, classes: Optional[Mapping[str, type]] = None):
13751369
self.deserialize_type = {
13761370
"iso-8601": Deserializer.deserialize_iso,
13771371
"rfc-1123": Deserializer.deserialize_rfc,
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
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.
67
# --------------------------------------------------------------------------
78

8-
VERSION = "3.1.0"
9+
VERSION = "4.0.0"

sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/aio/__init__.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,17 @@
77
# --------------------------------------------------------------------------
88

99
from ._app_configuration_management_client import AppConfigurationManagementClient
10-
__all__ = ['AppConfigurationManagementClient']
10+
11+
try:
12+
from ._patch import __all__ as _patch_all
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
except ImportError:
15+
_patch_all = []
16+
from ._patch import patch_sdk as _patch_sdk
17+
18+
__all__ = [
19+
"AppConfigurationManagementClient",
20+
]
21+
__all__.extend([p for p in _patch_all if p not in __all__])
22+
23+
_patch_sdk()

0 commit comments

Comments
 (0)