Skip to content

Commit b415f39

Browse files
author
SDKAuto
committed
CodeGen from PR 18350 in Azure/azure-rest-api-specs
Merge 99a22cee707605a406edfec88b5ec088429da91d into c52afb9c86f18f4f722e716c6a7ab4cabe337eb0
1 parent e24b848 commit b415f39

File tree

69 files changed

+8707
-1445
lines changed

Some content is hidden

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

69 files changed

+8707
-1445
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.2",
2+
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.8.0",
5-
"@autorest/modelerfour@4.19.1"
4+
"@autorest/python@5.12.0",
5+
"@autorest/modelerfour@4.19.3"
66
],
7-
"commit": "790522f1d12ec3de2274bd65bd623e99399571b9",
7+
"commit": "23977383edd3f110e58567ceff56ced5bd613939",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/redhatopenshift/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.0 --use=@autorest/modelerfour@4.19.1 --version=3.4.2",
9+
"autorest_command": "autorest specification/redhatopenshift/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
1010
"readme": "specification/redhatopenshift/resource-manager/readme.md"
1111
}

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

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

9-
from ._azure_red_hat_open_shift4_client import AzureRedHatOpenShift4Client
10-
__all__ = ['AzureRedHatOpenShift4Client']
9+
from ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
10+
__all__ = ['AzureRedHatOpenShiftClient']
1111

1212
try:
1313
from ._patch import patch_sdk # type: ignore
Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@
1616
from azure.profiles.multiapiclient import MultiApiClientMixin
1717
from msrest import Deserializer, Serializer
1818

19-
from ._configuration import AzureRedHatOpenShift4ClientConfiguration
19+
from ._configuration import AzureRedHatOpenShiftClientConfiguration
2020

2121
if TYPE_CHECKING:
2222
# pylint: disable=unused-import,ungrouped-imports
2323
from typing import Any, Optional
2424

2525
from azure.core.credentials import TokenCredential
26-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
2726

2827
class _SDKClient(object):
2928
def __init__(self, *args, **kwargs):
@@ -32,7 +31,7 @@ def __init__(self, *args, **kwargs):
3231
"""
3332
pass
3433

35-
class AzureRedHatOpenShift4Client(MultiApiClientMixin, _SDKClient):
34+
class AzureRedHatOpenShiftClient(MultiApiClientMixin, _SDKClient):
3635
"""Rest API for Azure Red Hat OpenShift 4.
3736
3837
This ready contains multiple API versions, to help you deal with all of the Azure clouds
@@ -56,8 +55,8 @@ class AzureRedHatOpenShift4Client(MultiApiClientMixin, _SDKClient):
5655
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
5756
"""
5857

59-
DEFAULT_API_VERSION = '2020-04-30'
60-
_PROFILE_TAG = "azure.mgmt.redhatopenshift.AzureRedHatOpenShift4Client"
58+
DEFAULT_API_VERSION = '2022-04-01'
59+
_PROFILE_TAG = "azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient"
6160
LATEST_PROFILE = ProfileDefinition({
6261
_PROFILE_TAG: {
6362
None: DEFAULT_API_VERSION,
@@ -70,15 +69,13 @@ def __init__(
7069
credential, # type: "TokenCredential"
7170
subscription_id, # type: str
7271
api_version=None, # type: Optional[str]
73-
base_url=None, # type: Optional[str]
72+
base_url="https://management.azure.com", # type: str
7473
profile=KnownProfiles.default, # type: KnownProfiles
7574
**kwargs # type: Any
7675
):
77-
if not base_url:
78-
base_url = 'https://management.azure.com'
79-
self._config = AzureRedHatOpenShift4ClientConfiguration(credential, subscription_id, **kwargs)
76+
self._config = AzureRedHatOpenShiftClientConfiguration(credential, subscription_id, **kwargs)
8077
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
81-
super(AzureRedHatOpenShift4Client, self).__init__(
78+
super(AzureRedHatOpenShiftClient, self).__init__(
8279
api_version=api_version,
8380
profile=profile
8481
)
@@ -92,21 +89,35 @@ def models(cls, api_version=DEFAULT_API_VERSION):
9289
"""Module depends on the API version:
9390
9491
* 2020-04-30: :mod:`v2020_04_30.models<azure.mgmt.redhatopenshift.v2020_04_30.models>`
92+
* 2021-09-01-preview: :mod:`v2021_09_01_preview.models<azure.mgmt.redhatopenshift.v2021_09_01_preview.models>`
93+
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.redhatopenshift.v2022_04_01.models>`
9594
"""
9695
if api_version == '2020-04-30':
9796
from .v2020_04_30 import models
9897
return models
98+
elif api_version == '2021-09-01-preview':
99+
from .v2021_09_01_preview import models
100+
return models
101+
elif api_version == '2022-04-01':
102+
from .v2022_04_01 import models
103+
return models
99104
raise ValueError("API version {} is not available".format(api_version))
100105

101106
@property
102107
def open_shift_clusters(self):
103108
"""Instance depends on the API version:
104109
105110
* 2020-04-30: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2020_04_30.operations.OpenShiftClustersOperations>`
111+
* 2021-09-01-preview: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2021_09_01_preview.operations.OpenShiftClustersOperations>`
112+
* 2022-04-01: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2022_04_01.operations.OpenShiftClustersOperations>`
106113
"""
107114
api_version = self._get_api_version('open_shift_clusters')
108115
if api_version == '2020-04-30':
109116
from .v2020_04_30.operations import OpenShiftClustersOperations as OperationClass
117+
elif api_version == '2021-09-01-preview':
118+
from .v2021_09_01_preview.operations import OpenShiftClustersOperations as OperationClass
119+
elif api_version == '2022-04-01':
120+
from .v2022_04_01.operations import OpenShiftClustersOperations as OperationClass
110121
else:
111122
raise ValueError("API version {} does not have operation group 'open_shift_clusters'".format(api_version))
112123
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -116,10 +127,16 @@ def operations(self):
116127
"""Instance depends on the API version:
117128
118129
* 2020-04-30: :class:`Operations<azure.mgmt.redhatopenshift.v2020_04_30.operations.Operations>`
130+
* 2021-09-01-preview: :class:`Operations<azure.mgmt.redhatopenshift.v2021_09_01_preview.operations.Operations>`
131+
* 2022-04-01: :class:`Operations<azure.mgmt.redhatopenshift.v2022_04_01.operations.Operations>`
119132
"""
120133
api_version = self._get_api_version('operations')
121134
if api_version == '2020-04-30':
122135
from .v2020_04_30.operations import Operations as OperationClass
136+
elif api_version == '2021-09-01-preview':
137+
from .v2021_09_01_preview.operations import Operations as OperationClass
138+
elif api_version == '2022-04-01':
139+
from .v2022_04_01.operations import Operations as OperationClass
123140
else:
124141
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
125142
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
15+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1616

1717
from ._version import VERSION
1818

@@ -22,8 +22,8 @@
2222

2323
from azure.core.credentials import TokenCredential
2424

25-
class AzureRedHatOpenShift4ClientConfiguration(Configuration):
26-
"""Configuration for AzureRedHatOpenShift4Client.
25+
class AzureRedHatOpenShiftClientConfiguration(Configuration):
26+
"""Configuration for AzureRedHatOpenShiftClient.
2727
2828
Note that all parameters used to create this instance are saved as instance
2929
attributes.
@@ -45,7 +45,7 @@ def __init__(
4545
raise ValueError("Parameter 'credential' must not be None.")
4646
if subscription_id is None:
4747
raise ValueError("Parameter 'subscription_id' must not be None.")
48-
super(AzureRedHatOpenShift4ClientConfiguration, self).__init__(**kwargs)
48+
super(AzureRedHatOpenShiftClientConfiguration, self).__init__(**kwargs)
4949

5050
self.credential = credential
5151
self.subscription_id = subscription_id
@@ -68,4 +68,4 @@ def _configure(
6868
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6969
self.authentication_policy = kwargs.get('authentication_policy')
7070
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
71+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

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

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

9-
from ._azure_red_hat_open_shift4_client import AzureRedHatOpenShift4Client
10-
__all__ = ['AzureRedHatOpenShift4Client']
9+
from ._azure_red_hat_open_shift_client import AzureRedHatOpenShiftClient
10+
__all__ = ['AzureRedHatOpenShiftClient']
Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111

1212
from typing import Any, Optional, TYPE_CHECKING
1313

14-
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1514
from azure.mgmt.core import AsyncARMPipelineClient
1615
from azure.profiles import KnownProfiles, ProfileDefinition
1716
from azure.profiles.multiapiclient import MultiApiClientMixin
1817
from msrest import Deserializer, Serializer
1918

20-
from ._configuration import AzureRedHatOpenShift4ClientConfiguration
19+
from ._configuration import AzureRedHatOpenShiftClientConfiguration
2120

2221
if TYPE_CHECKING:
2322
# pylint: disable=unused-import,ungrouped-imports
23+
from azure.core.credentials import TokenCredential
2424
from azure.core.credentials_async import AsyncTokenCredential
2525

2626
class _SDKClient(object):
@@ -30,7 +30,7 @@ def __init__(self, *args, **kwargs):
3030
"""
3131
pass
3232

33-
class AzureRedHatOpenShift4Client(MultiApiClientMixin, _SDKClient):
33+
class AzureRedHatOpenShiftClient(MultiApiClientMixin, _SDKClient):
3434
"""Rest API for Azure Red Hat OpenShift 4.
3535
3636
This ready contains multiple API versions, to help you deal with all of the Azure clouds
@@ -54,8 +54,8 @@ class AzureRedHatOpenShift4Client(MultiApiClientMixin, _SDKClient):
5454
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
5555
"""
5656

57-
DEFAULT_API_VERSION = '2020-04-30'
58-
_PROFILE_TAG = "azure.mgmt.redhatopenshift.AzureRedHatOpenShift4Client"
57+
DEFAULT_API_VERSION = '2022-04-01'
58+
_PROFILE_TAG = "azure.mgmt.redhatopenshift.AzureRedHatOpenShiftClient"
5959
LATEST_PROFILE = ProfileDefinition({
6060
_PROFILE_TAG: {
6161
None: DEFAULT_API_VERSION,
@@ -68,15 +68,13 @@ def __init__(
6868
credential: "AsyncTokenCredential",
6969
subscription_id: str,
7070
api_version: Optional[str] = None,
71-
base_url: Optional[str] = None,
71+
base_url: str = "https://management.azure.com",
7272
profile: KnownProfiles = KnownProfiles.default,
7373
**kwargs # type: Any
7474
) -> None:
75-
if not base_url:
76-
base_url = 'https://management.azure.com'
77-
self._config = AzureRedHatOpenShift4ClientConfiguration(credential, subscription_id, **kwargs)
75+
self._config = AzureRedHatOpenShiftClientConfiguration(credential, subscription_id, **kwargs)
7876
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
79-
super(AzureRedHatOpenShift4Client, self).__init__(
77+
super(AzureRedHatOpenShiftClient, self).__init__(
8078
api_version=api_version,
8179
profile=profile
8280
)
@@ -90,21 +88,35 @@ def models(cls, api_version=DEFAULT_API_VERSION):
9088
"""Module depends on the API version:
9189
9290
* 2020-04-30: :mod:`v2020_04_30.models<azure.mgmt.redhatopenshift.v2020_04_30.models>`
91+
* 2021-09-01-preview: :mod:`v2021_09_01_preview.models<azure.mgmt.redhatopenshift.v2021_09_01_preview.models>`
92+
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.redhatopenshift.v2022_04_01.models>`
9393
"""
9494
if api_version == '2020-04-30':
9595
from ..v2020_04_30 import models
9696
return models
97+
elif api_version == '2021-09-01-preview':
98+
from ..v2021_09_01_preview import models
99+
return models
100+
elif api_version == '2022-04-01':
101+
from ..v2022_04_01 import models
102+
return models
97103
raise ValueError("API version {} is not available".format(api_version))
98104

99105
@property
100106
def open_shift_clusters(self):
101107
"""Instance depends on the API version:
102108
103109
* 2020-04-30: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2020_04_30.aio.operations.OpenShiftClustersOperations>`
110+
* 2021-09-01-preview: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2021_09_01_preview.aio.operations.OpenShiftClustersOperations>`
111+
* 2022-04-01: :class:`OpenShiftClustersOperations<azure.mgmt.redhatopenshift.v2022_04_01.aio.operations.OpenShiftClustersOperations>`
104112
"""
105113
api_version = self._get_api_version('open_shift_clusters')
106114
if api_version == '2020-04-30':
107115
from ..v2020_04_30.aio.operations import OpenShiftClustersOperations as OperationClass
116+
elif api_version == '2021-09-01-preview':
117+
from ..v2021_09_01_preview.aio.operations import OpenShiftClustersOperations as OperationClass
118+
elif api_version == '2022-04-01':
119+
from ..v2022_04_01.aio.operations import OpenShiftClustersOperations as OperationClass
108120
else:
109121
raise ValueError("API version {} does not have operation group 'open_shift_clusters'".format(api_version))
110122
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -114,10 +126,16 @@ def operations(self):
114126
"""Instance depends on the API version:
115127
116128
* 2020-04-30: :class:`Operations<azure.mgmt.redhatopenshift.v2020_04_30.aio.operations.Operations>`
129+
* 2021-09-01-preview: :class:`Operations<azure.mgmt.redhatopenshift.v2021_09_01_preview.aio.operations.Operations>`
130+
* 2022-04-01: :class:`Operations<azure.mgmt.redhatopenshift.v2022_04_01.aio.operations.Operations>`
117131
"""
118132
api_version = self._get_api_version('operations')
119133
if api_version == '2020-04-30':
120134
from ..v2020_04_30.aio.operations import Operations as OperationClass
135+
elif api_version == '2021-09-01-preview':
136+
from ..v2021_09_01_preview.aio.operations import Operations as OperationClass
137+
elif api_version == '2022-04-01':
138+
from ..v2022_04_01.aio.operations import Operations as OperationClass
121139
else:
122140
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
123141
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
15-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
15+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
1616

1717
from .._version import VERSION
1818

1919
if TYPE_CHECKING:
2020
# pylint: disable=unused-import,ungrouped-imports
2121
from azure.core.credentials_async import AsyncTokenCredential
2222

23-
class AzureRedHatOpenShift4ClientConfiguration(Configuration):
24-
"""Configuration for AzureRedHatOpenShift4Client.
23+
class AzureRedHatOpenShiftClientConfiguration(Configuration):
24+
"""Configuration for AzureRedHatOpenShiftClient.
2525
2626
Note that all parameters used to create this instance are saved as instance
2727
attributes.
@@ -42,7 +42,7 @@ def __init__(
4242
raise ValueError("Parameter 'credential' must not be None.")
4343
if subscription_id is None:
4444
raise ValueError("Parameter 'subscription_id' must not be None.")
45-
super(AzureRedHatOpenShift4ClientConfiguration, self).__init__(**kwargs)
45+
super(AzureRedHatOpenShiftClientConfiguration, self).__init__(**kwargs)
4646

4747
self.credential = credential
4848
self.subscription_id = subscription_id
@@ -64,4 +64,4 @@ def _configure(
6464
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
6565
self.authentication_policy = kwargs.get('authentication_policy')
6666
if self.credential and not self.authentication_policy:
67-
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
67+
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Licensed under the MIT License. See License.txt in the project root for
55
# license information.
66
# --------------------------------------------------------------------------
7-
from .v2020_04_30.models import *
7+
from .v2022_04_01.models import *

sdk/redhatopenshift/azure-mgmt-redhatopenshift/azure/mgmt/redhatopenshift/v2020_04_30/__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__ = ['AzureRedHatOpenShift4Client']
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()

0 commit comments

Comments
 (0)