Skip to content

Commit de8ab7b

Browse files
azure-sdkChenxiJiang333
authored andcommitted
[AutoRelease] t2-redhatopenshift-2024-10-30-81004(can only be merged by SDK owner) (Azure#38181)
* code and test * update-testcase * Update CHANGELOG.md * Update _meta.json --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <v-chenjiang@microsoft.com> Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com>
1 parent 8752143 commit de8ab7b

243 files changed

Lines changed: 903 additions & 46116 deletions

File tree

Some content is hidden

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

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

Lines changed: 6 additions & 0 deletions
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.5.0 (2024-07-22)
410

511
### Features Added
Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
{
2-
"commit": "260f4f4012b3bebac33ea4db5c56105dd2fd33da",
2+
"commit": "2776cb32cd6ca9ea953a13ae26c954b989e83367",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.15.0",
6+
"@autorest/python@6.19.0",
77
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/readme.md --generate-sample=True --generate-test=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.15.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/readme.md",
11-
"package-2020-04-30": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2020-04-30/redhatopenshift.json",
12-
"package-2021-09-01-preview": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 preview/2021-09-01-preview/redhatopenshift.json",
13-
"package-2022-04-01": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2022-04-01/redhatopenshift.json",
14-
"package-2022-09-04": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2022-09-04/redhatopenshift.json",
15-
"package-2023-04-01": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2023-04-01/redhatopenshift.json",
16-
"package-2023-09-04": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2023-09-04/redhatopenshift.json",
17-
"package-2023-11": "2024-05-15 18:25:55 +0200 7dae1e5f45f91ec89d16a628e102341490ced849 stable/2023-11-22/redhatopenshift.json"
18-
}
9+
"autorest_command": "autorest specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/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-2023-11 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
10+
"readme": "specification/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/readme.md"
11+
}

sdk/redhatopenshift/azure-mgmt-redhatopenshift/assets.json

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

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@
77
# --------------------------------------------------------------------------
88

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

20-
__version__ = VERSION
26+
_patch_sdk()

sdk/redhatopenshift/azure-mgmt-redhatopenshift/azure/mgmt/redhatopenshift/_azure_red_hat_open_shift_client.py

Lines changed: 80 additions & 263 deletions
Large diffs are not rendered by default.
Lines changed: 27 additions & 28 deletions
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 AzureRedHatOpenShiftClientConfiguration:
20+
21+
class AzureRedHatOpenShiftClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for AzureRedHatOpenShiftClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -29,38 +28,38 @@ class AzureRedHatOpenShiftClientConfiguration:
2928
:type credential: ~azure.core.credentials.TokenCredential
3029
:param subscription_id: The ID of the target subscription. Required.
3130
:type subscription_id: str
31+
:keyword api_version: Api Version. Default value is "2023-11-22". 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", "2023-11-22")
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-redhatopenshift/{}'.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-redhatopenshift/{}".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/redhatopenshift/azure-mgmt-redhatopenshift/azure/mgmt/redhatopenshift/v2020_04_30/aio/operations/_patch.py renamed to sdk/redhatopenshift/azure-mgmt-redhatopenshift/azure/mgmt/redhatopenshift/_patch.py

File renamed without changes.

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

Lines changed: 6 additions & 12 deletions
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,

sdk/redhatopenshift/azure-mgmt-redhatopenshift/azure/mgmt/redhatopenshift/_version.py

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

9-
VERSION = "1.5.0"
10-
9+
VERSION = "2.0.0"

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,17 @@
77
# --------------------------------------------------------------------------
88

99
from ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
10-
__all__ = ['AzureRedHatOpenShiftClient']
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+
"AzureRedHatOpenShiftClient",
20+
]
21+
__all__.extend([p for p in _patch_all if p not in __all__])
22+
23+
_patch_sdk()

0 commit comments

Comments
 (0)