Skip to content

Commit 7be3aeb

Browse files
azure-sdkChenxiJiang333
authored andcommitted
[AutoRelease] t2-extendedlocation-2024-10-30-79235(can only be merged by SDK owner) (Azure#38176)
* code and test * update-testcase --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 655422f commit 7be3aeb

File tree

97 files changed

+1157
-11494
lines changed

Some content is hidden

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

97 files changed

+1157
-11494
lines changed

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

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

3+
## 2.0.0 (2024-10-30)
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
## 1.2.0b1 (2023-02-14)
410

511
### Other Changes

sdk/extendedlocation/azure-mgmt-extendedlocation/README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Extended Location Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -45,8 +45,9 @@ client = CustomLocations(credential=DefaultAzureCredential(), subscription_id=su
4545

4646
## Examples
4747

48-
49-
Code samples for this package can be found at [Extended Location Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
48+
Code samples for this package can be found at:
49+
- [Search Extended Location Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
5051

5152

5253
## Troubleshooting
@@ -58,6 +59,3 @@ Code samples for this package can be found at [Extended Location Management](htt
5859
If you encounter any bugs or have suggestions, please file an issue in the
5960
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6061
section of the project.
61-
62-
63-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-extendedlocation%2FREADME.png)
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "2f17a9028f33fe80cf1ae62642fe9ed63c0a17f7",
2+
"commit": "2776cb32cd6ca9ea953a13ae26c954b989e83367",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.4.0",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.19.0",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/extendedlocation/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.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/extendedlocation/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 --tag=package-2021-08-15 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/extendedlocation/resource-manager/readme.md"
1111
}

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

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

99
from ._custom_locations import CustomLocations
10-
__all__ = ['CustomLocations']
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+
"CustomLocations",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
1925

20-
__version__ = VERSION
26+
_patch_sdk()
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
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

13-
from azure.core.configuration import Configuration
1411
from azure.core.pipeline import policies
1512
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1613

@@ -20,7 +17,8 @@
2017
# pylint: disable=unused-import,ungrouped-imports
2118
from azure.core.credentials import TokenCredential
2219

23-
class CustomLocationsConfiguration(Configuration):
20+
21+
class CustomLocationsConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2422
"""Configuration for CustomLocations.
2523
2624
Note that all parameters used to create this instance are saved as instance
@@ -30,38 +28,38 @@ class CustomLocationsConfiguration(Configuration):
3028
:type credential: ~azure.core.credentials.TokenCredential
3129
:param subscription_id: The ID of the target subscription. Required.
3230
:type subscription_id: str
31+
:keyword api_version: Api Version. Default value is "2021-08-15". Note that overriding this
32+
default value may result in unsupported behavior.
33+
:paramtype api_version: str
3334
"""
3435

35-
def __init__(
36-
self,
37-
credential: "TokenCredential",
38-
subscription_id: str,
39-
**kwargs: Any
40-
):
36+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37+
api_version: str = kwargs.pop("api_version", "2021-08-15")
38+
4139
if credential is None:
4240
raise ValueError("Parameter 'credential' must not be None.")
4341
if subscription_id is None:
4442
raise ValueError("Parameter 'subscription_id' must not be None.")
45-
super(CustomLocationsConfiguration, self).__init__(**kwargs)
4643

4744
self.credential = credential
4845
self.subscription_id = subscription_id
49-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
50-
kwargs.setdefault('sdk_moniker', 'azure-mgmt-extendedlocation/{}'.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-extendedlocation/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
5150
self._configure(**kwargs)
5251

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

0 commit comments

Comments
 (0)