Skip to content

Commit a28e717

Browse files
author
SDKAuto
committed
CodeGen from PR 14046 in Azure/azure-rest-api-specs
Merge 6ef6f558f9ee734f461f074c1dd639bb543de240 into b4276bd
1 parent 8092bc0 commit a28e717

File tree

85 files changed

+12512
-1031
lines changed

Some content is hidden

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

85 files changed

+12512
-1031
lines changed

sdk/eventhub/azure-mgmt-eventhub/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"autorest": "3.3.0",
3+
"use": "@autorest/[email protected]",
4+
"commit": "6188f939c4dc08eb3f7720d2201ebbf0152eae6c",
5+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6+
"autorest_command": "autorest specification/eventhub/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/[email protected] --version=3.3.0",
7+
"readme": "specification/eventhub/resource-manager/readme.md"
8+
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@
88
# Changes may cause incorrect behavior and will be lost if the code is
99
# regenerated.
1010
# --------------------------------------------------------------------------
11-
from typing import Any
11+
from typing import TYPE_CHECKING
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
1515
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
1616

1717
from ._version import VERSION
1818

19+
if TYPE_CHECKING:
20+
# pylint: disable=unused-import,ungrouped-imports
21+
from typing import Any
22+
23+
from azure.core.credentials import TokenCredential
1924

2025
class EventHubManagementClientConfiguration(Configuration):
2126
"""Configuration for EventHubManagementClient.

sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_event_hub_management_client.py

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from azure.mgmt.core import ARMPipelineClient
13-
from msrest import Serializer, Deserializer
12+
from typing import TYPE_CHECKING
1413

14+
from azure.mgmt.core import ARMPipelineClient
1515
from azure.profiles import KnownProfiles, ProfileDefinition
1616
from azure.profiles.multiapiclient import MultiApiClientMixin
17+
from msrest import Deserializer, Serializer
18+
1719
from ._configuration import EventHubManagementClientConfiguration
1820

21+
if TYPE_CHECKING:
22+
# pylint: disable=unused-import,ungrouped-imports
23+
from typing import Any, Optional
24+
25+
from azure.core.credentials import TokenCredential
26+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
27+
1928
class _SDKClient(object):
2029
def __init__(self, *args, **kwargs):
2130
"""This is a fake class to support current implemetation of MultiApiClientMixin."
@@ -38,9 +47,10 @@ class EventHubManagementClient(MultiApiClientMixin, _SDKClient):
3847
:type credential: ~azure.core.credentials.TokenCredential
3948
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
4049
:type subscription_id: str
41-
:param str api_version: API version to use if no profile is provided, or if
42-
missing in profile.
43-
:param str base_url: Service URL
50+
:param api_version: API version to use if no profile is provided, or if missing in profile.
51+
:type api_version: str
52+
:param base_url: Service URL
53+
:type base_url: str
4454
:param profile: A profile definition, from KnownProfiles to dict.
4555
:type profile: azure.profiles.KnownProfiles
4656
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
@@ -59,9 +69,9 @@ def __init__(
5969
self,
6070
credential, # type: "TokenCredential"
6171
subscription_id, # type: str
62-
api_version=None,
63-
base_url=None,
64-
profile=KnownProfiles.default,
72+
api_version=None, # type: Optional[str]
73+
base_url=None, # type: Optional[str]
74+
profile=KnownProfiles.default, # type: KnownProfiles
6575
**kwargs # type: Any
6676
):
6777
if not base_url:
@@ -84,6 +94,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
8494
* 2015-08-01: :mod:`v2015_08_01.models<azure.mgmt.eventhub.v2015_08_01.models>`
8595
* 2017-04-01: :mod:`v2017_04_01.models<azure.mgmt.eventhub.v2017_04_01.models>`
8696
* 2018-01-01-preview: :mod:`v2018_01_01_preview.models<azure.mgmt.eventhub.v2018_01_01_preview.models>`
97+
* 2021-01-01-preview: :mod:`v2021_01_01_preview.models<azure.mgmt.eventhub.v2021_01_01_preview.models>`
8798
"""
8899
if api_version == '2015-08-01':
89100
from .v2015_08_01 import models
@@ -94,6 +105,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
94105
elif api_version == '2018-01-01-preview':
95106
from .v2018_01_01_preview import models
96107
return models
108+
elif api_version == '2021-01-01-preview':
109+
from .v2021_01_01_preview import models
110+
return models
97111
raise ValueError("API version {} is not available".format(api_version))
98112

99113
@property
@@ -129,6 +143,7 @@ def consumer_groups(self):
129143
* 2015-08-01: :class:`ConsumerGroupsOperations<azure.mgmt.eventhub.v2015_08_01.operations.ConsumerGroupsOperations>`
130144
* 2017-04-01: :class:`ConsumerGroupsOperations<azure.mgmt.eventhub.v2017_04_01.operations.ConsumerGroupsOperations>`
131145
* 2018-01-01-preview: :class:`ConsumerGroupsOperations<azure.mgmt.eventhub.v2018_01_01_preview.operations.ConsumerGroupsOperations>`
146+
* 2021-01-01-preview: :class:`ConsumerGroupsOperations<azure.mgmt.eventhub.v2021_01_01_preview.operations.ConsumerGroupsOperations>`
132147
"""
133148
api_version = self._get_api_version('consumer_groups')
134149
if api_version == '2015-08-01':
@@ -137,6 +152,8 @@ def consumer_groups(self):
137152
from .v2017_04_01.operations import ConsumerGroupsOperations as OperationClass
138153
elif api_version == '2018-01-01-preview':
139154
from .v2018_01_01_preview.operations import ConsumerGroupsOperations as OperationClass
155+
elif api_version == '2021-01-01-preview':
156+
from .v2021_01_01_preview.operations import ConsumerGroupsOperations as OperationClass
140157
else:
141158
raise ValueError("API version {} does not have operation group 'consumer_groups'".format(api_version))
142159
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -147,12 +164,15 @@ def disaster_recovery_configs(self):
147164
148165
* 2017-04-01: :class:`DisasterRecoveryConfigsOperations<azure.mgmt.eventhub.v2017_04_01.operations.DisasterRecoveryConfigsOperations>`
149166
* 2018-01-01-preview: :class:`DisasterRecoveryConfigsOperations<azure.mgmt.eventhub.v2018_01_01_preview.operations.DisasterRecoveryConfigsOperations>`
167+
* 2021-01-01-preview: :class:`DisasterRecoveryConfigsOperations<azure.mgmt.eventhub.v2021_01_01_preview.operations.DisasterRecoveryConfigsOperations>`
150168
"""
151169
api_version = self._get_api_version('disaster_recovery_configs')
152170
if api_version == '2017-04-01':
153171
from .v2017_04_01.operations import DisasterRecoveryConfigsOperations as OperationClass
154172
elif api_version == '2018-01-01-preview':
155173
from .v2018_01_01_preview.operations import DisasterRecoveryConfigsOperations as OperationClass
174+
elif api_version == '2021-01-01-preview':
175+
from .v2021_01_01_preview.operations import DisasterRecoveryConfigsOperations as OperationClass
156176
else:
157177
raise ValueError("API version {} does not have operation group 'disaster_recovery_configs'".format(api_version))
158178
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -164,6 +184,7 @@ def event_hubs(self):
164184
* 2015-08-01: :class:`EventHubsOperations<azure.mgmt.eventhub.v2015_08_01.operations.EventHubsOperations>`
165185
* 2017-04-01: :class:`EventHubsOperations<azure.mgmt.eventhub.v2017_04_01.operations.EventHubsOperations>`
166186
* 2018-01-01-preview: :class:`EventHubsOperations<azure.mgmt.eventhub.v2018_01_01_preview.operations.EventHubsOperations>`
187+
* 2021-01-01-preview: :class:`EventHubsOperations<azure.mgmt.eventhub.v2021_01_01_preview.operations.EventHubsOperations>`
167188
"""
168189
api_version = self._get_api_version('event_hubs')
169190
if api_version == '2015-08-01':
@@ -172,6 +193,8 @@ def event_hubs(self):
172193
from .v2017_04_01.operations import EventHubsOperations as OperationClass
173194
elif api_version == '2018-01-01-preview':
174195
from .v2018_01_01_preview.operations import EventHubsOperations as OperationClass
196+
elif api_version == '2021-01-01-preview':
197+
from .v2021_01_01_preview.operations import EventHubsOperations as OperationClass
175198
else:
176199
raise ValueError("API version {} does not have operation group 'event_hubs'".format(api_version))
177200
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -183,6 +206,7 @@ def namespaces(self):
183206
* 2015-08-01: :class:`NamespacesOperations<azure.mgmt.eventhub.v2015_08_01.operations.NamespacesOperations>`
184207
* 2017-04-01: :class:`NamespacesOperations<azure.mgmt.eventhub.v2017_04_01.operations.NamespacesOperations>`
185208
* 2018-01-01-preview: :class:`NamespacesOperations<azure.mgmt.eventhub.v2018_01_01_preview.operations.NamespacesOperations>`
209+
* 2021-01-01-preview: :class:`NamespacesOperations<azure.mgmt.eventhub.v2021_01_01_preview.operations.NamespacesOperations>`
186210
"""
187211
api_version = self._get_api_version('namespaces')
188212
if api_version == '2015-08-01':
@@ -191,6 +215,8 @@ def namespaces(self):
191215
from .v2017_04_01.operations import NamespacesOperations as OperationClass
192216
elif api_version == '2018-01-01-preview':
193217
from .v2018_01_01_preview.operations import NamespacesOperations as OperationClass
218+
elif api_version == '2021-01-01-preview':
219+
from .v2021_01_01_preview.operations import NamespacesOperations as OperationClass
194220
else:
195221
raise ValueError("API version {} does not have operation group 'namespaces'".format(api_version))
196222
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -202,6 +228,7 @@ def operations(self):
202228
* 2015-08-01: :class:`Operations<azure.mgmt.eventhub.v2015_08_01.operations.Operations>`
203229
* 2017-04-01: :class:`Operations<azure.mgmt.eventhub.v2017_04_01.operations.Operations>`
204230
* 2018-01-01-preview: :class:`Operations<azure.mgmt.eventhub.v2018_01_01_preview.operations.Operations>`
231+
* 2021-01-01-preview: :class:`Operations<azure.mgmt.eventhub.v2021_01_01_preview.operations.Operations>`
205232
"""
206233
api_version = self._get_api_version('operations')
207234
if api_version == '2015-08-01':
@@ -210,6 +237,8 @@ def operations(self):
210237
from .v2017_04_01.operations import Operations as OperationClass
211238
elif api_version == '2018-01-01-preview':
212239
from .v2018_01_01_preview.operations import Operations as OperationClass
240+
elif api_version == '2021-01-01-preview':
241+
from .v2021_01_01_preview.operations import Operations as OperationClass
213242
else:
214243
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
215244
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -219,10 +248,13 @@ def private_endpoint_connections(self):
219248
"""Instance depends on the API version:
220249
221250
* 2018-01-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.eventhub.v2018_01_01_preview.operations.PrivateEndpointConnectionsOperations>`
251+
* 2021-01-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.eventhub.v2021_01_01_preview.operations.PrivateEndpointConnectionsOperations>`
222252
"""
223253
api_version = self._get_api_version('private_endpoint_connections')
224254
if api_version == '2018-01-01-preview':
225255
from .v2018_01_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
256+
elif api_version == '2021-01-01-preview':
257+
from .v2021_01_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
226258
else:
227259
raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version))
228260
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -232,10 +264,13 @@ def private_link_resources(self):
232264
"""Instance depends on the API version:
233265
234266
* 2018-01-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.eventhub.v2018_01_01_preview.operations.PrivateLinkResourcesOperations>`
267+
* 2021-01-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.eventhub.v2021_01_01_preview.operations.PrivateLinkResourcesOperations>`
235268
"""
236269
api_version = self._get_api_version('private_link_resources')
237270
if api_version == '2018-01-01-preview':
238271
from .v2018_01_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
272+
elif api_version == '2021-01-01-preview':
273+
from .v2021_01_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
239274
else:
240275
raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version))
241276
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
# Changes may cause incorrect behavior and will be lost if the code is
99
# regenerated.
1010
# --------------------------------------------------------------------------
11-
from typing import Any
11+
from typing import Any, TYPE_CHECKING
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
1515
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
1616

1717
from .._version import VERSION
1818

19+
if TYPE_CHECKING:
20+
# pylint: disable=unused-import,ungrouped-imports
21+
from azure.core.credentials_async import AsyncTokenCredential
1922

2023
class EventHubManagementClientConfiguration(Configuration):
2124
"""Configuration for EventHubManagementClient.
@@ -31,8 +34,8 @@ class EventHubManagementClientConfiguration(Configuration):
3134

3235
def __init__(
3336
self,
34-
credential, # type: "AsyncTokenCredential"
35-
subscription_id, # type: str
37+
credential: "AsyncTokenCredential",
38+
subscription_id: str,
3639
**kwargs # type: Any
3740
) -> None:
3841
if credential is None:

0 commit comments

Comments
 (0)