Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/edgezones/azure-mgmt-edgezones/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"commit": "ab064e0047ec560a700d6b501097d99471ad817b",
"commit": "c53a93af338e6c785835d707ca26b92cd9ed67d4",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/edgezones/EdgeZones.Management",
"@azure-tools/typespec-python": "0.25.0"
"@azure-tools/typespec-python": "0.40.0"
}
25 changes: 25 additions & 0 deletions sdk/edgezones/azure-mgmt-edgezones/apiview-properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"CrossLanguagePackageId": "Microsoft.EdgeZones",
"CrossLanguageDefinitionId": {
"azure.mgmt.edgezones.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
"azure.mgmt.edgezones.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
"azure.mgmt.edgezones.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
"azure.mgmt.edgezones.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
"azure.mgmt.edgezones.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource",
"azure.mgmt.edgezones.models.ExtendedZone": "Microsoft.EdgeZones.ExtendedZone",
"azure.mgmt.edgezones.models.ExtendedZoneProperties": "Microsoft.EdgeZones.ExtendedZoneProperties",
"azure.mgmt.edgezones.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
"azure.mgmt.edgezones.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
"azure.mgmt.edgezones.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
"azure.mgmt.edgezones.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
"azure.mgmt.edgezones.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
"azure.mgmt.edgezones.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
"azure.mgmt.edgezones.models.ProvisioningState": "Microsoft.EdgeZones.ProvisioningState",
"azure.mgmt.edgezones.models.RegistrationState": "Microsoft.EdgeZones.RegistrationState",
"azure.mgmt.edgezones.EdgeZonesMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
"azure.mgmt.edgezones.EdgeZonesMgmtClient.extended_zones.get": "Microsoft.EdgeZones.ExtendedZones.get",
"azure.mgmt.edgezones.EdgeZonesMgmtClient.extended_zones.list_by_subscription": "Microsoft.EdgeZones.ExtendedZones.listBySubscription",
"azure.mgmt.edgezones.EdgeZonesMgmtClient.extended_zones.register": "Microsoft.EdgeZones.ExtendedZones.register",
"azure.mgmt.edgezones.EdgeZonesMgmtClient.extended_zones.unregister": "Microsoft.EdgeZones.ExtendedZones.unregister"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._client import EdgeZonesMgmtClient
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._client import EdgeZonesMgmtClient # type: ignore
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"EdgeZonesMgmtClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
from .operations import ExtendedZonesOperations, Operations

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


class EdgeZonesMgmtClient: # pylint: disable=client-accepts-api-version-keyword
class EdgeZonesMgmtClient:
"""EdgeZonesMgmtClient.

:ivar operations: Operations operations
Expand All @@ -50,8 +49,9 @@ def __init__(
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
_endpoint = "{endpoint}"
self._config = EdgeZonesMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
Expand All @@ -71,7 +71,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)

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

request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}

request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore

def close(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
from ._version import VERSION

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


class EdgeZonesMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
class EdgeZonesMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for EdgeZonesMgmtClient.

Note that all parameters used to create this instance are saved as instance
Expand All @@ -28,13 +27,21 @@ class EdgeZonesMgmtClientConfiguration: # pylint: disable=too-many-instance-att
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-04-01-preview". Note that overriding this default value may result in unsupported
behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2024-04-01-preview")

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

self.credential = credential
self.subscription_id = subscription_id
self.base_url = base_url
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-edgezones/{}".format(VERSION))
Expand Down
Loading