Skip to content

Commit a3180ca

Browse files
author
SDKAuto
committed
CodeGen from PR 33343 in Azure/azure-rest-api-specs
Merge 4ab7566ab3aea9daaef54f4233c93d93465f2367 into bc79b816272c7e12d79e8bc63d689327fc37d11f
1 parent 7656cf2 commit a3180ca

27 files changed

+1235
-772
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "ab064e0047ec560a700d6b501097d99471ad817b",
2+
"commit": "ab82e381507d09e6552a8051a7a3a8a744f3ff96",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/edgezones/EdgeZones.Management",
5-
"@azure-tools/typespec-python": "0.25.0"
5+
"@azure-tools/typespec-python": "0.40.0"
66
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.EdgeZones",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.edgezones.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
5+
"azure.mgmt.edgezones.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
6+
"azure.mgmt.edgezones.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
7+
"azure.mgmt.edgezones.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
8+
"azure.mgmt.edgezones.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource",
9+
"azure.mgmt.edgezones.models.ExtendedZone": "Microsoft.EdgeZones.ExtendedZone",
10+
"azure.mgmt.edgezones.models.ExtendedZoneProperties": "Microsoft.EdgeZones.ExtendedZoneProperties",
11+
"azure.mgmt.edgezones.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
12+
"azure.mgmt.edgezones.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
13+
"azure.mgmt.edgezones.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
14+
"azure.mgmt.edgezones.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
15+
"azure.mgmt.edgezones.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
16+
"azure.mgmt.edgezones.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
17+
"azure.mgmt.edgezones.models.ProvisioningState": "Microsoft.EdgeZones.ProvisioningState",
18+
"azure.mgmt.edgezones.models.RegistrationState": "Microsoft.EdgeZones.RegistrationState",
19+
"azure.mgmt.edgezones.EdgeZonesMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
20+
"azure.mgmt.edgezones.EdgeZonesMgmtClient.extended_zones.get": "Microsoft.EdgeZones.ExtendedZones.get",
21+
"azure.mgmt.edgezones.EdgeZonesMgmtClient.extended_zones.list_by_subscription": "Microsoft.EdgeZones.ExtendedZones.listBySubscription",
22+
"azure.mgmt.edgezones.EdgeZonesMgmtClient.extended_zones.register": "Microsoft.EdgeZones.ExtendedZones.register",
23+
"azure.mgmt.edgezones.EdgeZonesMgmtClient.extended_zones.unregister": "Microsoft.EdgeZones.ExtendedZones.unregister"
24+
}
25+
}

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import EdgeZonesMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import EdgeZonesMgmtClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"EdgeZonesMgmtClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/edgezones/azure-mgmt-edgezones/azure/mgmt/edgezones/_client.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
from .operations import ExtendedZonesOperations, Operations
2121

2222
if TYPE_CHECKING:
23-
# pylint: disable=unused-import,ungrouped-imports
2423
from azure.core.credentials import TokenCredential
2524

2625

27-
class EdgeZonesMgmtClient: # pylint: disable=client-accepts-api-version-keyword
26+
class EdgeZonesMgmtClient:
2827
"""EdgeZonesMgmtClient.
2928
3029
:ivar operations: Operations operations
@@ -50,8 +49,9 @@ def __init__(
5049
base_url: str = "https://management.azure.com",
5150
**kwargs: Any
5251
) -> None:
52+
_endpoint = "{endpoint}"
5353
self._config = EdgeZonesMgmtClientConfiguration(
54-
credential=credential, subscription_id=subscription_id, **kwargs
54+
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
5555
)
5656
_policies = kwargs.pop("policies", None)
5757
if _policies is None:
@@ -71,7 +71,7 @@ def __init__(
7171
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
7272
self._config.http_logging_policy,
7373
]
74-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
74+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
7575

7676
self._serialize = Serializer()
7777
self._deserialize = Deserializer()
@@ -98,7 +98,11 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9898
"""
9999

100100
request_copy = deepcopy(request)
101-
request_copy.url = self._client.format_url(request_copy.url)
101+
path_format_arguments = {
102+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
103+
}
104+
105+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
102106
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
103107

104108
def close(self) -> None:

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

21-
class EdgeZonesMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class EdgeZonesMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for EdgeZonesMgmtClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
@@ -28,13 +27,21 @@ class EdgeZonesMgmtClientConfiguration: # pylint: disable=too-many-instance-att
2827
:type credential: ~azure.core.credentials.TokenCredential
2928
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3029
:type subscription_id: str
30+
:param base_url: Service host. Default value is "https://management.azure.com".
31+
:type base_url: str
3132
:keyword api_version: The API version to use for this operation. Default value is
3233
"2024-04-01-preview". Note that overriding this default value may result in unsupported
3334
behavior.
3435
:paramtype api_version: str
3536
"""
3637

37-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38+
def __init__(
39+
self,
40+
credential: "TokenCredential",
41+
subscription_id: str,
42+
base_url: str = "https://management.azure.com",
43+
**kwargs: Any
44+
) -> None:
3845
api_version: str = kwargs.pop("api_version", "2024-04-01-preview")
3946

4047
if credential is None:
@@ -44,6 +51,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4451

4552
self.credential = credential
4653
self.subscription_id = subscription_id
54+
self.base_url = base_url
4755
self.api_version = api_version
4856
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4957
kwargs.setdefault("sdk_moniker", "mgmt-edgezones/{}".format(VERSION))

0 commit comments

Comments
 (0)