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
8 changes: 4 additions & 4 deletions sdk/deviceregistry/azure-mgmt-deviceregistry/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "1f6e89637068d59b5ae935de9a88d5742d12f8e6",
"commit": "ce183066e150dc49f27b52874facd569fcbb24ec",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.7",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.13.7",
"@autorest/python@6.19.0",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/deviceregistry/resource-manager/readme.md --generate-sample=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.13.7 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
"autorest_command": "autorest specification/deviceregistry/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/deviceregistry/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ class DeviceRegistryMgmtClientConfiguration: # pylint: disable=too-many-instanc

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2024-11-01". 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:
api_version: str = kwargs.pop("api_version", "2023-11-01-preview")
api_version: str = kwargs.pop("api_version", "2024-11-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
Expand All @@ -17,7 +18,13 @@
from . import models as _models
from ._configuration import DeviceRegistryMgmtClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import AssetEndpointProfilesOperations, AssetsOperations, OperationStatusOperations, Operations
from .operations import (
AssetEndpointProfilesOperations,
AssetsOperations,
BillingContainersOperations,
OperationStatusOperations,
Operations,
)

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
Expand All @@ -34,16 +41,18 @@ class DeviceRegistryMgmtClient: # pylint: disable=client-accepts-api-version-ke
azure.mgmt.deviceregistry.operations.AssetEndpointProfilesOperations
:ivar assets: AssetsOperations operations
:vartype assets: azure.mgmt.deviceregistry.operations.AssetsOperations
:ivar billing_containers: BillingContainersOperations operations
:vartype billing_containers: azure.mgmt.deviceregistry.operations.BillingContainersOperations
:ivar operation_status: OperationStatusOperations operations
:vartype operation_status: azure.mgmt.deviceregistry.operations.OperationStatusOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2024-11-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
Expand Down Expand Up @@ -88,6 +97,9 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.assets = AssetsOperations(self._client, self._config, self._serialize, self._deserialize)
self.billing_containers = BillingContainersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operation_status = OperationStatusOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down Expand Up @@ -117,7 +129,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "DeviceRegistryMgmtClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def _json_attemp(data):
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
raise DeserializationError("XML is invalid") from err
elif content_type.startswith("text/"):
return data_as_str
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))

@classmethod
Expand Down Expand Up @@ -1441,7 +1443,7 @@ def _deserialize(self, target_obj, data):
elif isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)

if data is None:
if data is None or data is CoreNull:
return data
try:
attributes = response._attribute_map # type: ignore
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ class DeviceRegistryMgmtClientConfiguration: # pylint: disable=too-many-instanc

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2024-11-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2023-11-01-preview")
api_version: str = kwargs.pop("api_version", "2024-11-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
Expand All @@ -17,7 +18,13 @@
from .. import models as _models
from .._serialization import Deserializer, Serializer
from ._configuration import DeviceRegistryMgmtClientConfiguration
from .operations import AssetEndpointProfilesOperations, AssetsOperations, OperationStatusOperations, Operations
from .operations import (
AssetEndpointProfilesOperations,
AssetsOperations,
BillingContainersOperations,
OperationStatusOperations,
Operations,
)

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
Expand All @@ -34,16 +41,19 @@ class DeviceRegistryMgmtClient: # pylint: disable=client-accepts-api-version-ke
azure.mgmt.deviceregistry.aio.operations.AssetEndpointProfilesOperations
:ivar assets: AssetsOperations operations
:vartype assets: azure.mgmt.deviceregistry.aio.operations.AssetsOperations
:ivar billing_containers: BillingContainersOperations operations
:vartype billing_containers:
azure.mgmt.deviceregistry.aio.operations.BillingContainersOperations
:ivar operation_status: OperationStatusOperations operations
:vartype operation_status: azure.mgmt.deviceregistry.aio.operations.OperationStatusOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2024-11-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
Expand Down Expand Up @@ -88,6 +98,9 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.assets = AssetsOperations(self._client, self._config, self._serialize, self._deserialize)
self.billing_containers = BillingContainersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operation_status = OperationStatusOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down Expand Up @@ -119,7 +132,7 @@ def _send_request(
async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "DeviceRegistryMgmtClient":
async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from ._operations import Operations
from ._asset_endpoint_profiles_operations import AssetEndpointProfilesOperations
from ._assets_operations import AssetsOperations
from ._billing_containers_operations import BillingContainersOperations
from ._operation_status_operations import OperationStatusOperations

from ._patch import __all__ as _patch_all
Expand All @@ -19,6 +20,7 @@
"Operations",
"AssetEndpointProfilesOperations",
"AssetsOperations",
"BillingContainersOperations",
"OperationStatusOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
Expand Down
Loading